eeprom: at25: Convert to use fwnode_device_is_compatible()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 19 Jan 2023 17:57:42 +0000 (19:57 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 20 Jan 2023 11:05:01 +0000 (12:05 +0100)
Replace open coded fwnode_device_is_compatible() in the driver.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230119175742.77723-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/eeprom/at25.c

index bdffc6543f6f8b7f7addb03744544e7af60c1be4..65d49a6de1a7a133417cf14c3c0cdf26ef707b72 100644 (file)
@@ -437,12 +437,6 @@ static int at25_probe(struct spi_device *spi)
        struct spi_eeprom *pdata;
        bool is_fram;
 
-       err = device_property_match_string(&spi->dev, "compatible", "cypress,fm25");
-       if (err >= 0)
-               is_fram = true;
-       else
-               is_fram = false;
-
        /*
         * Ping the chip ... the status register is pretty portable,
         * unlike probing manufacturer IDs. We do expect that system
@@ -462,6 +456,8 @@ static int at25_probe(struct spi_device *spi)
        at25->spi = spi;
        spi_set_drvdata(spi, at25);
 
+       is_fram = fwnode_device_is_compatible(dev_fwnode(&spi->dev), "cypress,fm25");
+
        /* Chip description */
        pdata = dev_get_platdata(&spi->dev);
        if (pdata) {