summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card/block.c
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2014-10-06 13:51:40 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2014-11-10 12:40:33 +0100
commit6685ac62b2f08fcff77dc35c6b8bff1b74aaa408 (patch)
tree8fb75914fa7c3bea075f659b1f40524317e47a0c /drivers/mmc/card/block.c
parent0967edc6ef5c3c181cabde3178ea9f33e5130e4a (diff)
downloadblackbird-op-linux-6685ac62b2f08fcff77dc35c6b8bff1b74aaa408.tar.gz
blackbird-op-linux-6685ac62b2f08fcff77dc35c6b8bff1b74aaa408.zip
mmc: core: Convert mmc_driver to device_driver
The struct mmc_driver adds an extra layer on top of the struct device_driver. That would be fine, if there were a good reason, but that's not the case. Let's simplify code by converting to the common struct device_driver instead and thus also removing superfluous overhead. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/card/block.c')
-rw-r--r--drivers/mmc/card/block.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index dfbdfb995dd3..70569d9b5c74 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -2425,8 +2425,9 @@ static const struct mmc_fixup blk_fixups[] =
END_FIXUP
};
-static int mmc_blk_probe(struct mmc_card *card)
+static int mmc_blk_probe(struct device *dev)
{
+ struct mmc_card *card = mmc_dev_to_card(dev);
struct mmc_blk_data *md, *part_md;
char cap_str[10];
@@ -2481,8 +2482,9 @@ static int mmc_blk_probe(struct mmc_card *card)
return 0;
}
-static void mmc_blk_remove(struct mmc_card *card)
+static int mmc_blk_remove(struct device *dev)
{
+ struct mmc_card *card = mmc_dev_to_card(dev);
struct mmc_blk_data *md = mmc_get_drvdata(card);
mmc_blk_remove_parts(card, md);
@@ -2495,11 +2497,14 @@ static void mmc_blk_remove(struct mmc_card *card)
pm_runtime_put_noidle(&card->dev);
mmc_blk_remove_req(md);
mmc_set_drvdata(card, NULL);
+
+ return 0;
}
-static int _mmc_blk_suspend(struct mmc_card *card)
+static int _mmc_blk_suspend(struct device *dev)
{
struct mmc_blk_data *part_md;
+ struct mmc_card *card = mmc_dev_to_card(dev);
struct mmc_blk_data *md = mmc_get_drvdata(card);
if (md) {
@@ -2511,16 +2516,15 @@ static int _mmc_blk_suspend(struct mmc_card *card)
return 0;
}
-static void mmc_blk_shutdown(struct mmc_card *card)
+static void mmc_blk_shutdown(struct device *dev)
{
- _mmc_blk_suspend(card);
+ _mmc_blk_suspend(dev);
}
#ifdef CONFIG_PM_SLEEP
static int mmc_blk_suspend(struct device *dev)
{
- struct mmc_card *card = mmc_dev_to_card(dev);
- return _mmc_blk_suspend(card);
+ return _mmc_blk_suspend(dev);
}
static int mmc_blk_resume(struct device *dev)
@@ -2546,11 +2550,9 @@ static int mmc_blk_resume(struct device *dev)
static SIMPLE_DEV_PM_OPS(mmc_blk_pm_ops, mmc_blk_suspend, mmc_blk_resume);
-static struct mmc_driver mmc_driver = {
- .drv = {
- .name = "mmcblk",
- .pm = &mmc_blk_pm_ops,
- },
+static struct device_driver mmc_driver = {
+ .name = "mmcblk",
+ .pm = &mmc_blk_pm_ops,
.probe = mmc_blk_probe,
.remove = mmc_blk_remove,
.shutdown = mmc_blk_shutdown,
OpenPOWER on IntegriCloud