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

mfd: arizona: 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-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>

authored by

Krzysztof Kozlowski and committed by
Lee Jones
a49d9bae 7b28133d

+1 -8
+1 -8
drivers/mfd/arizona-spi.c
··· 190 190 191 191 static int arizona_spi_probe(struct spi_device *spi) 192 192 { 193 - const struct spi_device_id *id = spi_get_device_id(spi); 194 - const void *match_data; 195 193 struct arizona *arizona; 196 194 const struct regmap_config *regmap_config = NULL; 197 195 unsigned long type = 0; 198 196 int ret; 199 197 200 - match_data = device_get_match_data(&spi->dev); 201 - if (match_data) 202 - type = (unsigned long)match_data; 203 - else if (id) 204 - type = id->driver_data; 205 - 198 + type = (unsigned long)spi_get_device_match_data(spi); 206 199 switch (type) { 207 200 case WM5102: 208 201 if (IS_ENABLED(CONFIG_MFD_WM5102))