From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org,
Richard Gong <richard.gong@linux.intel.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-fbdev@vger.kernel.org,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
dri-devel@lists.freedesktop.org,
Tony Prisk <linux@prisktech.co.nz>,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 08/10] video: fbdev: wm8505fb: convert platform driver to use dev_groups
Date: Wed, 31 Jul 2019 12:43:47 +0000 [thread overview]
Message-ID: <20190731124349.4474-9-gregkh@linuxfoundation.org> (raw)
In-Reply-To: <20190731124349.4474-1-gregkh@linuxfoundation.org>
Platform drivers now have the option to have the platform core create
and remove any needed sysfs attribute files. So take advantage of that
and do not register "by hand" a sysfs file.
Cc: Tony Prisk <linux@prisktech.co.nz>
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-fbdev@vger.kernel.org
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/video/fbdev/wm8505fb.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/video/fbdev/wm8505fb.c b/drivers/video/fbdev/wm8505fb.c
index ff752635a31c..17c780315ca5 100644
--- a/drivers/video/fbdev/wm8505fb.c
+++ b/drivers/video/fbdev/wm8505fb.c
@@ -176,6 +176,12 @@ static ssize_t contrast_store(struct device *dev,
static DEVICE_ATTR_RW(contrast);
+static struct attribute *wm8505fb_attrs[] = {
+ &dev_attr_contrast.attr,
+ NULL,
+};
+ATTRIBUTE_GROUPS(wm8505fb);
+
static inline u_int chan_to_field(u_int chan, struct fb_bitfield *bf)
{
chan &= 0xffff;
@@ -361,10 +367,6 @@ static int wm8505fb_probe(struct platform_device *pdev)
return ret;
}
- ret = device_create_file(&pdev->dev, &dev_attr_contrast);
- if (ret < 0)
- fb_warn(&fbi->fb, "failed to register attributes (%d)\n", ret);
-
fb_info(&fbi->fb, "%s frame buffer at 0x%lx-0x%lx\n",
fbi->fb.fix.id, fbi->fb.fix.smem_start,
fbi->fb.fix.smem_start + fbi->fb.fix.smem_len - 1);
@@ -376,8 +378,6 @@ static int wm8505fb_remove(struct platform_device *pdev)
{
struct wm8505fb_info *fbi = platform_get_drvdata(pdev);
- device_remove_file(&pdev->dev, &dev_attr_contrast);
-
unregister_framebuffer(&fbi->fb);
writel(0, fbi->regbase);
@@ -399,6 +399,7 @@ static struct platform_driver wm8505fb_driver = {
.driver = {
.name = DRIVER_NAME,
.of_match_table = wmt_dt_ids,
+ .dev_groups = wm8505fb_groups,
},
};
--
2.22.0
next prev parent reply other threads:[~2019-07-31 12:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-31 12:43 [PATCH v2 00/10] drivers, provide a way to add sysfs groups easily Greg Kroah-Hartman
2019-07-31 12:43 ` [PATCH v2 03/10] input: keyboard: gpio_keys: convert platform driver to use dev_groups Greg Kroah-Hartman
2019-08-12 6:59 ` Dmitry Torokhov
2019-07-31 12:43 ` Greg Kroah-Hartman [this message]
2019-07-31 12:43 ` [PATCH v2 09/10] video: fbdev: w100fb: " Greg Kroah-Hartman
2019-07-31 12:43 ` [PATCH v2 10/10] video: fbdev: sm501fb: " Greg Kroah-Hartman
2019-07-31 13:10 ` [PATCH v2 00/10] drivers, provide a way to add sysfs groups easily Dmitry Torokhov
2019-07-31 13:22 ` Greg Kroah-Hartman
2019-07-31 13:38 ` Andy Shevchenko
2019-07-31 13:46 ` Dmitry Torokhov
2019-08-02 10:46 ` Greg Kroah-Hartman
2020-05-13 22:18 ` Emil Velikov
2020-05-14 7:16 ` Greg Kroah-Hartman
2020-05-14 11:48 ` Emil Velikov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190731124349.4474-9-gregkh@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=b.zolnierkie@samsung.com \
--cc=dmitry.torokhov@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@prisktech.co.nz \
--cc=richard.gong@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).