Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933263AbdGTDWF (ORCPT ); Wed, 19 Jul 2017 23:22:05 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:60388 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932172AbdGTDWE (ORCPT ); Wed, 19 Jul 2017 23:22:04 -0400 Subject: Re: [PATCH v2 6/7] Input: synaptics_rmi4 - use devm_device_add_group() for attributes in F01 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-7-dmitry.torokhov@gmail.com> From: Guenter Roeck Message-ID: <88ce65cf-cf54-e202-e62c-7efac69db357@roeck-us.net> Date: Wed, 19 Jul 2017 20:22:02 -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-7-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: 1575 Lines: 47 On 07/19/2017 05:24 PM, Dmitry Torokhov wrote: > Now that we have proper managed API to create device attributes, let's > start using it instead of the manual unwinding. > > Signed-off-by: Dmitry Torokhov Reviewed-by: Guenter Roeck > --- > drivers/input/rmi4/rmi_f01.c | 11 +++-------- > 1 file changed, 3 insertions(+), 8 deletions(-) > > diff --git a/drivers/input/rmi4/rmi_f01.c b/drivers/input/rmi4/rmi_f01.c > index aa1aabfdbe7c..ae966e333a2f 100644 > --- a/drivers/input/rmi4/rmi_f01.c > +++ b/drivers/input/rmi4/rmi_f01.c > @@ -570,18 +570,14 @@ static int rmi_f01_probe(struct rmi_function *fn) > > dev_set_drvdata(&fn->dev, f01); > > - error = sysfs_create_group(&fn->rmi_dev->dev.kobj, &rmi_f01_attr_group); > + error = devm_device_add_group(&fn->rmi_dev->dev, &rmi_f01_attr_group); > if (error) > - dev_warn(&fn->dev, "Failed to create sysfs group: %d\n", error); > + dev_warn(&fn->dev, > + "Failed to create attribute group: %d\n", error); > > return 0; > } > > -static void rmi_f01_remove(struct rmi_function *fn) > -{ > - sysfs_remove_group(&fn->rmi_dev->dev.kobj, &rmi_f01_attr_group); > -} > - > static int rmi_f01_config(struct rmi_function *fn) > { > struct f01_data *f01 = dev_get_drvdata(&fn->dev); > @@ -721,7 +717,6 @@ struct rmi_function_handler rmi_f01_handler = { > }, > .func = 0x01, > .probe = rmi_f01_probe, > - .remove = rmi_f01_remove, > .config = rmi_f01_config, > .attention = rmi_f01_attention, > .suspend = rmi_f01_suspend, >