* [PATCH 1/1] media: bttv: use DEVICE_ATTR_RO() helper macro
@ 2021-06-03 7:10 Zhen Lei
0 siblings, 0 replies; only message in thread
From: Zhen Lei @ 2021-06-03 7:10 UTC (permalink / raw)
To: Mauro Carvalho Chehab, linux-media; +Cc: Zhen Lei
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.
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
drivers/media/pci/bt8xx/bttv-driver.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index 1f62a9d8ea1d323..e2e77b335c1523e 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 */
--
2.26.0.106.g9fadedd
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-06-03 7:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-03 7:10 [PATCH 1/1] media: bttv: use DEVICE_ATTR_RO() helper macro Zhen Lei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).