diff mbox series

[1/1] video: fbdev: mb862xx: use DEVICE_ATTR_RO macro

Message ID 20210601090852.10531-1-thunder.leizhen@huawei.com
State Accepted
Commit ff323d6d72e1e4971c8ba9e2f3cf8afc48f22383
Headers show
Series [1/1] video: fbdev: mb862xx: use DEVICE_ATTR_RO macro | expand

Commit Message

Zhen Lei June 1, 2021, 9:08 a.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: Zhen Lei <thunder.leizhen@huawei.com>

---
 drivers/video/fbdev/mb862xx/mb862xxfbdrv.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.26.0.106.g9fadedd

Comments

Daniel Vetter June 1, 2021, 4:12 p.m. UTC | #1
On Tue, Jun 01, 2021 at 05:08:52PM +0800, Zhen Lei wrote:
> Use DEVICE_ATTR_RO helper instead of plain DEVICE_ATTR, which makes the

> code a bit shorter and easier to read.

> 

> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>


Applied to drm-misc-next, thanks.
-Daniel

> ---

>  drivers/video/fbdev/mb862xx/mb862xxfbdrv.c | 6 +++---

>  1 file changed, 3 insertions(+), 3 deletions(-)

> 

> diff --git a/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c b/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c

> index 52755b591c1489f..63721337a37787b 100644

> --- a/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c

> +++ b/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c

> @@ -542,8 +542,8 @@ static int mb862xxfb_init_fbinfo(struct fb_info *fbi)

>  /*

>   * show some display controller and cursor registers

>   */

> -static ssize_t mb862xxfb_show_dispregs(struct device *dev,

> -				       struct device_attribute *attr, char *buf)

> +static ssize_t dispregs_show(struct device *dev,

> +			     struct device_attribute *attr, char *buf)

>  {

>  	struct fb_info *fbi = dev_get_drvdata(dev);

>  	struct mb862xxfb_par *par = fbi->par;

> @@ -577,7 +577,7 @@ static ssize_t mb862xxfb_show_dispregs(struct device *dev,

>  	return ptr - buf;

>  }

>  

> -static DEVICE_ATTR(dispregs, 0444, mb862xxfb_show_dispregs, NULL);

> +static DEVICE_ATTR_RO(dispregs);

>  

>  static irqreturn_t mb862xx_intr(int irq, void *dev_id)

>  {

> -- 

> 2.26.0.106.g9fadedd

> 

> 


-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
diff mbox series

Patch

diff --git a/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c b/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c
index 52755b591c1489f..63721337a37787b 100644
--- a/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c
+++ b/drivers/video/fbdev/mb862xx/mb862xxfbdrv.c
@@ -542,8 +542,8 @@  static int mb862xxfb_init_fbinfo(struct fb_info *fbi)
 /*
  * show some display controller and cursor registers
  */
-static ssize_t mb862xxfb_show_dispregs(struct device *dev,
-				       struct device_attribute *attr, char *buf)
+static ssize_t dispregs_show(struct device *dev,
+			     struct device_attribute *attr, char *buf)
 {
 	struct fb_info *fbi = dev_get_drvdata(dev);
 	struct mb862xxfb_par *par = fbi->par;
@@ -577,7 +577,7 @@  static ssize_t mb862xxfb_show_dispregs(struct device *dev,
 	return ptr - buf;
 }
 
-static DEVICE_ATTR(dispregs, 0444, mb862xxfb_show_dispregs, NULL);
+static DEVICE_ATTR_RO(dispregs);
 
 static irqreturn_t mb862xx_intr(int irq, void *dev_id)
 {