Skip to content

Commit 9b4d7b5

Browse files
Zhen Leimchehab
authored andcommitted
media: bttv: use DEVICE_ATTR_RO() helper macro
Use DEVICE_ATTR_RO() helper macro instead of DEVICE_ATTR(), which is simpler and more readable. Due to the name of the read function of the sysfs attribute is normalized, there is a natural association. Link: https://lore.kernel.org/linux-media/20210603071009.11438-1-thunder.leizhen@huawei.com Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
1 parent e67219b commit 9b4d7b5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/media/pci/bt8xx/bttv-driver.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,14 @@ MODULE_VERSION(BTTV_VERSION);
170170
/* ----------------------------------------------------------------------- */
171171
/* sysfs */
172172

173-
static ssize_t show_card(struct device *cd,
173+
static ssize_t card_show(struct device *cd,
174174
struct device_attribute *attr, char *buf)
175175
{
176176
struct video_device *vfd = to_video_device(cd);
177177
struct bttv *btv = video_get_drvdata(vfd);
178178
return sprintf(buf, "%d\n", btv ? btv->c.type : UNSET);
179179
}
180-
static DEVICE_ATTR(card, S_IRUGO, show_card, NULL);
180+
static DEVICE_ATTR_RO(card);
181181

182182
/* ----------------------------------------------------------------------- */
183183
/* dvb auto-load setup */

0 commit comments

Comments
 (0)