From: Bryan O'Donoghue Date: Wed, 23 Sep 2015 16:31:31 +0000 (-0700) Subject: greybus: loopback: move sysfs entries to /sys/bus/greybus/devices/endo0 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f01f7a9851f9c75467373ba7797394dba91825da;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git greybus: loopback: move sysfs entries to /sys/bus/greybus/devices/endo0 Currently we have sysfs entries that are created when the first incoming connection is created as sub-nodes of the module associated with that connection e.g. /sys/bus/grebus/devices/endo0:X where X is the module identifier associated with the new connection. This is conceptually incorrect since the sysfs entries we create actually aren't bound to a module. Depending on the order connections are brought up we can also have a situation where /sys/bus/greybus/devices/endo0:X has high-level control sysfs data-points but /sys/bus/greybus/devices/endo0:Y does not. Rather than needlessly replicate data-points across each endo0:X, endo0:Y, endo0:Z sysfs directories it is more sensible to locate the entries in /sys/bus/greybus/devices/endo0. Signed-off-by: Bryan O'Donoghue Reviewed-by: Patrick Titiano Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c index 7ccf9a26dab3..3151876a717c 100644 --- a/drivers/staging/greybus/loopback.c +++ b/drivers/staging/greybus/loopback.c @@ -874,7 +874,7 @@ static int gb_loopback_connection_init(struct gb_connection *connection) struct gb_loopback *gb; int retval; char name[DEBUGFS_NAMELEN]; - struct kobject *kobj = &connection->bundle->intf->module->dev.kobj; + struct kobject *kobj = &connection->hd->endo->dev.kobj; gb = kzalloc(sizeof(*gb), GFP_KERNEL); if (!gb) @@ -963,7 +963,7 @@ out_sysfs: static void gb_loopback_connection_exit(struct gb_connection *connection) { struct gb_loopback *gb = connection->private; - struct kobject *kobj = &connection->bundle->intf->module->dev.kobj; + struct kobject *kobj = &connection->hd->endo->dev.kobj; if (!IS_ERR_OR_NULL(gb->task)) kthread_stop(gb->task);