* [PATCH -next] ASoC: cs43130: Use DEVICE_ATTR_RO macro
@ 2021-05-24 11:40 YueHaibing
2021-05-25 15:54 ` Charles Keepax
2021-05-26 20:21 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2021-05-24 11:40 UTC (permalink / raw)
To: james.schulman, david.rhodes, lgirdwood, broonie, perex, tiwai
Cc: alsa-devel, patches, linux-kernel, YueHaibing
Use DEVICE_ATTR_RO() helper instead of plain DEVICE_ATTR(),
which makes the code a bit shorter and easier to read.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
sound/soc/codecs/cs43130.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c
index de7fa3e4bfbb..44b20c1ef851 100644
--- a/sound/soc/codecs/cs43130.c
+++ b/sound/soc/codecs/cs43130.c
@@ -1672,14 +1672,14 @@ static int cs43130_show_dc(struct device *dev, char *buf, u8 ch)
cs43130->hpload_dc[ch]);
}
-static ssize_t cs43130_show_dc_l(struct device *dev,
- struct device_attribute *attr, char *buf)
+static ssize_t hpload_dc_l_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
return cs43130_show_dc(dev, buf, HP_LEFT);
}
-static ssize_t cs43130_show_dc_r(struct device *dev,
- struct device_attribute *attr, char *buf)
+static ssize_t hpload_dc_r_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
return cs43130_show_dc(dev, buf, HP_RIGHT);
}
@@ -1719,22 +1719,22 @@ static int cs43130_show_ac(struct device *dev, char *buf, u8 ch)
}
}
-static ssize_t cs43130_show_ac_l(struct device *dev,
- struct device_attribute *attr, char *buf)
+static ssize_t hpload_ac_l_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
return cs43130_show_ac(dev, buf, HP_LEFT);
}
-static ssize_t cs43130_show_ac_r(struct device *dev,
- struct device_attribute *attr, char *buf)
+static ssize_t hpload_ac_r_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
{
return cs43130_show_ac(dev, buf, HP_RIGHT);
}
-static DEVICE_ATTR(hpload_dc_l, 0444, cs43130_show_dc_l, NULL);
-static DEVICE_ATTR(hpload_dc_r, 0444, cs43130_show_dc_r, NULL);
-static DEVICE_ATTR(hpload_ac_l, 0444, cs43130_show_ac_l, NULL);
-static DEVICE_ATTR(hpload_ac_r, 0444, cs43130_show_ac_r, NULL);
+static DEVICE_ATTR_RO(hpload_dc_l);
+static DEVICE_ATTR_RO(hpload_dc_r);
+static DEVICE_ATTR_RO(hpload_ac_l);
+static DEVICE_ATTR_RO(hpload_ac_r);
static struct attribute *hpload_attrs[] = {
&dev_attr_hpload_dc_l.attr,
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH -next] ASoC: cs43130: Use DEVICE_ATTR_RO macro
2021-05-24 11:40 [PATCH -next] ASoC: cs43130: Use DEVICE_ATTR_RO macro YueHaibing
@ 2021-05-25 15:54 ` Charles Keepax
2021-05-26 20:21 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Charles Keepax @ 2021-05-25 15:54 UTC (permalink / raw)
To: YueHaibing
Cc: james.schulman, david.rhodes, lgirdwood, broonie, perex, tiwai,
alsa-devel, patches, linux-kernel
On Mon, May 24, 2021 at 07:40:17PM +0800, YueHaibing wrote:
> Use DEVICE_ATTR_RO() helper instead of plain DEVICE_ATTR(),
> which makes the code a bit shorter and easier to read.
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Thanks,
Charles
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] ASoC: cs43130: Use DEVICE_ATTR_RO macro
2021-05-24 11:40 [PATCH -next] ASoC: cs43130: Use DEVICE_ATTR_RO macro YueHaibing
2021-05-25 15:54 ` Charles Keepax
@ 2021-05-26 20:21 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2021-05-26 20:21 UTC (permalink / raw)
To: lgirdwood, james.schulman, perex, david.rhodes, YueHaibing, tiwai
Cc: Mark, Brown, broonie, alsa-devel, patches, linux-kernel
From: Mark Brown,,, <broonie@kernel.org>
On Mon, 24 May 2021 19:40:17 +0800, YueHaibing wrote:
> Use DEVICE_ATTR_RO() helper instead of plain DEVICE_ATTR(),
> which makes the code a bit shorter and easier to read.
Applied, thanks!
[1/1] ASoC: cs43130: Use DEVICE_ATTR_RO macro
commit: 6405941e6884dac80f836acfc7ec52089ea6aa99
Best regards,
--
Mark Brown,,, <broonie@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-26 20:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-24 11:40 [PATCH -next] ASoC: cs43130: Use DEVICE_ATTR_RO macro YueHaibing
2021-05-25 15:54 ` Charles Keepax
2021-05-26 20:21 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).