Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f76c85154d320497bf1a939a98d6c432edcbd4a9
Commit:     f76c85154d320497bf1a939a98d6c432edcbd4a9
Parent:     e29a7d73f4277eb92aa64e17017dea33460828ef
Author:     Pierre Ossman <[EMAIL PROTECTED]>
AuthorDate: Sun May 27 12:00:02 2007 +0200
Committer:  Pierre Ossman <[EMAIL PROTECTED]>
CommitDate: Sun Sep 23 19:55:26 2007 +0200

    mmc: add SDIO driver handling
    
    Add basic driver handling to the SDIO device model.
    
    Signed-off-by: Pierre Ossman <[EMAIL PROTECTED]>
---
 drivers/mmc/core/sdio_bus.c   |   23 +++++++++++++++++++++++
 include/linux/mmc/sdio_func.h |   18 ++++++++++++++++++
 2 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c
index 59c909e..fa488ce 100644
--- a/drivers/mmc/core/sdio_bus.c
+++ b/drivers/mmc/core/sdio_bus.c
@@ -67,6 +67,29 @@ void sdio_unregister_bus(void)
        bus_unregister(&sdio_bus_type);
 }
 
+/**
+ *     sdio_register_driver - register a function driver
+ *     @drv: SDIO function driver
+ */
+int sdio_register_driver(struct sdio_driver *drv)
+{
+       drv->drv.name = drv->name;
+       drv->drv.bus = &sdio_bus_type;
+       return driver_register(&drv->drv);
+}
+EXPORT_SYMBOL_GPL(sdio_register_driver);
+
+/**
+ *     sdio_unregister_driver - unregister a function driver
+ *     @drv: SDIO function driver
+ */
+void sdio_unregister_driver(struct sdio_driver *drv)
+{
+       drv->drv.bus = &sdio_bus_type;
+       driver_unregister(&drv->drv);
+}
+EXPORT_SYMBOL_GPL(sdio_unregister_driver);
+
 static void sdio_release_func(struct device *dev)
 {
        struct sdio_func *func = dev_to_sdio_func(dev);
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h
index 50c78db..13a1a9c 100644
--- a/include/linux/mmc/sdio_func.h
+++ b/include/linux/mmc/sdio_func.h
@@ -31,5 +31,23 @@ struct sdio_func {
 
 #define sdio_func_id(f)                ((f)->dev.bus_id)
 
+#define sdio_get_drvdata(f)    dev_get_drvdata(&(f)->dev)
+#define sdio_set_drvdata(f,d)  dev_set_drvdata(&(f)->dev, d)
+
+/*
+ * SDIO function device driver
+ */
+struct sdio_driver {
+       char *name;
+
+       int (*probe)(struct sdio_func *);
+       void (*remove)(struct sdio_func *);
+
+       struct device_driver drv;
+};
+
+extern int sdio_register_driver(struct sdio_driver *);
+extern void sdio_unregister_driver(struct sdio_driver *);
+
 #endif
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to