mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-15 01:01:56 -04:00
greybus: fix gb_add_module() by enabling the device_add()
Without the gb_module device being added, we have no parent device for any of the greybus subdevs to be added. Do the device_add() before creating subdevs as we need it then to register any children in the various greybus protocol drivers. Signed-off-by: Matt Porter <mporter@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
parent
2f30d9ffee
commit
32dff13d21
1 changed files with 8 additions and 2 deletions
|
|
@ -231,14 +231,20 @@ void gb_add_module(struct greybus_host_device *hd, u8 module_id,
|
|||
device_initialize(&gmod->dev);
|
||||
dev_set_name(&gmod->dev, "%d", module_id);
|
||||
|
||||
retval = gb_init_subdevs(gmod, &fake_greybus_module_id);
|
||||
retval = device_add(&gmod->dev);
|
||||
if (retval)
|
||||
goto error;
|
||||
|
||||
// FIXME device_add(&gmod->dev);
|
||||
retval = gb_init_subdevs(gmod, &fake_greybus_module_id);
|
||||
if (retval)
|
||||
goto error_subdevs;
|
||||
|
||||
//return gmod;
|
||||
return;
|
||||
|
||||
error_subdevs:
|
||||
device_del(&gmod->dev);
|
||||
|
||||
error:
|
||||
put_device(&gmod->dev);
|
||||
greybus_module_release(&gmod->dev);
|
||||
|
|
|
|||
Loading…
Reference in a new issue