]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mfd: madera: Simplify with spi_get_device_match_data()
authorKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Thu, 6 Jun 2024 14:24:57 +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-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/madera-spi.c

index ad07ebe29e593a67d3364e83c13b2e75c0ec8922..ce9e90322c9ca3cd08b93746aad423b4316f68dc 100644 (file)
 
 static int madera_spi_probe(struct spi_device *spi)
 {
-       const struct spi_device_id *id = spi_get_device_id(spi);
        struct madera *madera;
        const struct regmap_config *regmap_16bit_config = NULL;
        const struct regmap_config *regmap_32bit_config = NULL;
-       const void *of_data;
        unsigned long type;
        const char *name;
        int ret;
 
-       of_data = of_device_get_match_data(&spi->dev);
-       if (of_data)
-               type = (unsigned long)of_data;
-       else
-               type = id->driver_data;
-
+       type = (unsigned long)spi_get_device_match_data(spi);
        switch (type) {
        case CS47L15:
                if (IS_ENABLED(CONFIG_MFD_CS47L15)) {