aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2014-10-06 08:34:09 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2014-11-10 06:40:34 -0500
commitfc95e30ba33b9f4faa8630d0762af2548031dc00 (patch)
tree3d4c977a50b22c7604a65615d7ca89bf5a43345e /drivers/mmc/card
parenteaaceb6cbf7ef6f480b3f80468beb21eafe82ac0 (diff)
mmc: block: Use dev_set|get_drvdata()
In most of the cases mmc_get|set_drvdata() didn't simplify code, which should be the primary reason for such macros. Let's remove them and convert to the common device_driver macros, dev_set|get_drvdata() instead. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/card')
-rw-r--r--drivers/mmc/card/block.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 70569d9b5c74..f45f7e3870be 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -112,7 +112,7 @@ struct mmc_blk_data {
112 112
113 /* 113 /*
114 * Only set in main mmc_blk_data associated 114 * Only set in main mmc_blk_data associated
115 * with mmc_card with mmc_set_drvdata, and keeps 115 * with mmc_card with dev_set_drvdata, and keeps
116 * track of the current selected device partition. 116 * track of the current selected device partition.
117 */ 117 */
118 unsigned int part_curr; 118 unsigned int part_curr;
@@ -642,7 +642,7 @@ static inline int mmc_blk_part_switch(struct mmc_card *card,
642 struct mmc_blk_data *md) 642 struct mmc_blk_data *md)
643{ 643{
644 int ret; 644 int ret;
645 struct mmc_blk_data *main_md = mmc_get_drvdata(card); 645 struct mmc_blk_data *main_md = dev_get_drvdata(&card->dev);
646 646
647 if (main_md->part_curr == md->part_type) 647 if (main_md->part_curr == md->part_type)
648 return 0; 648 return 0;
@@ -1004,7 +1004,8 @@ static int mmc_blk_reset(struct mmc_blk_data *md, struct mmc_host *host,
1004 err = mmc_hw_reset(host); 1004 err = mmc_hw_reset(host);
1005 /* Ensure we switch back to the correct partition */ 1005 /* Ensure we switch back to the correct partition */
1006 if (err != -EOPNOTSUPP) { 1006 if (err != -EOPNOTSUPP) {
1007 struct mmc_blk_data *main_md = mmc_get_drvdata(host->card); 1007 struct mmc_blk_data *main_md =
1008 dev_get_drvdata(&host->card->dev);
1008 int part_err; 1009 int part_err;
1009 1010
1010 main_md->part_curr = main_md->part_type; 1011 main_md->part_curr = main_md->part_type;
@@ -2093,7 +2094,7 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
2093 2094
2094 /* 2095 /*
2095 * !subname implies we are creating main mmc_blk_data that will be 2096 * !subname implies we are creating main mmc_blk_data that will be
2096 * associated with mmc_card with mmc_set_drvdata. Due to device 2097 * associated with mmc_card with dev_set_drvdata. Due to device
2097 * partitions, devidx will not coincide with a per-physical card 2098 * partitions, devidx will not coincide with a per-physical card
2098 * index anymore so we keep track of a name index. 2099 * index anymore so we keep track of a name index.
2099 */ 2100 */
@@ -2452,7 +2453,7 @@ static int mmc_blk_probe(struct device *dev)
2452 if (mmc_blk_alloc_parts(card, md)) 2453 if (mmc_blk_alloc_parts(card, md))
2453 goto out; 2454 goto out;
2454 2455
2455 mmc_set_drvdata(card, md); 2456 dev_set_drvdata(dev, md);
2456 2457
2457 if (mmc_add_disk(md)) 2458 if (mmc_add_disk(md))
2458 goto out; 2459 goto out;
@@ -2485,7 +2486,7 @@ static int mmc_blk_probe(struct device *dev)
2485static int mmc_blk_remove(struct device *dev) 2486static int mmc_blk_remove(struct device *dev)
2486{ 2487{
2487 struct mmc_card *card = mmc_dev_to_card(dev); 2488 struct mmc_card *card = mmc_dev_to_card(dev);
2488 struct mmc_blk_data *md = mmc_get_drvdata(card); 2489 struct mmc_blk_data *md = dev_get_drvdata(dev);
2489 2490
2490 mmc_blk_remove_parts(card, md); 2491 mmc_blk_remove_parts(card, md);
2491 pm_runtime_get_sync(&card->dev); 2492 pm_runtime_get_sync(&card->dev);
@@ -2496,7 +2497,7 @@ static int mmc_blk_remove(struct device *dev)
2496 pm_runtime_disable(&card->dev); 2497 pm_runtime_disable(&card->dev);
2497 pm_runtime_put_noidle(&card->dev); 2498 pm_runtime_put_noidle(&card->dev);
2498 mmc_blk_remove_req(md); 2499 mmc_blk_remove_req(md);
2499 mmc_set_drvdata(card, NULL); 2500 dev_set_drvdata(dev, NULL);
2500 2501
2501 return 0; 2502 return 0;
2502} 2503}
@@ -2504,8 +2505,7 @@ static int mmc_blk_remove(struct device *dev)
2504static int _mmc_blk_suspend(struct device *dev) 2505static int _mmc_blk_suspend(struct device *dev)
2505{ 2506{
2506 struct mmc_blk_data *part_md; 2507 struct mmc_blk_data *part_md;
2507 struct mmc_card *card = mmc_dev_to_card(dev); 2508 struct mmc_blk_data *md = dev_get_drvdata(dev);
2508 struct mmc_blk_data *md = mmc_get_drvdata(card);
2509 2509
2510 if (md) { 2510 if (md) {
2511 mmc_queue_suspend(&md->queue); 2511 mmc_queue_suspend(&md->queue);
@@ -2530,8 +2530,7 @@ static int mmc_blk_suspend(struct device *dev)
2530static int mmc_blk_resume(struct device *dev) 2530static int mmc_blk_resume(struct device *dev)
2531{ 2531{
2532 struct mmc_blk_data *part_md; 2532 struct mmc_blk_data *part_md;
2533 struct mmc_card *card = mmc_dev_to_card(dev); 2533 struct mmc_blk_data *md = dev_get_drvdata(dev);
2534 struct mmc_blk_data *md = mmc_get_drvdata(card);
2535 2534
2536 if (md) { 2535 if (md) {
2537 /* 2536 /*