diff options
author | Zhen Lei <thunder.leizhen@huawei.com> | 2021-06-03 10:10:09 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-12-07 13:29:58 +0300 |
commit | 9b4d7b5c81a2578e080da33b5cddc3149fa611aa (patch) | |
tree | b554ff70beb19ab06abaaa1e6ec759d29dca89d1 /drivers/media/pci | |
parent | e67219b0496b795c9e4e9da53098a1ff302af313 (diff) | |
download | linux-9b4d7b5c81a2578e080da33b5cddc3149fa611aa.tar.xz |
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>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r-- | drivers/media/pci/bt8xx/bttv-driver.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c index 0e9df8b35ac6..8cc9bec43688 100644 --- a/drivers/media/pci/bt8xx/bttv-driver.c +++ b/drivers/media/pci/bt8xx/bttv-driver.c @@ -170,14 +170,14 @@ MODULE_VERSION(BTTV_VERSION); /* ----------------------------------------------------------------------- */ /* sysfs */ -static ssize_t show_card(struct device *cd, +static ssize_t card_show(struct device *cd, struct device_attribute *attr, char *buf) { struct video_device *vfd = to_video_device(cd); struct bttv *btv = video_get_drvdata(vfd); return sprintf(buf, "%d\n", btv ? btv->c.type : UNSET); } -static DEVICE_ATTR(card, S_IRUGO, show_card, NULL); +static DEVICE_ATTR_RO(card); /* ----------------------------------------------------------------------- */ /* dvb auto-load setup */ |