From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org,
Richard Gong <richard.gong@linux.intel.com>,
Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org
Subject: Re: [PATCH v2 03/10] input: keyboard: gpio_keys: convert platform driver to use dev_groups
Date: Mon, 12 Aug 2019 06:59:15 +0000 [thread overview]
Message-ID: <20190812065915.GU178933@dtor-ws> (raw)
In-Reply-To: <20190731124349.4474-4-gregkh@linuxfoundation.org>
On Wed, Jul 31, 2019 at 02:43:42PM +0200, 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>
Applied, thank you.
> ---
> 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 03f4d152f6b7..1373dc5b0765 100644
> --- a/drivers/input/keyboard/gpio_keys.c
> +++ b/drivers/input/keyboard/gpio_keys.c
> @@ -351,10 +351,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)
> {
> @@ -851,13 +848,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",
> @@ -1026,6 +1016,7 @@ static struct platform_driver gpio_keys_device_driver = {
> .name = "gpio-keys",
> .pm = &gpio_keys_pm_ops,
> .of_match_table = gpio_keys_of_match,
> + .dev_groups = gpio_keys_groups,
> }
> };
>
> --
> 2.22.0
>
--
Dmitry
next prev parent reply other threads:[~2019-08-12 6:59 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 [this message]
2019-07-31 12:43 ` [PATCH v2 08/10] video: fbdev: wm8505fb: " Greg Kroah-Hartman
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=20190812065915.GU178933@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=b.zolnierkie@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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).