Skip to content

Commit a771e36

Browse files
author
Samuel Ortiz
committed
mfd: Use mfd cell platform_data for ab3100 cells platform bits
With the addition of a platform device mfd_cell pointer, MFD drivers can go back to passing platform data back to their sub drivers. This allows for an mfd_cell->mfd_data removal and thus keep the sub drivers MFD agnostic. This is mostly needed for non MFD aware sub drivers. Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
1 parent 1f235a3 commit a771e36

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎drivers/mfd/ab3100-core.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -949,8 +949,10 @@ static int __devinit ab3100_probe(struct i2c_client *client,
949949
goto exit_no_ops;
950950

951951
/* Set up and register the platform devices. */
952-
for (i = 0; i < ARRAY_SIZE(ab3100_devs); i++)
953-
ab3100_devs[i].mfd_data = ab3100_plf_data;
952+
for (i = 0; i < ARRAY_SIZE(ab3100_devs); i++) {
953+
ab3100_devs[i].platform_data = ab3100_plf_data;
954+
ab3100_devs[i].pdata_size = sizeof(struct ab3100_platform_data);
955+
}
954956

955957
err = mfd_add_devices(&client->dev, 0, ab3100_devs,
956958
ARRAY_SIZE(ab3100_devs), NULL, 0);

‎drivers/regulator/ab3100.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include <linux/platform_device.h>
1818
#include <linux/regulator/driver.h>
1919
#include <linux/mfd/abx500.h>
20-
#include <linux/mfd/core.h>
2120

2221
/* LDO registers and some handy masking definitions for AB3100 */
2322
#define AB3100_LDO_A 0x40
@@ -582,7 +581,7 @@ ab3100_regulator_desc[AB3100_NUM_REGULATORS] = {
582581

583582
static int __devinit ab3100_regulators_probe(struct platform_device *pdev)
584583
{
585-
struct ab3100_platform_data *plfdata = mfd_get_data(pdev);
584+
struct ab3100_platform_data *plfdata = pdev->dev.platform_data;
586585
int err = 0;
587586
u8 data;
588587
int i;

0 commit comments

Comments
 (0)