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

video: fbdev: mb862xx: 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: Zhen Lei <thunder.leizhen@huawei.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20210601090852.10531-1-thunder.leizhen@huawei.com

authored by

Zhen Lei and committed by
Daniel Vetter
ff323d6d c5ef15ae

+3 -3
+3 -3
drivers/video/fbdev/mb862xx/mb862xxfbdrv.c
··· 542 542 /* 543 543 * show some display controller and cursor registers 544 544 */ 545 - static ssize_t mb862xxfb_show_dispregs(struct device *dev, 546 - struct device_attribute *attr, char *buf) 545 + static ssize_t dispregs_show(struct device *dev, 546 + struct device_attribute *attr, char *buf) 547 547 { 548 548 struct fb_info *fbi = dev_get_drvdata(dev); 549 549 struct mb862xxfb_par *par = fbi->par; ··· 577 577 return ptr - buf; 578 578 } 579 579 580 - static DEVICE_ATTR(dispregs, 0444, mb862xxfb_show_dispregs, NULL); 580 + static DEVICE_ATTR_RO(dispregs); 581 581 582 582 static irqreturn_t mb862xx_intr(int irq, void *dev_id) 583 583 {