Commit f01f7a98 authored by Bryan O'Donoghue's avatar Bryan O'Donoghue Committed by Greg Kroah-Hartman

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: default avatarBryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: default avatarPatrick Titiano <ptitiano@baylibre.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 6872c461
......@@ -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 @@ static int gb_loopback_connection_init(struct gb_connection *connection)
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment