linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	linux-input@vger.kernel.org
Subject: Re: [PATCH v2 04/10] input: axp20x-pek: convert platform driver to use dev_groups
Date: Sun, 11 Aug 2019 23:59:26 -0700	[thread overview]
Message-ID: <20190812065926.GV178933@dtor-ws> (raw)
In-Reply-To: <20190731124349.4474-5-gregkh@linuxfoundation.org>

On Wed, Jul 31, 2019 at 02:43:43PM +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 sysfs group of attributes.
> 
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: Florian Fainelli <f.fainelli@gmail.com>
> Cc: linux-input@vger.kernel.org
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Applied, thank you.

> ---
>  drivers/input/misc/axp20x-pek.c | 15 +++------------
>  1 file changed, 3 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/input/misc/axp20x-pek.c b/drivers/input/misc/axp20x-pek.c
> index debeeaeb8812..235925b28772 100644
> --- a/drivers/input/misc/axp20x-pek.c
> +++ b/drivers/input/misc/axp20x-pek.c
> @@ -195,15 +195,12 @@ DEVICE_ATTR(startup, 0644, axp20x_show_attr_startup, axp20x_store_attr_startup);
>  DEVICE_ATTR(shutdown, 0644, axp20x_show_attr_shutdown,
>  	    axp20x_store_attr_shutdown);
>  
> -static struct attribute *axp20x_attributes[] = {
> +static struct attribute *axp20x_attrs[] = {
>  	&dev_attr_startup.attr,
>  	&dev_attr_shutdown.attr,
>  	NULL,
>  };
> -
> -static const struct attribute_group axp20x_attribute_group = {
> -	.attrs = axp20x_attributes,
> -};
> +ATTRIBUTE_GROUPS(axp20x);
>  
>  static irqreturn_t axp20x_pek_irq(int irq, void *pwr)
>  {
> @@ -356,13 +353,6 @@ static int axp20x_pek_probe(struct platform_device *pdev)
>  
>  	axp20x_pek->info = (struct axp20x_info *)match->driver_data;
>  
> -	error = devm_device_add_group(&pdev->dev, &axp20x_attribute_group);
> -	if (error) {
> -		dev_err(&pdev->dev, "Failed to create sysfs attributes: %d\n",
> -			error);
> -		return error;
> -	}
> -
>  	platform_set_drvdata(pdev, axp20x_pek);
>  
>  	return 0;
> @@ -411,6 +401,7 @@ static struct platform_driver axp20x_pek_driver = {
>  	.driver		= {
>  		.name		= "axp20x-pek",
>  		.pm		= &axp20x_pek_pm_ops,
> +		.dev_groups	= axp20x_groups,
>  	},
>  };
>  module_platform_driver(axp20x_pek_driver);
> -- 
> 2.22.0
> 

-- 
Dmitry

  reply	other threads:[~2019-08-12  6:59 UTC|newest]

Thread overview: 26+ 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 01/10] driver core: add dev_groups to all drivers Greg Kroah-Hartman
2019-07-31 12:49   ` Takashi Iwai
2019-07-31 12:51     ` Greg Kroah-Hartman
2019-07-31 13:08       ` Dmitry Torokhov
2019-07-31 13:21         ` Greg Kroah-Hartman
2019-07-31 15:51   ` Richard Gong
2019-07-31 12:43 ` [PATCH v2 02/10] uio: uio_fsl_elbc_gpcm: convert platform driver to use dev_groups Greg Kroah-Hartman
2019-07-31 12:43 ` [PATCH v2 03/10] input: keyboard: gpio_keys: " Greg Kroah-Hartman
2019-08-12  6:59   ` Dmitry Torokhov
2019-07-31 12:43 ` [PATCH v2 04/10] input: axp20x-pek: " Greg Kroah-Hartman
2019-08-12  6:59   ` Dmitry Torokhov [this message]
2019-07-31 12:43 ` [PATCH v2 05/10] firmware: arm_scpi: " Greg Kroah-Hartman
2019-07-31 12:43 ` [PATCH v2 06/10] olpc: x01: " Greg Kroah-Hartman
2019-07-31 12:43 ` [PATCH v2 07/10] platform: x86: hp-wmi: " Greg Kroah-Hartman
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=20190812065926.GV178933@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=f.fainelli@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-input@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).