]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
greybus: stop init_subdevs stuff
authorAlex Elder <elder@linaro.org>
Thu, 16 Oct 2014 11:35:30 +0000 (06:35 -0500)
committerGreg Kroah-Hartman <greg@kroah.com>
Fri, 17 Oct 2014 16:13:15 +0000 (18:13 +0200)
Upcoming patches are going to set up devices based on what is
discovered in the module manifest.  Get rid of the hard-coded
initialization done by gb_init_subdevs(), along with other related
code.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/core.c
drivers/staging/greybus/greybus.h

index 67628719f8d1f83ac4bba7945846bbefecf0d66e..720ab47033fb593d6fddebea47b3ccb14b80680a 100644 (file)
@@ -131,59 +131,6 @@ static struct device_type greybus_module_type = {
        .release =      greybus_module_release,
 };
 
-/* XXX
- * This needs to be driven by the list of functions that the
- * manifest says are present.
- */
-static int gb_init_subdevs(struct gb_module *gmod,
-                          const struct greybus_module_id *id)
-{
-       int retval;
-
-       /* Allocate all of the different "sub device types" for this device */
-
-       /* XXX
-        * Decide what exactly we should get supplied for the i2c
-        * probe, and then work that back to what should be present
-        * in the manifest.
-        */
-       retval = gb_i2c_probe(gmod, id);
-       if (retval)
-               goto error_i2c;
-
-       retval = gb_gpio_probe(gmod, id);
-       if (retval)
-               goto error_gpio;
-
-       retval = gb_sdio_probe(gmod, id);
-       if (retval)
-               goto error_sdio;
-
-       retval = gb_tty_probe(gmod, id);
-       if (retval)
-               goto error_tty;
-
-       retval = gb_battery_probe(gmod, id);
-       if (retval)
-               goto error_battery;
-       return 0;
-
-error_battery:
-       gb_tty_disconnect(gmod);
-
-error_tty:
-       gb_sdio_disconnect(gmod);
-
-error_sdio:
-       gb_gpio_disconnect(gmod);
-
-error_gpio:
-       gb_i2c_disconnect(gmod);
-
-error_i2c:
-       return retval;
-}
-
 static const struct greybus_module_id fake_greybus_module_id = {
        GREYBUS_DEVICE(0x42, 0x42)
 };
@@ -235,19 +182,8 @@ void gb_add_module(struct greybus_host_device *hd, u8 module_id,
        dev_set_name(&gmod->dev, "%d", module_id);
 
        retval = device_add(&gmod->dev);
-       if (retval)
-               goto error;
-
-       retval = gb_init_subdevs(gmod, &fake_greybus_module_id);
-       if (retval)
-               goto error_subdevs;
-
-       //return gmod;
-       return;
-
-error_subdevs:
-       device_del(&gmod->dev);
-
+       if (!retval)
+               return;         /* Success */
 error:
        gb_module_destroy(gmod);
 
@@ -274,13 +210,6 @@ void gb_remove_module(struct greybus_host_device *hd, u8 module_id)
 
 void greybus_remove_device(struct gb_module *gmod)
 {
-       /* tear down all of the "sub device types" for this device */
-       gb_i2c_disconnect(gmod);
-       gb_gpio_disconnect(gmod);
-       gb_sdio_disconnect(gmod);
-       gb_tty_disconnect(gmod);
-       gb_battery_disconnect(gmod);
-
        device_del(&gmod->dev);
        put_device(&gmod->dev);
 }
index 033c7abe96f045910ff2d87f3a0793f1d871ae8b..1970106d70a0cd4dd8da22fcfedb1c22650f81dc 100644 (file)
@@ -265,23 +265,6 @@ void gb_deregister_cport_complete(u16 cport_id);
 
 extern const struct attribute_group *greybus_module_groups[];
 
-/*
- * Because we are allocating a data structure per "type" in the greybus device,
- * we have static functions for this, not "dynamic" drivers like we really
- * should in the end.
- */
-int gb_i2c_probe(struct gb_module *gmod, const struct greybus_module_id *id);
-void gb_i2c_disconnect(struct gb_module *gmod);
-int gb_gpio_probe(struct gb_module *gmod, const struct greybus_module_id *id);
-void gb_gpio_disconnect(struct gb_module *gmod);
-int gb_sdio_probe(struct gb_module *gmod, const struct greybus_module_id *id);
-void gb_sdio_disconnect(struct gb_module *gmod);
-int gb_tty_probe(struct gb_module *gmod, const struct greybus_module_id *id);
-void gb_tty_disconnect(struct gb_module *gmod);
-int gb_battery_probe(struct gb_module *gmod,
-                       const struct greybus_module_id *id);
-void gb_battery_disconnect(struct gb_module *gmod);
-
 int gb_tty_init(void);
 void gb_tty_exit(void);