From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Moritz Fischer <mdf@kernel.org>, Xu Yilun <yilun.xu@intel.com>,
Tom Rix <trix@redhat.com>
Subject: [PATCH v1 1/1] fpga: lattice-sysconfig-spi: simplify with spi_get_device_match_data()
Date: Fri, 8 May 2026 10:06:50 +0200 [thread overview]
Message-ID: <20260508080650.1144588-1-andriy.shevchenko@linux.intel.com> (raw)
Use spi_get_device_match_data() helper to simplify a bit the driver.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/fpga/lattice-sysconfig-spi.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/drivers/fpga/lattice-sysconfig-spi.c b/drivers/fpga/lattice-sysconfig-spi.c
index 44691cfcf50a..6a906df45941 100644
--- a/drivers/fpga/lattice-sysconfig-spi.c
+++ b/drivers/fpga/lattice-sysconfig-spi.c
@@ -85,7 +85,6 @@ static int sysconfig_spi_bitstream_burst_complete(struct sysconfig_priv *priv)
static int sysconfig_spi_probe(struct spi_device *spi)
{
- const struct spi_device_id *dev_id;
struct device *dev = &spi->dev;
struct sysconfig_priv *priv;
const u32 *spi_max_speed;
@@ -94,15 +93,7 @@ static int sysconfig_spi_probe(struct spi_device *spi)
if (!priv)
return -ENOMEM;
- spi_max_speed = device_get_match_data(dev);
- if (!spi_max_speed) {
- dev_id = spi_get_device_id(spi);
- if (!dev_id)
- return -ENODEV;
-
- spi_max_speed = (const u32 *)dev_id->driver_data;
- }
-
+ spi_max_speed = spi_get_device_match_data(dev);
if (!spi_max_speed)
return -EINVAL;
--
2.50.1
next reply other threads:[~2026-05-08 8:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 8:06 Andy Shevchenko [this message]
2026-05-09 11:39 ` [PATCH v1 1/1] fpga: lattice-sysconfig-spi: simplify with spi_get_device_match_data() kernel test robot
2026-05-09 13:47 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260508080650.1144588-1-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mdf@kernel.org \
--cc=trix@redhat.com \
--cc=yilun.xu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox