mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 05:34:13 +08:00
[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>
This commit is contained in:
parent
413b486e18
commit
4d0b653cdf
@ -136,17 +136,7 @@ static int mmc_bus_resume(struct device *dev)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct bus_type mmc_bus_type = {
|
static int mmc_bus_probe(struct device *dev)
|
||||||
.name = "mmc",
|
|
||||||
.dev_attrs = mmc_dev_attrs,
|
|
||||||
.match = mmc_bus_match,
|
|
||||||
.uevent = mmc_bus_uevent,
|
|
||||||
.suspend = mmc_bus_suspend,
|
|
||||||
.resume = mmc_bus_resume,
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
static int mmc_drv_probe(struct device *dev)
|
|
||||||
{
|
{
|
||||||
struct mmc_driver *drv = to_mmc_driver(dev->driver);
|
struct mmc_driver *drv = to_mmc_driver(dev->driver);
|
||||||
struct mmc_card *card = dev_to_mmc_card(dev);
|
struct mmc_card *card = dev_to_mmc_card(dev);
|
||||||
@ -154,7 +144,7 @@ static int mmc_drv_probe(struct device *dev)
|
|||||||
return drv->probe(card);
|
return drv->probe(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mmc_drv_remove(struct device *dev)
|
static int mmc_bus_remove(struct device *dev)
|
||||||
{
|
{
|
||||||
struct mmc_driver *drv = to_mmc_driver(dev->driver);
|
struct mmc_driver *drv = to_mmc_driver(dev->driver);
|
||||||
struct mmc_card *card = dev_to_mmc_card(dev);
|
struct mmc_card *card = dev_to_mmc_card(dev);
|
||||||
@ -164,6 +154,16 @@ static int mmc_drv_remove(struct device *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct bus_type mmc_bus_type = {
|
||||||
|
.name = "mmc",
|
||||||
|
.dev_attrs = mmc_dev_attrs,
|
||||||
|
.match = mmc_bus_match,
|
||||||
|
.uevent = mmc_bus_uevent,
|
||||||
|
.probe = mmc_bus_probe,
|
||||||
|
.remove = mmc_bus_remove,
|
||||||
|
.suspend = mmc_bus_suspend,
|
||||||
|
.resume = mmc_bus_resume,
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* mmc_register_driver - register a media driver
|
* mmc_register_driver - register a media driver
|
||||||
@ -172,8 +172,6 @@ static int mmc_drv_remove(struct device *dev)
|
|||||||
int mmc_register_driver(struct mmc_driver *drv)
|
int mmc_register_driver(struct mmc_driver *drv)
|
||||||
{
|
{
|
||||||
drv->drv.bus = &mmc_bus_type;
|
drv->drv.bus = &mmc_bus_type;
|
||||||
drv->drv.probe = mmc_drv_probe;
|
|
||||||
drv->drv.remove = mmc_drv_remove;
|
|
||||||
return driver_register(&drv->drv);
|
return driver_register(&drv->drv);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user