diff options
author | Pierre Ossman <drzeus@drzeus.cx> | 2007-05-26 07:48:18 -0400 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2007-09-23 13:45:31 -0400 |
commit | e29a7d73f4277eb92aa64e17017dea33460828ef (patch) | |
tree | 0b8cfe6d145f41c43f86b475fff86627a305af1e /drivers/mmc/core/core.c | |
parent | b2bcc798bbb482b2909801280f3c4aff8cbbf5be (diff) |
mmc: basic SDIO device model
Add the sdio bus type and basic device handling.
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc/core/core.c')
-rw-r--r-- | drivers/mmc/core/core.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c index 092fa906ab8..9747455928d 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include "core.h" | 29 | #include "core.h" |
30 | #include "bus.h" | 30 | #include "bus.h" |
31 | #include "host.h" | 31 | #include "host.h" |
32 | #include "sdio_bus.h" | ||
32 | 33 | ||
33 | #include "mmc_ops.h" | 34 | #include "mmc_ops.h" |
34 | #include "sd_ops.h" | 35 | #include "sd_ops.h" |
@@ -739,16 +740,32 @@ static int __init mmc_init(void) | |||
739 | return -ENOMEM; | 740 | return -ENOMEM; |
740 | 741 | ||
741 | ret = mmc_register_bus(); | 742 | ret = mmc_register_bus(); |
742 | if (ret == 0) { | 743 | if (ret) |
743 | ret = mmc_register_host_class(); | 744 | goto destroy_workqueue; |
744 | if (ret) | 745 | |
745 | mmc_unregister_bus(); | 746 | ret = mmc_register_host_class(); |
746 | } | 747 | if (ret) |
748 | goto unregister_bus; | ||
749 | |||
750 | ret = sdio_register_bus(); | ||
751 | if (ret) | ||
752 | goto unregister_host_class; | ||
753 | |||
754 | return 0; | ||
755 | |||
756 | unregister_host_class: | ||
757 | mmc_unregister_host_class(); | ||
758 | unregister_bus: | ||
759 | mmc_unregister_bus(); | ||
760 | destroy_workqueue: | ||
761 | destroy_workqueue(workqueue); | ||
762 | |||
747 | return ret; | 763 | return ret; |
748 | } | 764 | } |
749 | 765 | ||
750 | static void __exit mmc_exit(void) | 766 | static void __exit mmc_exit(void) |
751 | { | 767 | { |
768 | sdio_unregister_bus(); | ||
752 | mmc_unregister_host_class(); | 769 | mmc_unregister_host_class(); |
753 | mmc_unregister_bus(); | 770 | mmc_unregister_bus(); |
754 | destroy_workqueue(workqueue); | 771 | destroy_workqueue(workqueue); |