From patchwork Wed Aug 24 13:59:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 600338 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EEEA7C38142 for ; Wed, 24 Aug 2022 14:01:26 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 42C3015C2; Wed, 24 Aug 2022 16:00:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 42C3015C2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661349685; bh=KWnwJ1zMa3C2CDw6Y/OMLmmwDWaJ+biZe3MkwUbZHYs=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=PcdwNZJ+kRvAhfM1IX29qoi1Z3c4bbEGxHLKHSuQ4J8JSVEnrqwjBJ6GHytE+4Ptu hVeatg8952Tl/N3GexxKb40ZNZSn2l1Bm+Q0djFwYMbwWnhEC3tK5iqsDxhtJtyuMu M5YhzQnoa5NS/mHSyAbWz32DnQKSVyODbM+HJFvo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 86AF0F80508; Wed, 24 Aug 2022 16:00:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3CF32F8014E; Wed, 24 Aug 2022 16:00:07 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 153E1F8014E for ; Wed, 24 Aug 2022 16:00:01 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 153E1F8014E Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="xYytor4R" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 78BE9617CA; Wed, 24 Aug 2022 13:59:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 65A3EC433D7; Wed, 24 Aug 2022 13:59:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661349598; bh=KWnwJ1zMa3C2CDw6Y/OMLmmwDWaJ+biZe3MkwUbZHYs=; h=From:To:Cc:Subject:Date:From; b=xYytor4RJ8GRoHDLUA3TaZ9L/xtJ0TSzUzd8eYZwFZUYTlZJoyJzIX6VPNQ4kWlvB /mEkcpnn+u4OEMEyOfh3v66v2TtHwlgpU7ErpY+5PPGzX5QJL9s2ECgzO8NG4T4p10 ECDFw+dnybc0XE1nrvBqsyelkp3AwXbRJSEyI2sQ= From: Greg Kroah-Hartman To: alsa-devel@alsa-project.org Subject: [PATCH v2 1/6] sysfs: do not create empty directories if no attributes are present Date: Wed, 24 Aug 2022 15:59:46 +0200 Message-Id: <20220824135951.3604059-1-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2703; i=gregkh@linuxfoundation.org; h=from:subject; bh=KWnwJ1zMa3C2CDw6Y/OMLmmwDWaJ+biZe3MkwUbZHYs=; b=owGbwMvMwCRo6H6F97bub03G02pJDMlseleWz0p77dt8m1tRzqymifO7SvSa+rS3M/3+ef91PVd/ 565YRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAExkvwDDPPUPRss8Dk0ItLX7e80gh0 32681eC4YFM9ZNVL4f/e7no65TiZp5vyfVvXaWAwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Cc: Greg Kroah-Hartman , Pierre-Louis Bossart , linux-kernel@vger.kernel.org, Vinod Koul , Sanyog Kale , Bard Liao X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" When creating an attribute group, if it is named a subdirectory is created and the sysfs files are placed into that subdirectory. If no files are created, normally the directory would still be present, but it would be empty. Clean this up by removing the directory if no files were successfully created in the group at all. Cc: Vinod Koul Cc: Bard Liao Cc: Pierre-Louis Bossart Cc: Sanyog Kale Cc: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- v2: new patch Note, totally untested! The following soundwire patches will need this, if a soundwire developer could test this out, it would be most apreciated. fs/sysfs/group.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/fs/sysfs/group.c b/fs/sysfs/group.c index eeb0e3099421..9fe0b47db47f 100644 --- a/fs/sysfs/group.c +++ b/fs/sysfs/group.c @@ -31,12 +31,14 @@ static void remove_files(struct kernfs_node *parent, kernfs_remove_by_name(parent, (*bin_attr)->attr.name); } +/* returns -ERROR if error, or >= 0 for number of files actually created */ static int create_files(struct kernfs_node *parent, struct kobject *kobj, kuid_t uid, kgid_t gid, const struct attribute_group *grp, int update) { struct attribute *const *attr; struct bin_attribute *const *bin_attr; + int files_created = 0; int error = 0, i; if (grp->attrs) { @@ -65,6 +67,8 @@ static int create_files(struct kernfs_node *parent, struct kobject *kobj, gid, NULL); if (unlikely(error)) break; + + files_created++; } if (error) { remove_files(parent, grp); @@ -95,12 +99,15 @@ static int create_files(struct kernfs_node *parent, struct kobject *kobj, NULL); if (error) break; + files_created++; } if (error) remove_files(parent, grp); } exit: - return error; + if (error) + return error; + return files_created; } @@ -146,10 +153,16 @@ static int internal_create_group(struct kobject *kobj, int update, kn = kobj->sd; kernfs_get(kn); error = create_files(kn, kobj, uid, gid, grp, update); - if (error) { + if (error <= 0) { + /* + * If an error happened _OR_ if no files were created in the + * attribute group, and we have a name for this group, delete + * the name so there's not an empty directory. + */ if (grp->name) kernfs_remove(kn); - } + } else + error = 0; kernfs_put(kn); if (grp->name && update) From patchwork Wed Aug 24 13:59:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 599748 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C9BAFC32796 for ; Wed, 24 Aug 2022 14:00:58 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 692451F7; Wed, 24 Aug 2022 16:00:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 692451F7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661349656; bh=24DO39uVA59fhWMiW4WyrPflQTYFQ4KqBhlx29/uJp4=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=bQLdsKDoJMk4gmilOqVYxUTNp/sVF738FzBSB7KQXX4eXO1F+MpY2QEI0uWhc2PRD Rdu6IQOWnU7f9oDGe0oVTg2wgvKHp4zOdsolAclC0rs4Dru5FeF18rVR+pcHOGLglG HIWQgfzkordRNm3myk6P6n6BnEKQ/nWSzB3bJs5Y= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E946AF800A7; Wed, 24 Aug 2022 16:00:05 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1605FF800A7; Wed, 24 Aug 2022 16:00:04 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 378D3F800A7 for ; Wed, 24 Aug 2022 15:59:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 378D3F800A7 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="2T2JmI0z" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 61BE8617C9; Wed, 24 Aug 2022 13:59:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3F440C433D6; Wed, 24 Aug 2022 13:59:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661349595; bh=24DO39uVA59fhWMiW4WyrPflQTYFQ4KqBhlx29/uJp4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2T2JmI0z0fv+ODoHwI1oQFEI2OwvNRKK8g84LuADy3UKW8QWNDP7WNQUVIOPFBpJh FtFoGrrFpKt+Dv6L/+AJwpbeW7hqgigdS7mBNVMZAxDtEJC7tcr3lqiyFIxUlTU9ri 9z5YgUP8y1NmXSHYebJVExKR5RQqXBwrRnV86zd8= From: Greg Kroah-Hartman To: alsa-devel@alsa-project.org Subject: [PATCH v2 2/6] soundwire: sysfs: move sdw_slave_dev_attr_group into the existing list of groups Date: Wed, 24 Aug 2022 15:59:47 +0200 Message-Id: <20220824135951.3604059-2-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220824135951.3604059-1-gregkh@linuxfoundation.org> References: <20220824135951.3604059-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2014; i=gregkh@linuxfoundation.org; h=from:subject; bh=24DO39uVA59fhWMiW4WyrPflQTYFQ4KqBhlx29/uJp4=; b=owGbwMvMwCRo6H6F97bub03G02pJDMlsetfCHyy783/1utsBHi5e17/fSjMsZ/ngMPWIZsvcc+zd D0IcOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAi2/YyLJi+b9UNS7471xatk7y6IN pSb7/Q0v8M84wO3aj+8Ha6SY2no5uHQ23KBtXnuQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Cc: Greg Kroah-Hartman , Pierre-Louis Bossart , linux-kernel@vger.kernel.org, Vinod Koul , Sanyog Kale , Bard Liao X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The sysfs logic already creates a list of groups for the device, so add the sdw_slave_dev_attr_group group to that list instead of having to do a two-step process of adding a group list and then an individual group. This is a step on the way to moving all of the sysfs attribute handling into the default driver core attribute group logic so that the soundwire core does not have to do any of it manually. Cc: Vinod Koul Cc: Bard Liao Cc: Pierre-Louis Bossart Cc: Sanyog Kale Cc: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- v2: rebased on 6.0-rc1 drivers/soundwire/sysfs_slave.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/soundwire/sysfs_slave.c b/drivers/soundwire/sysfs_slave.c index 3210359cd944..83e3f6cc3250 100644 --- a/drivers/soundwire/sysfs_slave.c +++ b/drivers/soundwire/sysfs_slave.c @@ -105,7 +105,10 @@ static struct attribute *slave_attrs[] = { &dev_attr_modalias.attr, NULL, }; -ATTRIBUTE_GROUPS(slave); + +static const struct attribute_group slave_attr_group = { + .attrs = slave_attrs, +}; static struct attribute *slave_dev_attrs[] = { &dev_attr_mipi_revision.attr, @@ -190,6 +193,12 @@ static const struct attribute_group dp0_group = { .name = "dp0", }; +static const struct attribute_group *slave_groups[] = { + &slave_attr_group, + &sdw_slave_dev_attr_group, + NULL, +}; + int sdw_slave_sysfs_init(struct sdw_slave *slave) { int ret; @@ -198,10 +207,6 @@ int sdw_slave_sysfs_init(struct sdw_slave *slave) if (ret < 0) return ret; - ret = devm_device_add_group(&slave->dev, &sdw_slave_dev_attr_group); - if (ret < 0) - return ret; - if (slave->prop.dp0_prop) { ret = devm_device_add_group(&slave->dev, &dp0_group); if (ret < 0) From patchwork Wed Aug 24 13:59:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 599747 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 30C7BC32796 for ; Wed, 24 Aug 2022 14:01:50 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 55DC21622; Wed, 24 Aug 2022 16:00:58 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 55DC21622 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661349708; bh=dUTwXXFu5PCz/IzkEcwjndg31DOpffH9A3ry/4de9h8=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=l7wUbYCvyCOLtyyTFU1nK9OPmhSWp2bWX4KktXpPRDdzE2mE3YurPTdTTvwpLuH2t cajZzq/WqPfTnIl40t3oIETzUAe5NbYI9OuPLJA9fVPAqu2H3qbuYhV4gMPd/pGJf7 nuikjaUg6ghcF4y9NJJ7kUaX8jAdKS6EwLWCusTY= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id CA558F804BD; Wed, 24 Aug 2022 16:00:12 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7D46EF80533; Wed, 24 Aug 2022 16:00:11 +0200 (CEST) Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A5F0AF804BD for ; Wed, 24 Aug 2022 16:00:05 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A5F0AF804BD Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="wW9jIJcI" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A9CD0B823B5; Wed, 24 Aug 2022 14:00:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 01517C433C1; Wed, 24 Aug 2022 14:00:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661349603; bh=dUTwXXFu5PCz/IzkEcwjndg31DOpffH9A3ry/4de9h8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wW9jIJcIUdQlKMtLr5BuYINEhp9PaZ1EQFI3HuwI5xviVxoM9YPCjYmlb8AxWeQar VEFCI1SrVjZPW/1jCuhMc5dvmVoYT7sulJIqZ+cdWvEmeOeRFNc+dO7wzeFZhXIFcl ejij0boP1PLor8nBHb2/4WlfvOEN1qKNiCbzPY50= From: Greg Kroah-Hartman To: alsa-devel@alsa-project.org Subject: [PATCH v2 3/6] soundwire: sysfs: cleanup the logic for creating the dp0 sysfs attributes Date: Wed, 24 Aug 2022 15:59:48 +0200 Message-Id: <20220824135951.3604059-3-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220824135951.3604059-1-gregkh@linuxfoundation.org> References: <20220824135951.3604059-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2244; i=gregkh@linuxfoundation.org; h=from:subject; bh=dUTwXXFu5PCz/IzkEcwjndg31DOpffH9A3ry/4de9h8=; b=owGbwMvMwCRo6H6F97bub03G02pJDMlseteef/mh/zH/b9e7visGKimyzaIfutadlrgbIrRVbulC yY1NHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRt6YMC9ZHOc5U8ObLOvxx/sRp+0 +L5HhkLGKYn9Yf7dNVz5my54TV3Y0iD+1YL3WrAwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Cc: Greg Kroah-Hartman , Pierre-Louis Bossart , linux-kernel@vger.kernel.org, Vinod Koul , Sanyog Kale , Bard Liao X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" There's no need to special-case the dp0 sysfs attributes, the is_visible() callback in the attribute group can handle that for us, so add that and add it to the attribute group list making the logic simpler overall. This is a step on the way to moving all of the sysfs attribute handling into the default driver core attribute group logic so that the soundwire core does not have to do any of it manually. Cc: Vinod Koul Cc: Bard Liao Cc: Pierre-Louis Bossart Cc: Sanyog Kale Cc: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- v2: rebased on 6.0-rc1 drivers/soundwire/sysfs_slave.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/soundwire/sysfs_slave.c b/drivers/soundwire/sysfs_slave.c index 83e3f6cc3250..3723333a5c2b 100644 --- a/drivers/soundwire/sysfs_slave.c +++ b/drivers/soundwire/sysfs_slave.c @@ -174,6 +174,16 @@ static ssize_t words_show(struct device *dev, } static DEVICE_ATTR_RO(words); +static umode_t dp0_is_visible(struct kobject *kobj, struct attribute *attr, + int n) +{ + struct sdw_slave *slave = dev_to_sdw_dev(kobj_to_dev(kobj)); + + if (slave->prop.dp0_prop) + return attr->mode; + return 0; +} + static struct attribute *dp0_attrs[] = { &dev_attr_max_word.attr, &dev_attr_min_word.attr, @@ -190,12 +200,14 @@ static struct attribute *dp0_attrs[] = { */ static const struct attribute_group dp0_group = { .attrs = dp0_attrs, + .is_visible = dp0_is_visible, .name = "dp0", }; static const struct attribute_group *slave_groups[] = { &slave_attr_group, &sdw_slave_dev_attr_group, + &dp0_group, NULL, }; @@ -207,12 +219,6 @@ int sdw_slave_sysfs_init(struct sdw_slave *slave) if (ret < 0) return ret; - if (slave->prop.dp0_prop) { - ret = devm_device_add_group(&slave->dev, &dp0_group); - if (ret < 0) - return ret; - } - if (slave->prop.source_ports || slave->prop.sink_ports) { ret = sdw_slave_sysfs_dpn_init(slave); if (ret < 0) From patchwork Wed Aug 24 13:59:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 600337 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B3FF2C00140 for ; Wed, 24 Aug 2022 14:01:56 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8960B163D; Wed, 24 Aug 2022 16:01:04 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8960B163D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661349714; bh=6nZCzCUxqrkYMxJzTx9llPnlQoj8N2W8hF2t7ybajCc=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=sXOMwCly86B4dG/VB/ODT0yP4cxXuCiGH0CNPpJimrfUm4W6RC0gBnGTVQS3Nibm1 TLGTtC+qer56RigfZXdAGSEiSBPwInx/DVZ4Q+HqviBo7G4PhvPTLquFW7DOSTLSn3 GV6O09KzZEdLUC5nBwIOQ5IRdSD50P6i/yXCAwLs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4CE69F80537; Wed, 24 Aug 2022 16:00:15 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D7BE8F8053B; Wed, 24 Aug 2022 16:00:14 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id DB8D1F80528 for ; Wed, 24 Aug 2022 16:00:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz DB8D1F80528 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="UFzO7h+T" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 12AC5617DB; Wed, 24 Aug 2022 14:00:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F958C4347C; Wed, 24 Aug 2022 14:00:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661349606; bh=6nZCzCUxqrkYMxJzTx9llPnlQoj8N2W8hF2t7ybajCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UFzO7h+TWQh1k4tW2UsPRKxHtfH/AozcAm6+GAzzCP9bNMiOn34rzwlFH/XeuUKmD /zqJyekqcJHgWvWagvxMCqTghN5PJrHcLk+caCpsdXoWNFwfY3JG494JH4qg7w5KGv HjzROzhfjNdyxL7uTf3UOkhwE/rJxcNcnSLmI6ZY= From: Greg Kroah-Hartman To: alsa-devel@alsa-project.org Subject: [PATCH v2 4/6] soundwire: sysfs: have the driver core handle the creation of the device groups Date: Wed, 24 Aug 2022 15:59:49 +0200 Message-Id: <20220824135951.3604059-4-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220824135951.3604059-1-gregkh@linuxfoundation.org> References: <20220824135951.3604059-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2760; i=gregkh@linuxfoundation.org; h=from:subject; bh=6nZCzCUxqrkYMxJzTx9llPnlQoj8N2W8hF2t7ybajCc=; b=owGbwMvMwCRo6H6F97bub03G02pJDMlsetc3zbNNcH33c353u4+W4q00Do2PnAv3L9k+zc9VtLc5 /B1nRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEyEx49hvlvjtyfxP2uXNbmfW7fTdu oms6DIEwzz0x8KuR3V2qd79KSLyr1fTOdvzFrwDQA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Cc: Greg Kroah-Hartman , Pierre-Louis Bossart , linux-kernel@vger.kernel.org, Vinod Koul , Sanyog Kale , Bard Liao X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" The driver core supports the ability to handle the creation and removal of device-specific sysfs files in a race-free manner. Take advantage of that by converting this driver to use this by moving the sysfs attributes into a group and assigning the dev_groups pointer to it. Cc: Vinod Koul Cc: Bard Liao Cc: Pierre-Louis Bossart Cc: Sanyog Kale Cc: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- v2: rebased on 6.0-rc1 drivers/soundwire/bus_type.c | 1 + drivers/soundwire/sysfs_local.h | 3 +++ drivers/soundwire/sysfs_slave.c | 6 +----- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/soundwire/bus_type.c b/drivers/soundwire/bus_type.c index 04b3529f8929..397fe9179369 100644 --- a/drivers/soundwire/bus_type.c +++ b/drivers/soundwire/bus_type.c @@ -215,6 +215,7 @@ int __sdw_register_driver(struct sdw_driver *drv, struct module *owner) drv->driver.probe = sdw_drv_probe; drv->driver.remove = sdw_drv_remove; drv->driver.shutdown = sdw_drv_shutdown; + drv->driver.dev_groups = sdw_attr_groups; return driver_register(&drv->driver); } diff --git a/drivers/soundwire/sysfs_local.h b/drivers/soundwire/sysfs_local.h index 7268bc24c538..3ab8658a7782 100644 --- a/drivers/soundwire/sysfs_local.h +++ b/drivers/soundwire/sysfs_local.h @@ -11,6 +11,9 @@ /* basic attributes to report status of Slave (attachment, dev_num) */ extern const struct attribute_group *sdw_slave_status_attr_groups[]; +/* attributes for all soundwire devices */ +extern const struct attribute_group *sdw_attr_groups[]; + /* additional device-managed properties reported after driver probe */ int sdw_slave_sysfs_init(struct sdw_slave *slave); int sdw_slave_sysfs_dpn_init(struct sdw_slave *slave); diff --git a/drivers/soundwire/sysfs_slave.c b/drivers/soundwire/sysfs_slave.c index 3723333a5c2b..4c716c167493 100644 --- a/drivers/soundwire/sysfs_slave.c +++ b/drivers/soundwire/sysfs_slave.c @@ -204,7 +204,7 @@ static const struct attribute_group dp0_group = { .name = "dp0", }; -static const struct attribute_group *slave_groups[] = { +const struct attribute_group *sdw_attr_groups[] = { &slave_attr_group, &sdw_slave_dev_attr_group, &dp0_group, @@ -215,10 +215,6 @@ int sdw_slave_sysfs_init(struct sdw_slave *slave) { int ret; - ret = devm_device_add_groups(&slave->dev, slave_groups); - if (ret < 0) - return ret; - if (slave->prop.source_ports || slave->prop.sink_ports) { ret = sdw_slave_sysfs_dpn_init(slave); if (ret < 0) From patchwork Wed Aug 24 13:59:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 599746 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 711A5C00140 for ; Wed, 24 Aug 2022 14:02:17 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A8665164F; Wed, 24 Aug 2022 16:01:25 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A8665164F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661349735; bh=laXM6lyBiYvs+XzB8BFEK5j81iYzsKzZFFBxOwJyqwE=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=YUNtt4jlMxys40HPMDAUEGUxBllmzws0zMMbYpe4X3tmdBXrtqtxLXqhTctviq2vE dY7kZ3wSfHN8DKAXNbxUzKzceMW7LZCSSg7l7dRVSiVlsjnbUVCIEREjVEB17QP84C 8/r0oPwCDM81P+dpZMg8lCbVN9mE/Xuk2k+9E9+E= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id D3549F80548; Wed, 24 Aug 2022 16:00:18 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E4476F80548; Wed, 24 Aug 2022 16:00:17 +0200 (CEST) Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id E63FEF80536 for ; Wed, 24 Aug 2022 16:00:11 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz E63FEF80536 Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="YEgVk8kK" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9D028617D7; Wed, 24 Aug 2022 14:00:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 359F9C433C1; Wed, 24 Aug 2022 14:00:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661349609; bh=laXM6lyBiYvs+XzB8BFEK5j81iYzsKzZFFBxOwJyqwE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YEgVk8kKEceE2CWXuFKiYOQH/RZ2cjiIBL4YyzW7FyvQMhhjcf+Kgwzm41FXyWt8b yVqRWtDnaUn8YTjvo07Tn6Os7B3z2JrGnD7GNrKlhVRUWibUtaBrKteL9n637kC9am 4WemvuuILboR6VieSnCAmmzhzwLQ0+8300gPwDak= From: Greg Kroah-Hartman To: alsa-devel@alsa-project.org Subject: [PATCH v2 5/6] soundwire: sysfs: remove sdw_slave_sysfs_init() Date: Wed, 24 Aug 2022 15:59:50 +0200 Message-Id: <20220824135951.3604059-5-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220824135951.3604059-1-gregkh@linuxfoundation.org> References: <20220824135951.3604059-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3155; i=gregkh@linuxfoundation.org; h=from:subject; bh=laXM6lyBiYvs+XzB8BFEK5j81iYzsKzZFFBxOwJyqwE=; b=owGbwMvMwCRo6H6F97bub03G02pJDMlsetfbZtb5vM9Oy9M9rv91x5OwOVM7eC9JOWf96Sys6Pln 9HhdRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAEwkNYJhDrc/788lyn1bpXaaLJDeW+ cy+ZC+BsOCCVZfTs90+iy8/7dfhvL7Tcx7Nmd5AgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Cc: Greg Kroah-Hartman , Pierre-Louis Bossart , linux-kernel@vger.kernel.org, Vinod Koul , Sanyog Kale , Bard Liao X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Now that sdw_slave_sysfs_init() only calls sdw_slave_sysfs_dpn_init(), just do that instead and remove sdw_slave_sysfs_init() to get it out of the way to save a bit of logic and code size. Cc: Vinod Koul Cc: Bard Liao Cc: Pierre-Louis Bossart Cc: Sanyog Kale Cc: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- v2: rebased on 6.0-rc1 drivers/soundwire/bus_type.c | 4 ++-- drivers/soundwire/sysfs_local.h | 1 - drivers/soundwire/sysfs_slave.c | 13 ------------- drivers/soundwire/sysfs_slave_dpn.c | 3 +++ 4 files changed, 5 insertions(+), 16 deletions(-) diff --git a/drivers/soundwire/bus_type.c b/drivers/soundwire/bus_type.c index 397fe9179369..5e488dd64724 100644 --- a/drivers/soundwire/bus_type.c +++ b/drivers/soundwire/bus_type.c @@ -123,8 +123,8 @@ static int sdw_drv_probe(struct device *dev) if (drv->ops && drv->ops->read_prop) drv->ops->read_prop(slave); - /* init the sysfs as we have properties now */ - ret = sdw_slave_sysfs_init(slave); + /* init the dynamic sysfs attributes we need */ + ret = sdw_slave_sysfs_dpn_init(slave); if (ret < 0) dev_warn(dev, "Slave sysfs init failed:%d\n", ret); diff --git a/drivers/soundwire/sysfs_local.h b/drivers/soundwire/sysfs_local.h index 3ab8658a7782..fa048e112629 100644 --- a/drivers/soundwire/sysfs_local.h +++ b/drivers/soundwire/sysfs_local.h @@ -15,7 +15,6 @@ extern const struct attribute_group *sdw_slave_status_attr_groups[]; extern const struct attribute_group *sdw_attr_groups[]; /* additional device-managed properties reported after driver probe */ -int sdw_slave_sysfs_init(struct sdw_slave *slave); int sdw_slave_sysfs_dpn_init(struct sdw_slave *slave); #endif /* __SDW_SYSFS_LOCAL_H */ diff --git a/drivers/soundwire/sysfs_slave.c b/drivers/soundwire/sysfs_slave.c index 4c716c167493..070e0d84be94 100644 --- a/drivers/soundwire/sysfs_slave.c +++ b/drivers/soundwire/sysfs_slave.c @@ -211,19 +211,6 @@ const struct attribute_group *sdw_attr_groups[] = { NULL, }; -int sdw_slave_sysfs_init(struct sdw_slave *slave) -{ - int ret; - - if (slave->prop.source_ports || slave->prop.sink_ports) { - ret = sdw_slave_sysfs_dpn_init(slave); - if (ret < 0) - return ret; - } - - return 0; -} - /* * the status is shown in capital letters for UNATTACHED and RESERVED * on purpose, to highligh users to the fact that these status values diff --git a/drivers/soundwire/sysfs_slave_dpn.c b/drivers/soundwire/sysfs_slave_dpn.c index c4b6543c09fd..a3fb380ee519 100644 --- a/drivers/soundwire/sysfs_slave_dpn.c +++ b/drivers/soundwire/sysfs_slave_dpn.c @@ -283,6 +283,9 @@ int sdw_slave_sysfs_dpn_init(struct sdw_slave *slave) int ret; int i; + if (!slave->prop.source_ports && !slave->prop.sink_ports) + return 0; + mask = slave->prop.source_ports; for_each_set_bit(i, &mask, 32) { ret = add_all_attributes(&slave->dev, i, 1); From patchwork Wed Aug 24 13:59:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 600336 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ACC48C00140 for ; Wed, 24 Aug 2022 14:02:33 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id CCBEE15C3; Wed, 24 Aug 2022 16:01:41 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz CCBEE15C3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1661349751; bh=blMIr/c0QPTHL7baowlNwM0md9br9WlyF6LQUMfF2JY=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=s3T/yhQt0vFk8hOy73GGupJldVG0wMnMMY0yoGO4LxKXmtk1XuR6KOLEC2XTvL5lP gh0vcXKWyAhmyUAggezKK1V4aeZa7i2S6Sm9mMr5SFwoL5O3WlYUlM8SlYfECSkPTp 83rNuk8utw8KL+szYGoz8V78rrRmiZDgSVAfslEI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id C825FF80552; Wed, 24 Aug 2022 16:00:24 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 61843F80552; Wed, 24 Aug 2022 16:00:23 +0200 (CEST) Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 61AA6F8053A for ; Wed, 24 Aug 2022 16:00:16 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 61AA6F8053A Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="xMjGpR80" Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 98A37B823B5; Wed, 24 Aug 2022 14:00:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7161BC433B5; Wed, 24 Aug 2022 14:00:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661349613; bh=blMIr/c0QPTHL7baowlNwM0md9br9WlyF6LQUMfF2JY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xMjGpR80qOIpWvAyzrJtnrkiV8qxjXzH1G1a+fRD/B8WlFzmSc9tHkYJ77hYhJCDl r2ZBzfP/IEp3AtLse/I7RDXNmiDcf6lmIAdZT515csl32tikORu/gPnDvS4TYLwVLy imLStvu8I9sDoSzD3Pc0W4pwVTUuVAd6Y1aApMaI= From: Greg Kroah-Hartman To: alsa-devel@alsa-project.org Subject: [PATCH v2 6/6] soundwire: sysfs: remove unneeded ATTRIBUTE_GROUPS() comments Date: Wed, 24 Aug 2022 15:59:51 +0200 Message-Id: <20220824135951.3604059-6-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220824135951.3604059-1-gregkh@linuxfoundation.org> References: <20220824135951.3604059-1-gregkh@linuxfoundation.org> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1435; i=gregkh@linuxfoundation.org; h=from:subject; bh=blMIr/c0QPTHL7baowlNwM0md9br9WlyF6LQUMfF2JY=; b=owGbwMvMwCRo6H6F97bub03G02pJDMlsetfDlRolL5XPLW//5aOwtlHogvEzFZb/z0PTRM++s917 xay6I5aFQZCJQVZMkeXLNp6j+ysOKXoZ2p6GmcPKBDKEgYtTACbSuplhfvKVScKRDasndjCtcN52qW 8uc9TaEob5iQ1NbNf3tvO11B2xNyjqzliisnIOAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Cc: Greg Kroah-Hartman , Pierre-Louis Bossart , linux-kernel@vger.kernel.org, Vinod Koul , Sanyog Kale , Bard Liao X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Now that we manually created our own attribute group list, the outdated ATTRIBUTE_GROUPS() comments can be removed as they are not needed at all. Cc: Vinod Koul Cc: Bard Liao Cc: Pierre-Louis Bossart Cc: Sanyog Kale Cc: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- v2: rebased on 6.0-rc1 drivers/soundwire/sysfs_slave.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/soundwire/sysfs_slave.c b/drivers/soundwire/sysfs_slave.c index 070e0d84be94..5b7666d27722 100644 --- a/drivers/soundwire/sysfs_slave.c +++ b/drivers/soundwire/sysfs_slave.c @@ -129,10 +129,6 @@ static struct attribute *slave_dev_attrs[] = { NULL, }; -/* - * we don't use ATTRIBUTES_GROUP here since we want to add a subdirectory - * for device-level properties - */ static const struct attribute_group sdw_slave_dev_attr_group = { .attrs = slave_dev_attrs, .name = "dev-properties", @@ -194,10 +190,6 @@ static struct attribute *dp0_attrs[] = { NULL, }; -/* - * we don't use ATTRIBUTES_GROUP here since we want to add a subdirectory - * for dp0-level properties - */ static const struct attribute_group dp0_group = { .attrs = dp0_attrs, .is_visible = dp0_is_visible,