* [PATCH 08/11] video: fbdev: w100fb: convert platform driver to use dev_groups
2019-07-04 8:46 [PATCH 00/11] Platform drivers, provide a way to add sysfs groups easily Greg Kroah-Hartman
@ 2019-07-04 8:46 ` Greg Kroah-Hartman
2019-07-05 15:01 ` Bartlomiej Zolnierkiewicz
2019-07-04 8:46 ` [PATCH 09/11] video: fbdev: sm501fb: " Greg Kroah-Hartman
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2019-07-04 8:46 UTC (permalink / raw)
To: linux-kernel
Cc: linux-fbdev, Bartlomiej Zolnierkiewicz, Greg Kroah-Hartman,
dri-devel, Tony Prisk, linux-arm-kernel
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 bunch of sysfs files.
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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/video/fbdev/w100fb.c | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/drivers/video/fbdev/w100fb.c b/drivers/video/fbdev/w100fb.c
index 696106ecdff0..4be3afcc1c93 100644
--- a/drivers/video/fbdev/w100fb.c
+++ b/drivers/video/fbdev/w100fb.c
@@ -168,6 +168,15 @@ static ssize_t fastpllclk_store(struct device *dev, struct device_attribute *att
static DEVICE_ATTR_RW(fastpllclk);
+static struct attribute *w100fb_attrs[] = {
+ &dev_attr_fastpllclk.attr,
+ &dev_attr_reg_read.attr,
+ &dev_attr_reg_write.attr,
+ &dev_attr_flip.attr,
+ NULL,
+};
+ATTRIBUTE_GROUPS(w100fb);
+
/*
* Some touchscreens need hsync information from the video driver to
* function correctly. We export it here.
@@ -756,14 +765,6 @@ int w100fb_probe(struct platform_device *pdev)
goto out;
}
- err = device_create_file(&pdev->dev, &dev_attr_fastpllclk);
- err |= device_create_file(&pdev->dev, &dev_attr_reg_read);
- err |= device_create_file(&pdev->dev, &dev_attr_reg_write);
- err |= device_create_file(&pdev->dev, &dev_attr_flip);
-
- if (err != 0)
- fb_warn(info, "failed to register attributes (%d)\n", err);
-
fb_info(info, "%s frame buffer device\n", info->fix.id);
return 0;
out:
@@ -788,11 +789,6 @@ static int w100fb_remove(struct platform_device *pdev)
struct fb_info *info = platform_get_drvdata(pdev);
struct w100fb_par *par=info->par;
- device_remove_file(&pdev->dev, &dev_attr_fastpllclk);
- device_remove_file(&pdev->dev, &dev_attr_reg_read);
- device_remove_file(&pdev->dev, &dev_attr_reg_write);
- device_remove_file(&pdev->dev, &dev_attr_flip);
-
unregister_framebuffer(info);
vfree(par->saved_intmem);
@@ -1630,6 +1626,7 @@ static struct platform_driver w100fb_driver = {
.driver = {
.name = "w100fb",
},
+ .dev_groups = w100fb_groups,
};
module_platform_driver(w100fb_driver);
--
2.22.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 08/11] video: fbdev: w100fb: convert platform driver to use dev_groups
2019-07-04 8:46 ` [PATCH 08/11] video: fbdev: w100fb: convert platform driver to use dev_groups Greg Kroah-Hartman
@ 2019-07-05 15:01 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 8+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2019-07-05 15:01 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Tony Prisk, dri-devel, linux-kernel, linux-arm-kernel,
linux-fbdev
On 7/4/19 10:46 AM, Greg Kroah-Hartman wrote:
> 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 bunch of sysfs files.
>
> 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
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 09/11] video: fbdev: sm501fb: convert platform driver to use dev_groups
2019-07-04 8:46 [PATCH 00/11] Platform drivers, provide a way to add sysfs groups easily Greg Kroah-Hartman
2019-07-04 8:46 ` [PATCH 08/11] video: fbdev: w100fb: convert platform driver to use dev_groups Greg Kroah-Hartman
@ 2019-07-04 8:46 ` Greg Kroah-Hartman
2019-07-05 15:01 ` Bartlomiej Zolnierkiewicz
2019-07-04 8:46 ` [PATCH 10/11] input: keyboard: gpio_keys: " Greg Kroah-Hartman
2019-07-04 14:26 ` [PATCH 07/11] video: fbdev: wm8505fb: " Greg Kroah-Hartman
3 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2019-07-04 8:46 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, linux-fbdev, dri-devel,
Bartlomiej Zolnierkiewicz
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 bunch of sysfs files.
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-fbdev@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/video/fbdev/sm501fb.c | 37 +++++++++--------------------------
1 file changed, 9 insertions(+), 28 deletions(-)
diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c
index dde52d027416..c633ee76a73d 100644
--- a/drivers/video/fbdev/sm501fb.c
+++ b/drivers/video/fbdev/sm501fb.c
@@ -1274,6 +1274,14 @@ static ssize_t sm501fb_debug_show_pnl(struct device *dev,
static DEVICE_ATTR(fbregs_pnl, 0444, sm501fb_debug_show_pnl, NULL);
+static struct attribute *sm501fb_attrs[] = {
+ &dev_attr_crt_src.attr,
+ &dev_attr_fbregs_pnl.attr,
+ &dev_attr_fbregs_crt.attr,
+ NULL,
+};
+ATTRIBUTE_GROUPS(sm501fb);
+
/* acceleration operations */
static int sm501fb_sync(struct fb_info *info)
{
@@ -2016,33 +2024,9 @@ static int sm501fb_probe(struct platform_device *pdev)
goto err_started_crt;
}
- /* create device files */
-
- ret = device_create_file(dev, &dev_attr_crt_src);
- if (ret)
- goto err_started_panel;
-
- ret = device_create_file(dev, &dev_attr_fbregs_pnl);
- if (ret)
- goto err_attached_crtsrc_file;
-
- ret = device_create_file(dev, &dev_attr_fbregs_crt);
- if (ret)
- goto err_attached_pnlregs_file;
-
/* we registered, return ok */
return 0;
-err_attached_pnlregs_file:
- device_remove_file(dev, &dev_attr_fbregs_pnl);
-
-err_attached_crtsrc_file:
- device_remove_file(dev, &dev_attr_crt_src);
-
-err_started_panel:
- unregister_framebuffer(info->fb[HEAD_PANEL]);
- sm501_free_init_fb(info, HEAD_PANEL);
-
err_started_crt:
unregister_framebuffer(info->fb[HEAD_CRT]);
sm501_free_init_fb(info, HEAD_CRT);
@@ -2072,10 +2056,6 @@ static int sm501fb_remove(struct platform_device *pdev)
struct fb_info *fbinfo_crt = info->fb[0];
struct fb_info *fbinfo_pnl = info->fb[1];
- device_remove_file(&pdev->dev, &dev_attr_fbregs_crt);
- device_remove_file(&pdev->dev, &dev_attr_fbregs_pnl);
- device_remove_file(&pdev->dev, &dev_attr_crt_src);
-
sm501_free_init_fb(info, HEAD_CRT);
sm501_free_init_fb(info, HEAD_PANEL);
@@ -2233,6 +2213,7 @@ static int sm501fb_resume(struct platform_device *pdev)
#endif
static struct platform_driver sm501fb_driver = {
+ .dev_groups = sm501fb_groups,
.probe = sm501fb_probe,
.remove = sm501fb_remove,
.suspend = sm501fb_suspend,
--
2.22.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 09/11] video: fbdev: sm501fb: convert platform driver to use dev_groups
2019-07-04 8:46 ` [PATCH 09/11] video: fbdev: sm501fb: " Greg Kroah-Hartman
@ 2019-07-05 15:01 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 8+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2019-07-05 15:01 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: linux-kernel, dri-devel, linux-fbdev
On 7/4/19 10:46 AM, Greg Kroah-Hartman wrote:
> 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 bunch of sysfs files.
>
> Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-fbdev@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 10/11] input: keyboard: gpio_keys: convert platform driver to use dev_groups
2019-07-04 8:46 [PATCH 00/11] Platform drivers, provide a way to add sysfs groups easily Greg Kroah-Hartman
2019-07-04 8:46 ` [PATCH 08/11] video: fbdev: w100fb: convert platform driver to use dev_groups Greg Kroah-Hartman
2019-07-04 8:46 ` [PATCH 09/11] video: fbdev: sm501fb: " Greg Kroah-Hartman
@ 2019-07-04 8:46 ` Greg Kroah-Hartman
2019-07-04 14:26 ` [PATCH 07/11] video: fbdev: wm8505fb: " Greg Kroah-Hartman
3 siblings, 0 replies; 8+ messages in thread
From: Greg Kroah-Hartman @ 2019-07-04 8:46 UTC (permalink / raw)
To: linux-kernel
Cc: Greg Kroah-Hartman, Bartlomiej Zolnierkiewicz, dri-devel,
linux-fbdev
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 bunch of sysfs files.
Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-fbdev@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/input/keyboard/gpio_keys.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 6cd199e8a370..1f6547440edb 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -354,10 +354,7 @@ static struct attribute *gpio_keys_attrs[] = {
&dev_attr_disabled_switches.attr,
NULL,
};
-
-static const struct attribute_group gpio_keys_attr_group = {
- .attrs = gpio_keys_attrs,
-};
+ATTRIBUTE_GROUPS(gpio_keys);
static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata)
{
@@ -856,13 +853,6 @@ static int gpio_keys_probe(struct platform_device *pdev)
fwnode_handle_put(child);
- error = devm_device_add_group(dev, &gpio_keys_attr_group);
- if (error) {
- dev_err(dev, "Unable to export keys/switches, error: %d\n",
- error);
- return error;
- }
-
error = input_register_device(input);
if (error) {
dev_err(dev, "Unable to register input device, error: %d\n",
@@ -1025,6 +1015,7 @@ static void gpio_keys_shutdown(struct platform_device *pdev)
}
static struct platform_driver gpio_keys_device_driver = {
+ .dev_groups = gpio_keys_groups,
.probe = gpio_keys_probe,
.shutdown = gpio_keys_shutdown,
.driver = {
--
2.22.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 07/11] video: fbdev: wm8505fb: convert platform driver to use dev_groups
2019-07-04 8:46 [PATCH 00/11] Platform drivers, provide a way to add sysfs groups easily Greg Kroah-Hartman
` (2 preceding siblings ...)
2019-07-04 8:46 ` [PATCH 10/11] input: keyboard: gpio_keys: " Greg Kroah-Hartman
@ 2019-07-04 14:26 ` Greg Kroah-Hartman
2019-07-05 15:00 ` Bartlomiej Zolnierkiewicz
3 siblings, 1 reply; 8+ messages in thread
From: Greg Kroah-Hartman @ 2019-07-04 14:26 UTC (permalink / raw)
To: linux-kernel, Tony Prisk, Bartlomiej Zolnierkiewicz
Cc: linux-arm-kernel, dri-devel, linux-fbdev, Greg Kroah-Hartman,
Darren Hart, Andy Shevchenko, platform-driver-x86
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
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 8f0d5379861d..3b826da97035 100644
--- a/drivers/video/fbdev/wm8505fb.c
+++ b/drivers/video/fbdev/wm8505fb.c
@@ -184,6 +184,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;
@@ -369,10 +375,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);
@@ -384,8 +386,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);
@@ -402,6 +402,7 @@ static const struct of_device_id wmt_dt_ids[] = {
};
static struct platform_driver wm8505fb_driver = {
+ .dev_groups = wm8505fb_groups,
.probe = wm8505fb_probe,
.remove = wm8505fb_remove,
.driver = {
--
2.22.0
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 07/11] video: fbdev: wm8505fb: convert platform driver to use dev_groups
2019-07-04 14:26 ` [PATCH 07/11] video: fbdev: wm8505fb: " Greg Kroah-Hartman
@ 2019-07-05 15:00 ` Bartlomiej Zolnierkiewicz
0 siblings, 0 replies; 8+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2019-07-05 15:00 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: linux-kernel, Tony Prisk, linux-arm-kernel, dri-devel,
linux-fbdev, Darren Hart, Andy Shevchenko, platform-driver-x86
On 7/4/19 4:26 PM, Greg Kroah-Hartman wrote:
> 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
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
^ permalink raw reply [flat|nested] 8+ messages in thread