aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2011-04-06 05:41:03 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2011-05-26 13:45:00 -0400
commit121ea573aeb7e9b1d79effa8ef7970031aebda12 (patch)
treecbde4018e74e37fb4697ae5a9f1eb0a0096fae8b
parentec71974f2a3ae052cdbb57a92ce3c3b34ebd7b5d (diff)
w1: Use device platform_data to retrieve ds1wm platform bits
With the addition of the platform device mfd_cell pointer, we can now cleanly pass the sub device drivers platform data pointers through the regular device platform_data one, and get rid of mfd_get_data(). Cc: Matt Reimer <mreimer@vpop.net> Cc: Philipp Zabel <philipp.zabel@gmail.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
-rw-r--r--drivers/mfd/asic3.c3
-rw-r--r--drivers/mfd/htc-pasic3.c3
-rw-r--r--drivers/w1/masters/ds1wm.c12
3 files changed, 14 insertions, 4 deletions
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c
index a26280240bb9..77a3971e00bd 100644
--- a/drivers/mfd/asic3.c
+++ b/drivers/mfd/asic3.c
@@ -676,7 +676,8 @@ static struct mfd_cell asic3_cell_ds1wm = {
676 .name = "ds1wm", 676 .name = "ds1wm",
677 .enable = ds1wm_enable, 677 .enable = ds1wm_enable,
678 .disable = ds1wm_disable, 678 .disable = ds1wm_disable,
679 .mfd_data = &ds1wm_pdata, 679 .platform_data = &ds1wm_pdata,
680 .pdata_size = sizeof(ds1wm_pdata),
680 .num_resources = ARRAY_SIZE(ds1wm_resources), 681 .num_resources = ARRAY_SIZE(ds1wm_resources),
681 .resources = ds1wm_resources, 682 .resources = ds1wm_resources,
682}; 683};
diff --git a/drivers/mfd/htc-pasic3.c b/drivers/mfd/htc-pasic3.c
index fb9770b39a32..95a4ff48b282 100644
--- a/drivers/mfd/htc-pasic3.c
+++ b/drivers/mfd/htc-pasic3.c
@@ -117,7 +117,8 @@ static struct mfd_cell ds1wm_cell __initdata = {
117 .name = "ds1wm", 117 .name = "ds1wm",
118 .enable = ds1wm_enable, 118 .enable = ds1wm_enable,
119 .disable = ds1wm_disable, 119 .disable = ds1wm_disable,
120 .mfd_data = &ds1wm_pdata, 120 .platform_data = &ds1wm_pdata,
121 .pdata_size = sizeof(ds1wm_pdata),
121 .num_resources = 2, 122 .num_resources = 2,
122 .resources = ds1wm_resources, 123 .resources = ds1wm_resources,
123}; 124};
diff --git a/drivers/w1/masters/ds1wm.c b/drivers/w1/masters/ds1wm.c
index 2f4fa02744a5..0855d6cce3c1 100644
--- a/drivers/w1/masters/ds1wm.c
+++ b/drivers/w1/masters/ds1wm.c
@@ -216,7 +216,7 @@ static int ds1wm_find_divisor(int gclk)
216static void ds1wm_up(struct ds1wm_data *ds1wm_data) 216static void ds1wm_up(struct ds1wm_data *ds1wm_data)
217{ 217{
218 int divisor; 218 int divisor;
219 struct ds1wm_driver_data *plat = mfd_get_data(ds1wm_data->pdev); 219 struct ds1wm_driver_data *plat = ds1wm_data->pdev->dev.platform_data;
220 220
221 if (ds1wm_data->cell->enable) 221 if (ds1wm_data->cell->enable)
222 ds1wm_data->cell->enable(ds1wm_data->pdev); 222 ds1wm_data->cell->enable(ds1wm_data->pdev);
@@ -351,13 +351,21 @@ static int ds1wm_probe(struct platform_device *pdev)
351 ret = -ENOMEM; 351 ret = -ENOMEM;
352 goto err0; 352 goto err0;
353 } 353 }
354 plat = mfd_get_data(pdev);
355 354
356 /* calculate bus shift from mem resource */ 355 /* calculate bus shift from mem resource */
357 ds1wm_data->bus_shift = resource_size(res) >> 3; 356 ds1wm_data->bus_shift = resource_size(res) >> 3;
358 357
359 ds1wm_data->pdev = pdev; 358 ds1wm_data->pdev = pdev;
360 ds1wm_data->cell = mfd_get_cell(pdev); 359 ds1wm_data->cell = mfd_get_cell(pdev);
360 if (!ds1wm_data->cell) {
361 ret = -ENODEV;
362 goto err1;
363 }
364 plat = pdev->dev.platform_data;
365 if (!plat) {
366 ret = -ENODEV;
367 goto err1;
368 }
361 369
362 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); 370 res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
363 if (!res) { 371 if (!res) {