]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
greybus: sdio-gb: convert to the connection interface.
authorGreg Kroah-Hartman <greg@kroah.com>
Tue, 28 Oct 2014 02:17:09 +0000 (10:17 +0800)
committerGreg Kroah-Hartman <greg@kroah.com>
Tue, 28 Oct 2014 02:17:09 +0000 (10:17 +0800)
No one is using sdio yet, but convert to the connection interface to
remove the last user of the "old" module interface.

Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/greybus.h
drivers/staging/greybus/sdio-gb.c

index f907e0fe7fc910c6ad1f1461d66d1b463799a92c..3a8d8f1c077ca7eda6abf9303aa5099482a53104 100644 (file)
@@ -151,7 +151,6 @@ struct gbuf {
 
 struct gb_i2c_device;
 struct gb_gpio_device;
-struct gb_sdio_host;
 struct gb_tty;
 struct gb_usb_device;
 struct gb_battery;
@@ -270,6 +269,7 @@ extern struct gb_connection_handler gb_i2c_connection_handler;
 extern struct gb_connection_handler gb_gpio_connection_handler;
 extern struct gb_connection_handler gb_battery_connection_handler;
 extern struct gb_connection_handler gb_uart_connection_handler;
+extern struct gb_connection_handler gb_sdio_connection_handler;
 
 int gb_uart_device_init(struct gb_connection *connection);
 void gb_uart_device_exit(struct gb_connection *connection);
index 19c7c4ac81ebe76fc89dddffd37ce62efd95a7e1..e9c3117805560ec28b658ba9bcd5d68d8665bde4 100644 (file)
@@ -13,6 +13,7 @@
 #include "greybus.h"
 
 struct gb_sdio_host {
+       struct gb_connection *connection;
        struct mmc_host *mmc;
        struct mmc_request *mrq;
        // FIXME - some lock?
@@ -45,13 +46,12 @@ static const struct mmc_host_ops gb_sd_ops = {
        .get_ro         = gb_sd_get_ro,
 };
 
-int gb_sdio_probe(struct gb_module *gmod,
-                 const struct greybus_module_id *id)
+static int gb_sdio_connection_init(struct gb_connection *connection)
 {
        struct mmc_host *mmc;
        struct gb_sdio_host *host;
 
-       mmc = mmc_alloc_host(sizeof(struct gb_sdio_host), &gmod->dev);
+       mmc = mmc_alloc_host(sizeof(struct gb_sdio_host), &connection->dev);
        if (!mmc)
                return -ENOMEM;
 
@@ -60,36 +60,29 @@ int gb_sdio_probe(struct gb_module *gmod,
 
        mmc->ops = &gb_sd_ops;
        // FIXME - set up size limits we can handle.
+       // FIXME - register the host controller.
 
-       // gmod->gb_sdio_host = host;
+       host->connection = connection;
+       connection->private = host;
        return 0;
 }
 
-void gb_sdio_disconnect(struct gb_module *gmod)
+static void gb_sdio_connection_exit(struct gb_connection *connection)
 {
-#if 0
        struct mmc_host *mmc;
        struct gb_sdio_host *host;
 
-       host = gmod->gb_sdio_host;
+       host = connection->private;
        if (!host)
                return;
 
        mmc = host->mmc;
        mmc_remove_host(mmc);
        mmc_free_host(mmc);
-#endif
+       connection->private = NULL;
 }
 
-#if 0
-static struct greybus_driver sd_gb_driver = {
-       .probe =        gb_sdio_probe,
-       .disconnect =   gb_sdio_disconnect,
-       .id_table =     id_table,
+struct gb_connection_handler gb_sdio_connection_handler = {
+       .connection_init        = gb_sdio_connection_init,
+       .connection_exit        = gb_sdio_connection_exit,
 };
-
-module_greybus_driver(sd_gb_driver);
-MODULE_LICENSE("GPL");
-MODULE_DESCRIPTION("Greybus SD/MMC Host driver");
-MODULE_AUTHOR("Greg Kroah-Hartman <gregkh@linuxfoundation.org>");
-#endif