Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mfd: madera: Simplify with spi_get_device_match_data()

Use spi_get_device_match_data() helper to simplify a bit the driver.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20240606142457.130553-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Lee Jones
0ddabc8c a49d9bae

+1 -8
+1 -8
drivers/mfd/madera-spi.c
··· 18 18 19 19 static int madera_spi_probe(struct spi_device *spi) 20 20 { 21 - const struct spi_device_id *id = spi_get_device_id(spi); 22 21 struct madera *madera; 23 22 const struct regmap_config *regmap_16bit_config = NULL; 24 23 const struct regmap_config *regmap_32bit_config = NULL; 25 - const void *of_data; 26 24 unsigned long type; 27 25 const char *name; 28 26 int ret; 29 27 30 - of_data = of_device_get_match_data(&spi->dev); 31 - if (of_data) 32 - type = (unsigned long)of_data; 33 - else 34 - type = id->driver_data; 35 - 28 + type = (unsigned long)spi_get_device_match_data(spi); 36 29 switch (type) { 37 30 case CS47L15: 38 31 if (IS_ENABLED(CONFIG_MFD_CS47L15)) {