Commit a2f4763f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

greybus: sdio-gb: convert to the connection interface.

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: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 5e8e8ff6
......@@ -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);
......
......@@ -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
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