Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1201939rdb; Tue, 30 Jan 2024 10:47:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IGe+KtZpQ/jPiTpYahqYy6AroEZ+2T+yiKQHc92cPh2ZDeiWZGDjBFIbkYZz7hRIvm/JueI X-Received: by 2002:a9d:7f12:0:b0:6e1:29f3:6fb6 with SMTP id j18-20020a9d7f12000000b006e129f36fb6mr5307514otq.28.1706640425567; Tue, 30 Jan 2024 10:47:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706640425; cv=pass; d=google.com; s=arc-20160816; b=K9W3QhplvdA2ODpeXpr7lqYjDfn9NN92pimEA3yVPtD1w5Xgb0ok0JSkk0J0+TCrhn u5v/6OkbkzATn4nj5UoAPteQDxXW/09rV6YiLmObOQ2qxiWz0z5uQAormCDMUCLNT42U 1qaGewpt1B9j5/npJT/i4XB05frBplQaac7Ikdula7ALkdJmnTSEQRXC4D9QsfyA3k/a mKQrLT2gGFF4OABmV6KEL24MbWJHxUI43JoUoj4dMVdT3x69zGHlTDHR/U77bqAhASYt dDcAsN/xrCnIqYFRxqIE8p6NLdJmM7N2/xqsTsn+e5PxIjRhiSevPqcq2dlmL7Zxq09n 9CSA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:lines:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=eyV8Fwb2dhkgzpF6N7VnmFNwcZ6ZmF03gZZsLnoU9h4=; fh=ZUcPkiVf4gvMgVDOUhavBu3WqSDJFLN7Q4rE5Smm1Ig=; b=TYINGYPmKMINo5smpM1Oz99GveiwlmT0u67u5TPX/Ikcn0kI1044lZDYQtXfWI2geG AgS4kMKsZGdEGaBHeoRJCk3FJt4BqLaEOA+tcXcJRxxPRFVB/BDTMg3oTk0VVrU0E4yH yOHtcR4MvvfzhHe8YSh9ood/NWPFU6v89dHksBT8RcTLLgVqZm0+MLceL1I2axugB676 RLXHFdmwyNasckW1S/NXJKiTw+JvajTGotlDbDdmvDrrREBW0IgyRBKzEzeAGyphk846 A6ECxLAtOG1cr2NxEHq/RO/3kWT74Yk14VVVbe9hlARNEz/8F8SBoB88h4d1PVEK+9vH +iaA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JEoAujC5; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-45133-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45133-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d16-20020a05622a15d000b0042bdf761cfdsi1191152qty.125.2024.01.30.10.47.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 10:47:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-45133-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=JEoAujC5; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-45133-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-45133-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2D6B51C22577 for ; Tue, 30 Jan 2024 18:47:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5849878B6B; Tue, 30 Jan 2024 18:46:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="JEoAujC5" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8354C78B67 for ; Tue, 30 Jan 2024 18:46:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706640402; cv=none; b=eWMbpl7w5Q5GMvEgizi6lZcHrZTZRA2FPP0f/1M9CU92PY+7yPVIvqIcAOFaU3r239tkRXz3qrmu0i55j6OmcKSYU9JeCPnDwPJbYVtxRquiQy8QMgbJtLfArcf+rBRsBNIApFerIqZtVtxDSn7+gdQACJc4szVzXbz+tnEQMdc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706640402; c=relaxed/simple; bh=/Scr6QfMZ0RCV35H3B6N+LHXt3JnpeduIhhpHaToKUk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Kel272UqBhhuC8UeBZa8WpZFkwN+ORuUh0Vddq+FtzXFCvPJBeh+HR5yIfUbJgfkXSMFpiokVc6DRj97akvQr+0Xrycwm1/ewNg7dcyKiEE+gbvph1wJ4p3IdcJ4fYFjAHNucDUM+dFTmo/qFx4XWPEB53CSyLTU4DU/tLkVnrc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JEoAujC5; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8C46C433C7; Tue, 30 Jan 2024 18:46:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1706640401; bh=/Scr6QfMZ0RCV35H3B6N+LHXt3JnpeduIhhpHaToKUk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JEoAujC5s2u7BS20jS5iQkeHDhaHoO14PWbNCx/yT6GTbPSKfGvmPQWHo3EAY6Oz5 qqrMzz9jvfZWiFbdRVKYJeu1QXh6S8SaVntmOj+kZGARof2B8kb7yeMLcxwflkkeAe OAkS89eEpD6BPw6c5QQPup8vAd7UvIMDmyPwLbKM= From: Greg Kroah-Hartman To: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Dan Williams , Vinod Koul , Bard Liao , Pierre-Louis Bossart , Sanyog Kale Subject: [PATCH 2/6] soundwire: sysfs: move sdw_slave_dev_attr_group into the existing list of groups Date: Tue, 30 Jan 2024 10:46:28 -0800 Message-ID: <2024013029-afternoon-suitably-cb59@gregkh> X-Mailer: git-send-email 2.43.0 In-Reply-To: <2024013025-spoiling-exact-ad20@gregkh> References: <2024013025-spoiling-exact-ad20@gregkh> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Lines: 61 X-Developer-Signature: v=1; a=openpgp-sha256; l=1988; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=/Scr6QfMZ0RCV35H3B6N+LHXt3JnpeduIhhpHaToKUk=; b=owGbwMvMwCRo6H6F97bub03G02pJDKk7XVjXmhzm99L80ysUunDv2iTNrm7uN7MCJ7MIXvn3f 8uCWZcPdcSyMAgyMciKKbJ82cZzdH/FIUUvQ9vTMHNYmUCGMHBxCsBEAuIZ5hnuTOeNfiPWvsVX /e7WpMUnV77XfsGw4PycJgOeGN6sFzc/K/YWPBXY5LUrDwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit 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 --- 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) -- 2.43.0