diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2011-05-27 11:48:14 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2011-07-20 17:20:47 -0400 |
commit | 38576af1f8cad48446df47dcf404b197c9206dba (patch) | |
tree | 2e35c4fe4588b95febfb4430bbf784b5634b216d /drivers/mmc/host/sdhci-of-hlwd.c | |
parent | e307148fd4f971cecfaebb516ee28e164948a24b (diff) |
mmc: sdhci: make sdhci-of device drivers self registered
The patch turns the sdhci-of-core common stuff into helper functions
added into sdhci-pltfm.c, and makes sdhci-of device drviers self
registered using the same pair of .probe and .remove used by
sdhci-pltfm device drivers.
As a result, sdhci-of-core.c and sdhci-of.h can be eliminated with
those common things merged into sdhci-pltfm.c and sdhci-pltfm.h
respectively.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Reviewed-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/sdhci-of-hlwd.c')
-rw-r--r-- | drivers/mmc/host/sdhci-of-hlwd.c | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/drivers/mmc/host/sdhci-of-hlwd.c b/drivers/mmc/host/sdhci-of-hlwd.c index 380e896864b5..faedfcec7760 100644 --- a/drivers/mmc/host/sdhci-of-hlwd.c +++ b/drivers/mmc/host/sdhci-of-hlwd.c | |||
@@ -21,7 +21,7 @@ | |||
21 | 21 | ||
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | #include <linux/mmc/host.h> | 23 | #include <linux/mmc/host.h> |
24 | #include "sdhci-of.h" | 24 | #include "sdhci-pltfm.h" |
25 | #include "sdhci.h" | 25 | #include "sdhci.h" |
26 | 26 | ||
27 | /* | 27 | /* |
@@ -60,8 +60,54 @@ static struct sdhci_ops sdhci_hlwd_ops = { | |||
60 | .write_b = sdhci_hlwd_writeb, | 60 | .write_b = sdhci_hlwd_writeb, |
61 | }; | 61 | }; |
62 | 62 | ||
63 | struct sdhci_pltfm_data sdhci_hlwd_pdata = { | 63 | static struct sdhci_pltfm_data sdhci_hlwd_pdata = { |
64 | .quirks = SDHCI_QUIRK_32BIT_DMA_ADDR | | 64 | .quirks = SDHCI_QUIRK_32BIT_DMA_ADDR | |
65 | SDHCI_QUIRK_32BIT_DMA_SIZE, | 65 | SDHCI_QUIRK_32BIT_DMA_SIZE, |
66 | .ops = &sdhci_hlwd_ops, | 66 | .ops = &sdhci_hlwd_ops, |
67 | }; | 67 | }; |
68 | |||
69 | static int __devinit sdhci_hlwd_probe(struct platform_device *pdev) | ||
70 | { | ||
71 | return sdhci_pltfm_register(pdev, &sdhci_hlwd_pdata); | ||
72 | } | ||
73 | |||
74 | static int __devexit sdhci_hlwd_remove(struct platform_device *pdev) | ||
75 | { | ||
76 | return sdhci_pltfm_unregister(pdev); | ||
77 | } | ||
78 | |||
79 | static const struct of_device_id sdhci_hlwd_of_match[] = { | ||
80 | { .compatible = "nintendo,hollywood-sdhci" }, | ||
81 | { } | ||
82 | }; | ||
83 | MODULE_DEVICE_TABLE(of, sdhci_hlwd_of_match); | ||
84 | |||
85 | static struct platform_driver sdhci_hlwd_driver = { | ||
86 | .driver = { | ||
87 | .name = "sdhci-hlwd", | ||
88 | .owner = THIS_MODULE, | ||
89 | .of_match_table = sdhci_hlwd_of_match, | ||
90 | }, | ||
91 | .probe = sdhci_hlwd_probe, | ||
92 | .remove = __devexit_p(sdhci_hlwd_remove), | ||
93 | #ifdef CONFIG_PM | ||
94 | .suspend = sdhci_pltfm_suspend, | ||
95 | .resume = sdhci_pltfm_resume, | ||
96 | #endif | ||
97 | }; | ||
98 | |||
99 | static int __init sdhci_hlwd_init(void) | ||
100 | { | ||
101 | return platform_driver_register(&sdhci_hlwd_driver); | ||
102 | } | ||
103 | module_init(sdhci_hlwd_init); | ||
104 | |||
105 | static void __exit sdhci_hlwd_exit(void) | ||
106 | { | ||
107 | platform_driver_unregister(&sdhci_hlwd_driver); | ||
108 | } | ||
109 | module_exit(sdhci_hlwd_exit); | ||
110 | |||
111 | MODULE_DESCRIPTION("Nintendo Wii SDHCI OF driver"); | ||
112 | MODULE_AUTHOR("The GameCube Linux Team, Albert Herranz"); | ||
113 | MODULE_LICENSE("GPL v2"); | ||