* [PATCH v2 1/1] fpga: lattice-sysconfig-spi: simplify with spi_get_device_match_data()
@ 2026-05-10 8:51 Andy Shevchenko
2026-05-11 15:13 ` Xu Yilun
0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2026-05-10 8:51 UTC (permalink / raw)
To: Andy Shevchenko, linux-fpga, linux-kernel
Cc: Moritz Fischer, Xu Yilun, Tom Rix
Use spi_get_device_match_data() helper to simplify a bit the driver.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
v2: used correct parameter (LKP)
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..a62ee5b7bfeb 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(spi);
if (!spi_max_speed)
return -EINVAL;
--
2.50.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2 1/1] fpga: lattice-sysconfig-spi: simplify with spi_get_device_match_data()
2026-05-10 8:51 [PATCH v2 1/1] fpga: lattice-sysconfig-spi: simplify with spi_get_device_match_data() Andy Shevchenko
@ 2026-05-11 15:13 ` Xu Yilun
0 siblings, 0 replies; 2+ messages in thread
From: Xu Yilun @ 2026-05-11 15:13 UTC (permalink / raw)
To: Andy Shevchenko
Cc: linux-fpga, linux-kernel, Moritz Fischer, Xu Yilun, Tom Rix
On Sun, May 10, 2026 at 10:51:58AM +0200, Andy Shevchenko wrote:
> Use spi_get_device_match_data() helper to simplify a bit the driver.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Xu Yilun <yilun.xu@intel.com>
Applied to for-next.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-05-11 15:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-10 8:51 [PATCH v2 1/1] fpga: lattice-sysconfig-spi: simplify with spi_get_device_match_data() Andy Shevchenko
2026-05-11 15:13 ` Xu Yilun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox