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

ASoC: wm8962: 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>
Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Message-Id: <20210524114753.39544-1-yuehaibing@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

YueHaibing and committed by
Mark Brown
d0426039 3ef6253c

+3 -4
+3 -4
sound/soc/codecs/wm8962.c
··· 3219 3219 return 0; 3220 3220 } 3221 3221 3222 - static ssize_t wm8962_beep_set(struct device *dev, 3223 - struct device_attribute *attr, 3224 - const char *buf, size_t count) 3222 + static ssize_t beep_store(struct device *dev, struct device_attribute *attr, 3223 + const char *buf, size_t count) 3225 3224 { 3226 3225 struct wm8962_priv *wm8962 = dev_get_drvdata(dev); 3227 3226 long int time; ··· 3235 3236 return count; 3236 3237 } 3237 3238 3238 - static DEVICE_ATTR(beep, 0200, NULL, wm8962_beep_set); 3239 + static DEVICE_ATTR_WO(beep); 3239 3240 3240 3241 static void wm8962_init_beep(struct snd_soc_component *component) 3241 3242 {