From: Julian Wiedmann <jwi@linux.ibm.com>
To: David Miller <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>
Cc: linux-netdev <netdev@vger.kernel.org>,
linux-s390 <linux-s390@vger.kernel.org>,
Heiko Carstens <hca@linux.ibm.com>,
Karsten Graul <kgraul@linux.ibm.com>,
Julian Wiedmann <jwi@linux.ibm.com>
Subject: [PATCH net-next 2/6] s390/ccwgroup: use bus->dev_groups for bus-based sysfs attributes
Date: Mon, 7 Dec 2020 14:12:29 +0100 [thread overview]
Message-ID: <20201207131233.90383-3-jwi@linux.ibm.com> (raw)
In-Reply-To: <20201207131233.90383-1-jwi@linux.ibm.com>
Bus drivers have their own way of describing the sysfs attributes that
all devices on a bus should provide.
Switch ccwgroup_attr_groups over to use bus->dev_groups, and thus
free up dev->groups for usage by the ccwgroup device drivers.
While adjusting the attribute naming, use ATTRIBUTE_GROUPS() to get rid
of some boilerplate code.
Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Acked-by: Heiko Carstens <hca@linux.ibm.com>
---
drivers/s390/cio/ccwgroup.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c
index 483a9ecfcbb1..444385da5792 100644
--- a/drivers/s390/cio/ccwgroup.c
+++ b/drivers/s390/cio/ccwgroup.c
@@ -210,18 +210,12 @@ static ssize_t ccwgroup_ungroup_store(struct device *dev,
static DEVICE_ATTR(ungroup, 0200, NULL, ccwgroup_ungroup_store);
static DEVICE_ATTR(online, 0644, ccwgroup_online_show, ccwgroup_online_store);
-static struct attribute *ccwgroup_attrs[] = {
+static struct attribute *ccwgroup_dev_attrs[] = {
&dev_attr_online.attr,
&dev_attr_ungroup.attr,
NULL,
};
-static struct attribute_group ccwgroup_attr_group = {
- .attrs = ccwgroup_attrs,
-};
-static const struct attribute_group *ccwgroup_attr_groups[] = {
- &ccwgroup_attr_group,
- NULL,
-};
+ATTRIBUTE_GROUPS(ccwgroup_dev);
static void ccwgroup_ungroup_workfn(struct work_struct *work)
{
@@ -384,7 +378,6 @@ int ccwgroup_create_dev(struct device *parent, struct ccwgroup_driver *gdrv,
}
dev_set_name(&gdev->dev, "%s", dev_name(&gdev->cdev[0]->dev));
- gdev->dev.groups = ccwgroup_attr_groups;
if (gdrv) {
gdev->dev.driver = &gdrv->driver;
@@ -487,6 +480,7 @@ static void ccwgroup_shutdown(struct device *dev)
static struct bus_type ccwgroup_bus_type = {
.name = "ccwgroup",
+ .dev_groups = ccwgroup_dev_groups,
.remove = ccwgroup_remove,
.shutdown = ccwgroup_shutdown,
};
--
2.17.1
next prev parent reply other threads:[~2020-12-07 13:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-07 13:12 [PATCH net-next 0/6] s390/qeth: updates 2020-12-07 Julian Wiedmann
2020-12-07 13:12 ` [PATCH net-next 1/6] s390/qeth: don't call INIT_LIST_HEAD() on iob's list entry Julian Wiedmann
2020-12-07 13:12 ` Julian Wiedmann [this message]
2020-12-07 13:12 ` [PATCH net-next 3/6] s390/qeth: use dev->groups for common sysfs attributes Julian Wiedmann
2020-12-07 13:12 ` [PATCH net-next 4/6] s390/qeth: don't replace a fully completed async TX buffer Julian Wiedmann
2020-12-07 13:12 ` [PATCH net-next 5/6] s390/qeth: remove QETH_QDIO_BUF_HANDLED_DELAYED state Julian Wiedmann
2020-12-07 13:12 ` [PATCH net-next 6/6] s390/qeth: make qeth_qdio_handle_aob() more robust Julian Wiedmann
2020-12-07 14:57 ` [PATCH net-next 0/6] s390/qeth: updates 2020-12-07 David Miller
2020-12-07 16:56 ` Julian Wiedmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201207131233.90383-3-jwi@linux.ibm.com \
--to=jwi@linux.ibm.com \
--cc=davem@davemloft.net \
--cc=hca@linux.ibm.com \
--cc=kgraul@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox