[PATCH v2 2/3] mfd: ab8500: Example using new OF_MFD_CELL MACRO

2018-04-16 Thread Lee Jones
... with and without platform ID.

Signed-off-by: Lee Jones 
Acked-by: Linus Walleij 
---
 drivers/mfd/ab8500-core.c | 138 ++
 1 file changed, 42 insertions(+), 96 deletions(-)

diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 30d09d177171..38b6b34165d1 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -610,107 +610,53 @@ int ab8500_suspend(struct ab8500 *ab8500)
 }
 
 static const struct mfd_cell ab8500_bm_devs[] = {
-   {
-   .name = "ab8500-charger",
-   .of_compatible = "stericsson,ab8500-charger",
-   .platform_data = _bm_data,
-   .pdata_size = sizeof(ab8500_bm_data),
-   },
-   {
-   .name = "ab8500-btemp",
-   .of_compatible = "stericsson,ab8500-btemp",
-   .platform_data = _bm_data,
-   .pdata_size = sizeof(ab8500_bm_data),
-   },
-   {
-   .name = "ab8500-fg",
-   .of_compatible = "stericsson,ab8500-fg",
-   .platform_data = _bm_data,
-   .pdata_size = sizeof(ab8500_bm_data),
-   },
-   {
-   .name = "ab8500-chargalg",
-   .of_compatible = "stericsson,ab8500-chargalg",
-   .platform_data = _bm_data,
-   .pdata_size = sizeof(ab8500_bm_data),
-   },
+   OF_MFD_CELL("ab8500-charger", NULL, _bm_data,
+   sizeof(ab8500_bm_data), 0, "stericsson,ab8500-charger"),
+   OF_MFD_CELL("ab8500-btemp", NULL, _bm_data,
+   sizeof(ab8500_bm_data), 0, "stericsson,ab8500-btemp"),
+   OF_MFD_CELL("ab8500-fg", NULL, _bm_data,
+   sizeof(ab8500_bm_data), 0, "stericsson,ab8500-fg"),
+   OF_MFD_CELL("ab8500-chargalg", NULL, _bm_data,
+   sizeof(ab8500_bm_data), 0, "stericsson,ab8500-chargalg"),
 };
 
 static const struct mfd_cell ab8500_devs[] = {
 #ifdef CONFIG_DEBUG_FS
-   {
-   .name = "ab8500-debug",
-   .of_compatible = "stericsson,ab8500-debug",
-   },
+   OF_MFD_CELL("ab8500-debug",
+   NULL, NULL, 0, 0, "stericsson,ab8500-debug"),
 #endif
-   {
-   .name = "ab8500-sysctrl",
-   .of_compatible = "stericsson,ab8500-sysctrl",
-   },
-   {
-   .name = "ab8500-ext-regulator",
-   .of_compatible = "stericsson,ab8500-ext-regulator",
-   },
-   {
-   .name = "ab8500-regulator",
-   .of_compatible = "stericsson,ab8500-regulator",
-   },
-   {
-   .name = "ab8500-clk",
-   .of_compatible = "stericsson,ab8500-clk",
-   },
-   {
-   .name = "ab8500-gpadc",
-   .of_compatible = "stericsson,ab8500-gpadc",
-   },
-   {
-   .name = "ab8500-rtc",
-   .of_compatible = "stericsson,ab8500-rtc",
-   },
-   {
-   .name = "ab8500-acc-det",
-   .of_compatible = "stericsson,ab8500-acc-det",
-   },
-   {
-
-   .name = "ab8500-poweron-key",
-   .of_compatible = "stericsson,ab8500-poweron-key",
-   },
-   {
-   .name = "ab8500-pwm",
-   .of_compatible = "stericsson,ab8500-pwm",
-   .id = 1,
-   },
-   {
-   .name = "ab8500-pwm",
-   .of_compatible = "stericsson,ab8500-pwm",
-   .id = 2,
-   },
-   {
-   .name = "ab8500-pwm",
-   .of_compatible = "stericsson,ab8500-pwm",
-   .id = 3,
-   },
-   {
-   .name = "ab8500-denc",
-   .of_compatible = "stericsson,ab8500-denc",
-   },
-   {
-   .name = "pinctrl-ab8500",
-   .of_compatible = "stericsson,ab8500-gpio",
-   },
-   {
-   .name = "abx500-temp",
-   .of_compatible = "stericsson,abx500-temp",
-   },
-   {
-   .name = "ab8500-usb",
-   .of_compatible = "stericsson,ab8500-usb",
-   },
-   {
-   .name = "ab8500-codec",
-   .of_compatible = "stericsson,ab8500-codec",
-   },
+   OF_MFD_CELL("ab8500-sysctrl",
+   NULL, NULL, 0, 0, "stericsson,ab8500-sysctrl"),
+   OF_MFD_CELL("ab8500-ext-regulator",
+   NULL, NULL, 0, 0, "stericsson,ab8500-ext-regulator"),
+   OF_MFD_CELL("ab8500-regulator",
+   NULL, NULL, 0, 0, "stericsson,ab8500-regulator"),
+   OF_MFD_CELL("abx500-clk",
+   NULL, NULL, 0, 0, "stericsson,abx500-clk"),
+   OF_MFD_CELL("ab8500-gpadc",
+   NULL, NULL, 0, 0, "stericsson,ab8500-gpadc"),
+   OF_MFD_CELL("ab8500-rtc",
+   NULL, NULL, 0, 0, "stericsson,ab8500-rtc"),
+   OF_MFD_CELL("ab8500-acc-det",
+   NULL, NULL, 0, 0, 

[PATCH v2 2/3] mfd: ab8500: Example using new OF_MFD_CELL MACRO

2018-04-16 Thread Lee Jones
... with and without platform ID.

Signed-off-by: Lee Jones 
Acked-by: Linus Walleij 
---
 drivers/mfd/ab8500-core.c | 138 ++
 1 file changed, 42 insertions(+), 96 deletions(-)

diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
index 30d09d177171..38b6b34165d1 100644
--- a/drivers/mfd/ab8500-core.c
+++ b/drivers/mfd/ab8500-core.c
@@ -610,107 +610,53 @@ int ab8500_suspend(struct ab8500 *ab8500)
 }
 
 static const struct mfd_cell ab8500_bm_devs[] = {
-   {
-   .name = "ab8500-charger",
-   .of_compatible = "stericsson,ab8500-charger",
-   .platform_data = _bm_data,
-   .pdata_size = sizeof(ab8500_bm_data),
-   },
-   {
-   .name = "ab8500-btemp",
-   .of_compatible = "stericsson,ab8500-btemp",
-   .platform_data = _bm_data,
-   .pdata_size = sizeof(ab8500_bm_data),
-   },
-   {
-   .name = "ab8500-fg",
-   .of_compatible = "stericsson,ab8500-fg",
-   .platform_data = _bm_data,
-   .pdata_size = sizeof(ab8500_bm_data),
-   },
-   {
-   .name = "ab8500-chargalg",
-   .of_compatible = "stericsson,ab8500-chargalg",
-   .platform_data = _bm_data,
-   .pdata_size = sizeof(ab8500_bm_data),
-   },
+   OF_MFD_CELL("ab8500-charger", NULL, _bm_data,
+   sizeof(ab8500_bm_data), 0, "stericsson,ab8500-charger"),
+   OF_MFD_CELL("ab8500-btemp", NULL, _bm_data,
+   sizeof(ab8500_bm_data), 0, "stericsson,ab8500-btemp"),
+   OF_MFD_CELL("ab8500-fg", NULL, _bm_data,
+   sizeof(ab8500_bm_data), 0, "stericsson,ab8500-fg"),
+   OF_MFD_CELL("ab8500-chargalg", NULL, _bm_data,
+   sizeof(ab8500_bm_data), 0, "stericsson,ab8500-chargalg"),
 };
 
 static const struct mfd_cell ab8500_devs[] = {
 #ifdef CONFIG_DEBUG_FS
-   {
-   .name = "ab8500-debug",
-   .of_compatible = "stericsson,ab8500-debug",
-   },
+   OF_MFD_CELL("ab8500-debug",
+   NULL, NULL, 0, 0, "stericsson,ab8500-debug"),
 #endif
-   {
-   .name = "ab8500-sysctrl",
-   .of_compatible = "stericsson,ab8500-sysctrl",
-   },
-   {
-   .name = "ab8500-ext-regulator",
-   .of_compatible = "stericsson,ab8500-ext-regulator",
-   },
-   {
-   .name = "ab8500-regulator",
-   .of_compatible = "stericsson,ab8500-regulator",
-   },
-   {
-   .name = "ab8500-clk",
-   .of_compatible = "stericsson,ab8500-clk",
-   },
-   {
-   .name = "ab8500-gpadc",
-   .of_compatible = "stericsson,ab8500-gpadc",
-   },
-   {
-   .name = "ab8500-rtc",
-   .of_compatible = "stericsson,ab8500-rtc",
-   },
-   {
-   .name = "ab8500-acc-det",
-   .of_compatible = "stericsson,ab8500-acc-det",
-   },
-   {
-
-   .name = "ab8500-poweron-key",
-   .of_compatible = "stericsson,ab8500-poweron-key",
-   },
-   {
-   .name = "ab8500-pwm",
-   .of_compatible = "stericsson,ab8500-pwm",
-   .id = 1,
-   },
-   {
-   .name = "ab8500-pwm",
-   .of_compatible = "stericsson,ab8500-pwm",
-   .id = 2,
-   },
-   {
-   .name = "ab8500-pwm",
-   .of_compatible = "stericsson,ab8500-pwm",
-   .id = 3,
-   },
-   {
-   .name = "ab8500-denc",
-   .of_compatible = "stericsson,ab8500-denc",
-   },
-   {
-   .name = "pinctrl-ab8500",
-   .of_compatible = "stericsson,ab8500-gpio",
-   },
-   {
-   .name = "abx500-temp",
-   .of_compatible = "stericsson,abx500-temp",
-   },
-   {
-   .name = "ab8500-usb",
-   .of_compatible = "stericsson,ab8500-usb",
-   },
-   {
-   .name = "ab8500-codec",
-   .of_compatible = "stericsson,ab8500-codec",
-   },
+   OF_MFD_CELL("ab8500-sysctrl",
+   NULL, NULL, 0, 0, "stericsson,ab8500-sysctrl"),
+   OF_MFD_CELL("ab8500-ext-regulator",
+   NULL, NULL, 0, 0, "stericsson,ab8500-ext-regulator"),
+   OF_MFD_CELL("ab8500-regulator",
+   NULL, NULL, 0, 0, "stericsson,ab8500-regulator"),
+   OF_MFD_CELL("abx500-clk",
+   NULL, NULL, 0, 0, "stericsson,abx500-clk"),
+   OF_MFD_CELL("ab8500-gpadc",
+   NULL, NULL, 0, 0, "stericsson,ab8500-gpadc"),
+   OF_MFD_CELL("ab8500-rtc",
+   NULL, NULL, 0, 0, "stericsson,ab8500-rtc"),
+   OF_MFD_CELL("ab8500-acc-det",
+   NULL, NULL, 0, 0, "stericsson,ab8500-acc-det"),
+