From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 464EDC001DF for ; Sun, 30 Jul 2023 13:02:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230017AbjG3NCy (ORCPT ); Sun, 30 Jul 2023 09:02:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229597AbjG3NCx (ORCPT ); Sun, 30 Jul 2023 09:02:53 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46BE48E; Sun, 30 Jul 2023 06:02:53 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CF21960C34; Sun, 30 Jul 2023 13:02:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BDA1BC433C8; Sun, 30 Jul 2023 13:02:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690722172; bh=aSQY9HgsSaUQiAf8RxghVlYx43Ai3Jca+KXRTpfnolE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pGVvCfLv1qPeprL6gkTA+HdOY1f42ww7pwISpAM4apBYN42tKs9No9A4tQtfTMqyl CD9EadEVtrN5fSpdoqtKtQpkzkLRN7UnJGvl0H8E0DB9ZmHgnuMpfZ7U5M7dbyA2Wq 5XzZq0SmCA+8YhIsPXPhxUTGxcG6cV+9o6XQT77vMjBiHneasPtB+qHEdyvq35pKm6 tPLISx6/GAahXadAgU20hmI5tBDfWwJS0eULs/2YWw5Ix53QiXJqPG+zLuV0YU+9R7 tr4BQ5qapzdsjdBFcNn6htWnkzg1OOpdR/BCWTcwG150U5oh5rp4EkHEmloDcXa56r UHpVC4Ic/+6Xw== Date: Sun, 30 Jul 2023 15:02:49 +0200 From: Andi Shyti To: Dmitry Torokhov Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Greg Kroah-Hartman Subject: Re: [PATCH 19/22] Input: s6sy761 - use device core to create driver-specific device attributes Message-ID: <20230730130249.lb4cafvirda5uuh7@intel.intel> References: <20230729005133.1095051-1-dmitry.torokhov@gmail.com> <20230729005133.1095051-19-dmitry.torokhov@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230729005133.1095051-19-dmitry.torokhov@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Hi Dmitry, On Fri, Jul 28, 2023 at 05:51:28PM -0700, Dmitry Torokhov wrote: > Instead of creating driver-specific device attributes with > devm_device_add_group() have device core do this by setting up dev_groups > pointer in the driver structure. > > Signed-off-by: Dmitry Torokhov Reviewed-by: Andi Shyti Andi > --- > drivers/input/touchscreen/s6sy761.c | 10 ++-------- > 1 file changed, 2 insertions(+), 8 deletions(-) > > diff --git a/drivers/input/touchscreen/s6sy761.c b/drivers/input/touchscreen/s6sy761.c > index 998d99d18911..149cc2c4925e 100644 > --- a/drivers/input/touchscreen/s6sy761.c > +++ b/drivers/input/touchscreen/s6sy761.c > @@ -286,10 +286,7 @@ static struct attribute *s6sy761_sysfs_attrs[] = { > &dev_attr_devid.attr, > NULL > }; > - > -static struct attribute_group s6sy761_attribute_group = { > - .attrs = s6sy761_sysfs_attrs > -}; > +ATTRIBUTE_GROUPS(s6sy761_sysfs); > > static int s6sy761_power_on(struct s6sy761_data *sdata) > { > @@ -465,10 +462,6 @@ static int s6sy761_probe(struct i2c_client *client) > if (err) > return err; > > - err = devm_device_add_group(&client->dev, &s6sy761_attribute_group); > - if (err) > - return err; > - > pm_runtime_enable(&client->dev); > > return 0; > @@ -535,6 +528,7 @@ MODULE_DEVICE_TABLE(i2c, s6sy761_id); > static struct i2c_driver s6sy761_driver = { > .driver = { > .name = S6SY761_DEV_NAME, > + .dev_groups = s6sy761_sysfs_groups, > .of_match_table = of_match_ptr(s6sy761_of_match), > .pm = pm_ptr(&s6sy761_pm_ops), > }, > -- > 2.41.0.487.g6d72f3e995-goog >