Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933222AbdGTDVm (ORCPT ); Wed, 19 Jul 2017 23:21:42 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:60025 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932703AbdGTDVl (ORCPT ); Wed, 19 Jul 2017 23:21:41 -0400 Subject: Re: [PATCH v2 7/7] Input: axp20x-pek - switch to using devm_device_add_group() To: Dmitry Torokhov , Greg Kroah-Hartman Cc: htejun@gmail.com, linux-kernel@vger.kernel.org References: <20170720002436.29309-1-dmitry.torokhov@gmail.com> <20170720002436.29309-8-dmitry.torokhov@gmail.com> From: Guenter Roeck Message-ID: <07e13129-001e-5145-e250-66890cfcea46@roeck-us.net> Date: Wed, 19 Jul 2017 20:21:39 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170720002436.29309-8-dmitry.torokhov@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated_sender: linux@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: linux@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: linux@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1734 Lines: 55 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 Reviewed-by: Guenter Roeck > --- > 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; >