Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1659132 > unrolled thread

[PATCH 15/16] tty: serdev: use dev_groups and not dev_attrs for bus_type

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2017-06-06 21:30 +0200
Last post2017-06-06 21:30 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 15/16] tty: serdev: use dev_groups and not dev_attrs for bus_type Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-06-06 21:30 +0200

#1659132 — [PATCH 15/16] tty: serdev: use dev_groups and not dev_attrs for bus_type

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-06-06 21:30 +0200
Subject[PATCH 15/16] tty: serdev: use dev_groups and not dev_attrs for bus_type
Message-ID<tPskX-4zc-37@gated-at.bofh.it>
The dev_attrs field has long been "depreciated" and is finally being
removed, so move the driver to use the "correct" dev_groups field
instead for struct bus_type.

Cc: Rob Herring <robh@kernel.org>
Cc: Jiri Slaby <jslaby@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/tty/serdev/core.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index 433de5ea9b02..e454162d8c6e 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -250,11 +250,13 @@ static ssize_t modalias_show(struct device *dev,
 {
 	return of_device_modalias(dev, buf, PAGE_SIZE);
 }
+DEVICE_ATTR_RO(modalias);
 
-static struct device_attribute serdev_device_attrs[] = {
-	__ATTR_RO(modalias),
-	__ATTR_NULL
+static struct attribute *serdev_device_attrs[] = {
+	&dev_attr_modalias.attr,
+	NULL,
 };
+ATTRIBUTE_GROUPS(serdev_device);
 
 static struct bus_type serdev_bus_type = {
 	.name		= "serial",
@@ -262,7 +264,7 @@ static struct bus_type serdev_bus_type = {
 	.probe		= serdev_drv_probe,
 	.remove		= serdev_drv_remove,
 	.uevent		= serdev_uevent,
-	.dev_attrs	= serdev_device_attrs,
+	.dev_groups	= serdev_device_groups,
 };
 
 /**
-- 
2.13.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web