]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
misc: eeprom_93xx46: Convert to DEVICE_ATTR_WO()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 8 May 2024 18:47:03 +0000 (21:47 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 4 Jun 2024 15:47:08 +0000 (17:47 +0200)
Use DEVICE_ATTR_WO() helper instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240508184905.2102633-11-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/eeprom/eeprom_93xx46.c

index ad3b3bc054da5165aeaeea5165717fa321ab9abb..e2221be884458fbf98bf92c3e6d86836208b9bdb 100644 (file)
@@ -362,9 +362,8 @@ static int eeprom_93xx46_eral(struct eeprom_93xx46_dev *edev)
        return ret;
 }
 
-static ssize_t eeprom_93xx46_store_erase(struct device *dev,
-                                        struct device_attribute *attr,
-                                        const char *buf, size_t count)
+static ssize_t erase_store(struct device *dev, struct device_attribute *attr,
+                          const char *buf, size_t count)
 {
        struct eeprom_93xx46_dev *edev = dev_get_drvdata(dev);
        bool erase;
@@ -387,7 +386,7 @@ static ssize_t eeprom_93xx46_store_erase(struct device *dev,
        }
        return count;
 }
-static DEVICE_ATTR(erase, S_IWUSR, NULL, eeprom_93xx46_store_erase);
+static DEVICE_ATTR_WO(erase);
 
 static const struct of_device_id eeprom_93xx46_of_table[] = {
        { .compatible = "eeprom-93xx46", .data = &at93c46_data, },