From: Andy Shevchenko Date: Sun, 10 May 2026 08:51:58 +0000 (+0200) Subject: fpga: lattice-sysconfig-spi: simplify with spi_get_device_match_data() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24da2324f8d2679a1a6b2ad72910e6a43bf344fa;p=thirdparty%2Fkernel%2Flinux.git fpga: lattice-sysconfig-spi: simplify with spi_get_device_match_data() Use spi_get_device_match_data() helper to simplify a bit the driver. Signed-off-by: Andy Shevchenko Reviewed-by: Xu Yilun Link: https://lore.kernel.org/r/20260510090556.1582900-1-andriy.shevchenko@linux.intel.com Signed-off-by: Xu Yilun --- diff --git a/drivers/fpga/lattice-sysconfig-spi.c b/drivers/fpga/lattice-sysconfig-spi.c index 3cabf5c160703..5d195602b2615 100644 --- a/drivers/fpga/lattice-sysconfig-spi.c +++ b/drivers/fpga/lattice-sysconfig-spi.c @@ -91,7 +91,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; @@ -100,15 +99,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;