Commit 32dff13d authored by Matt Porter's avatar Matt Porter Committed by Greg Kroah-Hartman

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: default avatarMatt Porter <mporter@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 2f30d9ff
...@@ -231,14 +231,20 @@ void gb_add_module(struct greybus_host_device *hd, u8 module_id, ...@@ -231,14 +231,20 @@ void gb_add_module(struct greybus_host_device *hd, u8 module_id,
device_initialize(&gmod->dev); device_initialize(&gmod->dev);
dev_set_name(&gmod->dev, "%d", module_id); dev_set_name(&gmod->dev, "%d", module_id);
retval = gb_init_subdevs(gmod, &fake_greybus_module_id); retval = device_add(&gmod->dev);
if (retval) if (retval)
goto error; goto error;
// FIXME device_add(&gmod->dev); retval = gb_init_subdevs(gmod, &fake_greybus_module_id);
if (retval)
goto error_subdevs;
//return gmod; //return gmod;
return; return;
error_subdevs:
device_del(&gmod->dev);
error: error:
put_device(&gmod->dev); put_device(&gmod->dev);
greybus_module_release(&gmod->dev); greybus_module_release(&gmod->dev);
......
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