Commit 83f939f4 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Greg Kroah-Hartman

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240508184905.2102633-11-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b73602bf
...@@ -362,9 +362,8 @@ static int eeprom_93xx46_eral(struct eeprom_93xx46_dev *edev) ...@@ -362,9 +362,8 @@ static int eeprom_93xx46_eral(struct eeprom_93xx46_dev *edev)
return ret; return ret;
} }
static ssize_t eeprom_93xx46_store_erase(struct device *dev, static ssize_t erase_store(struct device *dev, struct device_attribute *attr,
struct device_attribute *attr, const char *buf, size_t count)
const char *buf, size_t count)
{ {
struct eeprom_93xx46_dev *edev = dev_get_drvdata(dev); struct eeprom_93xx46_dev *edev = dev_get_drvdata(dev);
bool erase; bool erase;
...@@ -387,7 +386,7 @@ static ssize_t eeprom_93xx46_store_erase(struct device *dev, ...@@ -387,7 +386,7 @@ static ssize_t eeprom_93xx46_store_erase(struct device *dev,
} }
return count; 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[] = { static const struct of_device_id eeprom_93xx46_of_table[] = {
{ .compatible = "eeprom-93xx46", .data = &at93c46_data, }, { .compatible = "eeprom-93xx46", .data = &at93c46_data, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment