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

phy: phy-twl4030-usb: 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>
Link: https://lore.kernel.org/r/20210520135132.37628-1-yuehaibing@huawei.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

YueHaibing and committed by
Vinod Koul
f0afa235 46923bdb

+3 -3
+3 -3
drivers/phy/ti/phy-twl4030-usb.c
··· 544 544 return 0; 545 545 } 546 546 547 - static ssize_t twl4030_usb_vbus_show(struct device *dev, 548 - struct device_attribute *attr, char *buf) 547 + static ssize_t vbus_show(struct device *dev, 548 + struct device_attribute *attr, char *buf) 549 549 { 550 550 struct twl4030_usb *twl = dev_get_drvdata(dev); 551 551 int ret = -EINVAL; ··· 557 557 558 558 return ret; 559 559 } 560 - static DEVICE_ATTR(vbus, 0444, twl4030_usb_vbus_show, NULL); 560 + static DEVICE_ATTR_RO(vbus); 561 561 562 562 static irqreturn_t twl4030_usb_irq(int irq, void *_twl) 563 563 {