Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: cs42l56: use DEVICE_ATTR_WO macro

Use DEVICE_ATTR_WO() 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>
Message-Id: <20210524114503.26460-1-yuehaibing@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

YueHaibing and committed by
Mark Brown
3ef6253c d5bd87e3

+3 -4
+3 -4
sound/soc/codecs/cs42l56.c
··· 1021 1021 return 0; 1022 1022 } 1023 1023 1024 - static ssize_t cs42l56_beep_set(struct device *dev, 1025 - struct device_attribute *attr, 1026 - const char *buf, size_t count) 1024 + static ssize_t beep_store(struct device *dev, struct device_attribute *attr, 1025 + const char *buf, size_t count) 1027 1026 { 1028 1027 struct cs42l56_private *cs42l56 = dev_get_drvdata(dev); 1029 1028 long int time; ··· 1037 1038 return count; 1038 1039 } 1039 1040 1040 - static DEVICE_ATTR(beep, 0200, NULL, cs42l56_beep_set); 1041 + static DEVICE_ATTR_WO(beep); 1041 1042 1042 1043 static void cs42l56_init_beep(struct snd_soc_component *component) 1043 1044 {