From: Guenter Roeck <linux@roeck-us.net>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: htejun@gmail.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 7/7] Input: axp20x-pek - switch to using devm_device_add_group()
Date: Wed, 19 Jul 2017 20:21:39 -0700 [thread overview]
Message-ID: <07e13129-001e-5145-e250-66890cfcea46@roeck-us.net> (raw)
In-Reply-To: <20170720002436.29309-8-dmitry.torokhov@gmail.com>
On 07/19/2017 05:24 PM, Dmitry Torokhov wrote:
> Now that we have proper managed API to create device attributes, let's
> use it instead of installing a custom devm action.
>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> ---
> drivers/input/misc/axp20x-pek.c | 18 +-----------------
> 1 file changed, 1 insertion(+), 17 deletions(-)
>
> diff --git a/drivers/input/misc/axp20x-pek.c b/drivers/input/misc/axp20x-pek.c
> index 38c79ebff033..cfeb0e943de6 100644
> --- a/drivers/input/misc/axp20x-pek.c
> +++ b/drivers/input/misc/axp20x-pek.c
> @@ -182,13 +182,6 @@ static irqreturn_t axp20x_pek_irq(int irq, void *pwr)
> return IRQ_HANDLED;
> }
>
> -static void axp20x_remove_sysfs_group(void *_data)
> -{
> - struct device *dev = _data;
> -
> - sysfs_remove_group(&dev->kobj, &axp20x_attribute_group);
> -}
> -
> static int axp20x_pek_probe_input_device(struct axp20x_pek *axp20x_pek,
> struct platform_device *pdev)
> {
> @@ -313,22 +306,13 @@ static int axp20x_pek_probe(struct platform_device *pdev)
> return error;
> }
>
> - error = sysfs_create_group(&pdev->dev.kobj, &axp20x_attribute_group);
> + 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;
> }
>
> - error = devm_add_action(&pdev->dev,
> - axp20x_remove_sysfs_group, &pdev->dev);
> - if (error) {
> - axp20x_remove_sysfs_group(&pdev->dev);
> - dev_err(&pdev->dev, "Failed to add sysfs cleanup action: %d\n",
> - error);
> - return error;
> - }
> -
> platform_set_drvdata(pdev, axp20x_pek);
>
> return 0;
>
prev parent reply other threads:[~2017-07-20 3:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-20 0:24 [PATCH v2 0/7] New bind/unbingd uevents Dmitry Torokhov
2017-07-20 0:24 ` [PATCH v2 1/7] driver core: emit uevents when device is bound to a driver Dmitry Torokhov
2017-09-29 19:36 ` Dan Williams
2017-09-29 19:40 ` Ruhl, Michael J
2017-09-29 23:23 ` Dmitry Torokhov
2017-09-30 8:13 ` Greg Kroah-Hartman
2017-07-20 0:24 ` [PATCH v2 2/7] driver core: make device_{add|remove}_groups() public Dmitry Torokhov
2017-07-20 0:24 ` [PATCH v2 3/7] driver core: add device_{add|remove}_group() helpers Dmitry Torokhov
2017-07-20 0:24 ` [PATCH v2 4/7] driver core: add devm_device_add_group() and friends Dmitry Torokhov
2017-07-20 5:10 ` Greg Kroah-Hartman
2017-07-20 8:12 ` Dmitry Torokhov
2017-07-20 8:20 ` Greg Kroah-Hartman
2017-07-20 15:50 ` Dmitry Torokhov
2017-07-22 10:03 ` Greg Kroah-Hartman
2017-07-20 0:24 ` [PATCH v2 5/7] Input: gpio_keys - use devm_device_add_group() for attributes Dmitry Torokhov
2017-07-20 3:22 ` Guenter Roeck
2017-07-20 0:24 ` [PATCH v2 6/7] Input: synaptics_rmi4 - use devm_device_add_group() for attributes in F01 Dmitry Torokhov
2017-07-20 3:22 ` Guenter Roeck
2017-07-20 0:24 ` [PATCH v2 7/7] Input: axp20x-pek - switch to using devm_device_add_group() Dmitry Torokhov
2017-07-20 3:21 ` Guenter Roeck [this message]
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=07e13129-001e-5145-e250-66890cfcea46@roeck-us.net \
--to=linux@roeck-us.net \
--cc=dmitry.torokhov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=htejun@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/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
all inboxes | Powered by JetHome®