Commit 2eadc04d authored by YueHaibing's avatar YueHaibing Committed by Mark Brown

ASoC: tlv320aic26: use DEVICE_ATTR_RW macro

Use DEVICE_ATTR_RW() helper instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Message-Id: <20210524115131.46288-1-yuehaibing@huawei.com>
Signed-off-by: default avatarMark Brown <broonie@sirena.org.uk>
parent 0e91438f
...@@ -261,7 +261,7 @@ static const struct snd_kcontrol_new aic26_snd_controls[] = { ...@@ -261,7 +261,7 @@ static const struct snd_kcontrol_new aic26_snd_controls[] = {
* SPI device portion of driver: sysfs files for debugging * SPI device portion of driver: sysfs files for debugging
*/ */
static ssize_t aic26_keyclick_show(struct device *dev, static ssize_t keyclick_show(struct device *dev,
struct device_attribute *attr, char *buf) struct device_attribute *attr, char *buf)
{ {
struct aic26 *aic26 = dev_get_drvdata(dev); struct aic26 *aic26 = dev_get_drvdata(dev);
...@@ -276,7 +276,7 @@ static ssize_t aic26_keyclick_show(struct device *dev, ...@@ -276,7 +276,7 @@ static ssize_t aic26_keyclick_show(struct device *dev,
} }
/* Any write to the keyclick attribute will trigger the keyclick event */ /* Any write to the keyclick attribute will trigger the keyclick event */
static ssize_t aic26_keyclick_set(struct device *dev, static ssize_t keyclick_store(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, size_t count) const char *buf, size_t count)
{ {
...@@ -288,7 +288,7 @@ static ssize_t aic26_keyclick_set(struct device *dev, ...@@ -288,7 +288,7 @@ static ssize_t aic26_keyclick_set(struct device *dev,
return count; return count;
} }
static DEVICE_ATTR(keyclick, 0644, aic26_keyclick_show, aic26_keyclick_set); static DEVICE_ATTR_RW(keyclick);
/* --------------------------------------------------------------------- /* ---------------------------------------------------------------------
* SoC CODEC portion of driver: probe and release routines * SoC CODEC portion of driver: probe and release routines
......
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