greybus: battery: fix class-device parent
authorJohan Hovold <johan@hovoldconsulting.com>
Wed, 11 Nov 2015 09:07:03 +0000 (10:07 +0100)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 11 Nov 2015 17:18:28 +0000 (09:18 -0800)
Greybus bundle drivers should register their class devices as children
to the bundle device that they bind to.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/battery.c

index 6b354de146d1a5b473e7c51b5985c43c9f1c10a6..e119775fb19bfb80526854d85623b010730ff566 100644 (file)
@@ -244,7 +244,7 @@ static int init_and_register(struct gb_connection *connection,
        gb->bat.num_properties  = ARRAY_SIZE(battery_props);
        gb->bat.get_property    = get_property;
 
-       return power_supply_register(&connection->bundle->intf->dev, &gb->bat);
+       return power_supply_register(&connection->bundle->dev, &gb->bat);
 }
 #else
 static int init_and_register(struct gb_connection *connection,
@@ -262,7 +262,7 @@ static int init_and_register(struct gb_connection *connection,
        gb->desc.num_properties = ARRAY_SIZE(battery_props);
        gb->desc.get_property   = get_property;
 
-       gb->bat = power_supply_register(&connection->bundle->intf->dev,
+       gb->bat = power_supply_register(&connection->bundle->dev,
                                        &gb->desc, &cfg);
        if (IS_ERR(gb->bat))
                return PTR_ERR(gb->bat);