greybus: loopback: fix layer violation
authorJohan Hovold <johan@hovoldconsulting.com>
Wed, 11 Nov 2015 09:07:02 +0000 (10:07 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 11 Nov 2015 17:18:28 +0000 (09:18 -0800)
A bundle (protocol) driver has no business creating sysfs entries for an
ancestor device.

Move the sysfs entries to the bundle device for now.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/loopback.c

index e1b1be0687a879aa3dae1b0ddab610379c2186d2..9a44dcc7d7d7e35c15d495f163e8c48ea94f3596 100644 (file)
@@ -921,7 +921,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->hd->endo->dev.kobj;
+       struct kobject *kobj = &connection->bundle->dev.kobj;
 
        gb = kzalloc(sizeof(*gb), GFP_KERNEL);
        if (!gb)
@@ -1010,7 +1010,7 @@ out_sysfs:
 static void gb_loopback_connection_exit(struct gb_connection *connection)
 {
        struct gb_loopback *gb = connection->bundle->private;
-       struct kobject *kobj = &connection->hd->endo->dev.kobj;
+       struct kobject *kobj = &connection->bundle->dev.kobj;
 
        if (!IS_ERR_OR_NULL(gb->task))
                kthread_stop(gb->task);