From: Andy Shevchenko Date: Wed, 8 May 2024 18:47:03 +0000 (+0300) Subject: misc: eeprom_93xx46: Convert to DEVICE_ATTR_WO() X-Git-Tag: v6.11-rc1~100^2~72 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=83f939f4d4b91c245ff4e58422c014969f3772a6;p=thirdparty%2Fkernel%2Flinux.git misc: eeprom_93xx46: Convert to DEVICE_ATTR_WO() 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 Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20240508184905.2102633-11-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/misc/eeprom/eeprom_93xx46.c b/drivers/misc/eeprom/eeprom_93xx46.c index ad3b3bc054da5..e2221be884458 100644 --- a/drivers/misc/eeprom/eeprom_93xx46.c +++ b/drivers/misc/eeprom/eeprom_93xx46.c @@ -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, },