]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mfd: arizona: Simplify with spi_get_device_match_data()
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Thu, 6 Jun 2024 14:24:56 +0000 (16:24 +0200)
committerLee Jones <lee@kernel.org>
Thu, 4 Jul 2024 16:38:40 +0000 (17:38 +0100)
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>
drivers/mfd/arizona-spi.c

index de5d894ac04af8e2a3c1bbeb2f426a244ad83c26..eaa2b2bc5dd011b4192214349acf4eb5c3fc0640 100644 (file)
@@ -190,19 +190,12 @@ static int arizona_spi_acpi_probe(struct arizona *arizona)
 
 static int arizona_spi_probe(struct spi_device *spi)
 {
-       const struct spi_device_id *id = spi_get_device_id(spi);
-       const void *match_data;
        struct arizona *arizona;
        const struct regmap_config *regmap_config = NULL;
        unsigned long type = 0;
        int ret;
 
-       match_data = device_get_match_data(&spi->dev);
-       if (match_data)
-               type = (unsigned long)match_data;
-       else if (id)
-               type = id->driver_data;
-
+       type = (unsigned long)spi_get_device_match_data(spi);
        switch (type) {
        case WM5102:
                if (IS_ENABLED(CONFIG_MFD_WM5102))