aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2006-01-05 09:40:27 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-13 14:26:08 -0500
commit4d0b653cdfde193944784c01fa3359b0a444dcf1 (patch)
treed3f359a72bd4df788277c2bf518809ff184be058 /drivers/mmc
parent413b486e18587fd53c9954252e6648f9450c734e (diff)
[PATCH] Add mmc_bus_type probe and remove methods
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/mmc_sysfs.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/mmc/mmc_sysfs.c b/drivers/mmc/mmc_sysfs.c
index ec701667abfc..a2a35fd946ee 100644
--- a/drivers/mmc/mmc_sysfs.c
+++ b/drivers/mmc/mmc_sysfs.c
@@ -136,17 +136,7 @@ static int mmc_bus_resume(struct device *dev)
136 return ret; 136 return ret;
137} 137}
138 138
139static struct bus_type mmc_bus_type = { 139static int mmc_bus_probe(struct device *dev)
140 .name = "mmc",
141 .dev_attrs = mmc_dev_attrs,
142 .match = mmc_bus_match,
143 .uevent = mmc_bus_uevent,
144 .suspend = mmc_bus_suspend,
145 .resume = mmc_bus_resume,
146};
147
148
149static int mmc_drv_probe(struct device *dev)
150{ 140{
151 struct mmc_driver *drv = to_mmc_driver(dev->driver); 141 struct mmc_driver *drv = to_mmc_driver(dev->driver);
152 struct mmc_card *card = dev_to_mmc_card(dev); 142 struct mmc_card *card = dev_to_mmc_card(dev);
@@ -154,7 +144,7 @@ static int mmc_drv_probe(struct device *dev)
154 return drv->probe(card); 144 return drv->probe(card);
155} 145}
156 146
157static int mmc_drv_remove(struct device *dev) 147static int mmc_bus_remove(struct device *dev)
158{ 148{
159 struct mmc_driver *drv = to_mmc_driver(dev->driver); 149 struct mmc_driver *drv = to_mmc_driver(dev->driver);
160 struct mmc_card *card = dev_to_mmc_card(dev); 150 struct mmc_card *card = dev_to_mmc_card(dev);
@@ -164,6 +154,16 @@ static int mmc_drv_remove(struct device *dev)
164 return 0; 154 return 0;
165} 155}
166 156
157static struct bus_type mmc_bus_type = {
158 .name = "mmc",
159 .dev_attrs = mmc_dev_attrs,
160 .match = mmc_bus_match,
161 .uevent = mmc_bus_uevent,
162 .probe = mmc_bus_probe,
163 .remove = mmc_bus_remove,
164 .suspend = mmc_bus_suspend,
165 .resume = mmc_bus_resume,
166};
167 167
168/** 168/**
169 * mmc_register_driver - register a media driver 169 * mmc_register_driver - register a media driver
@@ -172,8 +172,6 @@ static int mmc_drv_remove(struct device *dev)
172int mmc_register_driver(struct mmc_driver *drv) 172int mmc_register_driver(struct mmc_driver *drv)
173{ 173{
174 drv->drv.bus = &mmc_bus_type; 174 drv->drv.bus = &mmc_bus_type;
175 drv->drv.probe = mmc_drv_probe;
176 drv->drv.remove = mmc_drv_remove;
177 return driver_register(&drv->drv); 175 return driver_register(&drv->drv);
178} 176}
179 177