Thread (10 messages) 10 messages, 2 authors, 2023-02-03

Re: [PATCH v2 3/6] hvcs: Use driver groups to manage driver attributes

flat view

From: Greg KH <gregkh@linuxfoundation.org>
Date: 2023-02-03 05:13:02
Also in: linux-serial

On Thu, Feb 02, 2023 at 04:28:01PM -0600, Brian King wrote:
quoted hunk ↗ jump to hunk
Rather than manually creating attributes for the hvcs driver,
let the driver core do this for us. This also fixes some hotplug
remove issues and ensures that cleanup of these attributes
is done in the right order.

Signed-off-by: Brian King <redacted>
---
 drivers/tty/hvc/hvcs.c | 24 +++++++++++++++---------
 1 file changed, 15 insertions(+), 9 deletions(-)
diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c
index 7f79444b4d89..5de7ad555540 100644
--- a/drivers/tty/hvc/hvcs.c
+++ b/drivers/tty/hvc/hvcs.c
@@ -473,6 +473,20 @@ static ssize_t rescan_store(struct device_driver *ddp, const char * buf,
 
 static DRIVER_ATTR_RW(rescan);
 
+static struct attribute *hvcs_attrs[] = {
+	&driver_attr_rescan.attr,
+	NULL,
+};
+
+static struct attribute_group hvcs_attr_group = {
+	.attrs = hvcs_attrs,
+};
+
+const static struct attribute_group *hvcs_attr_groups[] = {
+	&hvcs_attr_group,
+	NULL,
+};
Again, ATTRIBUTE_GROUPS()?

thanks,

greg k-h
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help