Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd414d47 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman
Browse files

greybus: battery: fix class-device parent



Greybus bundle drivers should register their class devices as children
to the bundle device that they bind to.

Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 0d1d6ee2
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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);