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

ASoC: cs43130: Use DEVICE_ATTR_RO macro

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

authored by

YueHaibing and committed by
Mark Brown
6405941e d0426039

+12 -12
+12 -12
sound/soc/codecs/cs43130.c
··· 1672 1672 cs43130->hpload_dc[ch]); 1673 1673 } 1674 1674 1675 - static ssize_t cs43130_show_dc_l(struct device *dev, 1676 - struct device_attribute *attr, char *buf) 1675 + static ssize_t hpload_dc_l_show(struct device *dev, 1676 + struct device_attribute *attr, char *buf) 1677 1677 { 1678 1678 return cs43130_show_dc(dev, buf, HP_LEFT); 1679 1679 } 1680 1680 1681 - static ssize_t cs43130_show_dc_r(struct device *dev, 1682 - struct device_attribute *attr, char *buf) 1681 + static ssize_t hpload_dc_r_show(struct device *dev, 1682 + struct device_attribute *attr, char *buf) 1683 1683 { 1684 1684 return cs43130_show_dc(dev, buf, HP_RIGHT); 1685 1685 } ··· 1719 1719 } 1720 1720 } 1721 1721 1722 - static ssize_t cs43130_show_ac_l(struct device *dev, 1723 - struct device_attribute *attr, char *buf) 1722 + static ssize_t hpload_ac_l_show(struct device *dev, 1723 + struct device_attribute *attr, char *buf) 1724 1724 { 1725 1725 return cs43130_show_ac(dev, buf, HP_LEFT); 1726 1726 } 1727 1727 1728 - static ssize_t cs43130_show_ac_r(struct device *dev, 1729 - struct device_attribute *attr, char *buf) 1728 + static ssize_t hpload_ac_r_show(struct device *dev, 1729 + struct device_attribute *attr, char *buf) 1730 1730 { 1731 1731 return cs43130_show_ac(dev, buf, HP_RIGHT); 1732 1732 } 1733 1733 1734 - static DEVICE_ATTR(hpload_dc_l, 0444, cs43130_show_dc_l, NULL); 1735 - static DEVICE_ATTR(hpload_dc_r, 0444, cs43130_show_dc_r, NULL); 1736 - static DEVICE_ATTR(hpload_ac_l, 0444, cs43130_show_ac_l, NULL); 1737 - static DEVICE_ATTR(hpload_ac_r, 0444, cs43130_show_ac_r, NULL); 1734 + static DEVICE_ATTR_RO(hpload_dc_l); 1735 + static DEVICE_ATTR_RO(hpload_dc_r); 1736 + static DEVICE_ATTR_RO(hpload_ac_l); 1737 + static DEVICE_ATTR_RO(hpload_ac_r); 1738 1738 1739 1739 static struct reg_sequence hp_en_cal_seq[] = { 1740 1740 {CS43130_INT_MASK_4, CS43130_INT_MASK_ALL},