diff mbox series

[-next] phy: phy-twl4030-usb: use DEVICE_ATTR_RO macro

Message ID 20210520135132.37628-1-yuehaibing@huawei.com
State Accepted
Commit f0afa235685e11fd30e291e4751419c12ba20b84
Headers show
Series [-next] phy: phy-twl4030-usb: use DEVICE_ATTR_RO macro | expand

Commit Message

Yue Haibing May 20, 2021, 1:51 p.m. UTC
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>
---
 drivers/phy/ti/phy-twl4030-usb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Vinod Koul May 31, 2021, 8:36 a.m. UTC | #1
On 20-05-21, 21:51, 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
diff mbox series

Patch

diff --git a/drivers/phy/ti/phy-twl4030-usb.c b/drivers/phy/ti/phy-twl4030-usb.c
index 812e5409d359..5771e2486a3b 100644
--- a/drivers/phy/ti/phy-twl4030-usb.c
+++ b/drivers/phy/ti/phy-twl4030-usb.c
@@ -544,8 +544,8 @@  static int twl4030_usb_ldo_init(struct twl4030_usb *twl)
 	return 0;
 }
 
-static ssize_t twl4030_usb_vbus_show(struct device *dev,
-		struct device_attribute *attr, char *buf)
+static ssize_t vbus_show(struct device *dev,
+			 struct device_attribute *attr, char *buf)
 {
 	struct twl4030_usb *twl = dev_get_drvdata(dev);
 	int ret = -EINVAL;
@@ -557,7 +557,7 @@  static ssize_t twl4030_usb_vbus_show(struct device *dev,
 
 	return ret;
 }
-static DEVICE_ATTR(vbus, 0444, twl4030_usb_vbus_show, NULL);
+static DEVICE_ATTR_RO(vbus);
 
 static irqreturn_t twl4030_usb_irq(int irq, void *_twl)
 {