aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorAndres Salomon <dilinger@queued.net>2011-02-17 22:07:23 -0500
committerSamuel Ortiz <sameo@linux.intel.com>2011-03-23 05:41:54 -0400
commit4ec1b54c4d082d4bad19b55ca709da7e7138d542 (patch)
treec17db1ae92212ed1269d66965a0eaba583f1cd21 /drivers/mfd
parent8615e4cba1d3a0f15b9a4da9f32f8fbc3488fa54 (diff)
mfd: mfd_cell is now implicitly available to mc13xxx drivers
The cell's platform_data is now accessed with a helper function; change clients to use that, and remove the now-unused data_size. Note that mfd-core no longer makes a copy of platform_data, but the mc13xxx-core driver creates the pdata structures on the stack. In order to get around that, the various ARM mach types that set the pdata have been changed to hold the variable in static (global) memory. Also note that __initdata references in aforementioned pdata structs have been dropped. Signed-off-by: Andres Salomon <dilinger@queued.net> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/mc13xxx-core.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
index b9fcaf0004da..30807d3a6539 100644
--- a/drivers/mfd/mc13xxx-core.c
+++ b/drivers/mfd/mc13xxx-core.c
@@ -683,14 +683,13 @@ out:
683EXPORT_SYMBOL_GPL(mc13783_adc_do_conversion); 683EXPORT_SYMBOL_GPL(mc13783_adc_do_conversion);
684 684
685static int mc13xxx_add_subdevice_pdata(struct mc13xxx *mc13xxx, 685static int mc13xxx_add_subdevice_pdata(struct mc13xxx *mc13xxx,
686 const char *format, void *pdata, size_t pdata_size) 686 const char *format, void *pdata)
687{ 687{
688 char buf[30]; 688 char buf[30];
689 const char *name = mc13xxx_get_chipname(mc13xxx); 689 const char *name = mc13xxx_get_chipname(mc13xxx);
690 690
691 struct mfd_cell cell = { 691 struct mfd_cell cell = {
692 .platform_data = pdata, 692 .platform_data = pdata,
693 .data_size = pdata_size,
694 }; 693 };
695 694
696 /* there is no asnprintf in the kernel :-( */ 695 /* there is no asnprintf in the kernel :-( */
@@ -706,7 +705,7 @@ static int mc13xxx_add_subdevice_pdata(struct mc13xxx *mc13xxx,
706 705
707static int mc13xxx_add_subdevice(struct mc13xxx *mc13xxx, const char *format) 706static int mc13xxx_add_subdevice(struct mc13xxx *mc13xxx, const char *format)
708{ 707{
709 return mc13xxx_add_subdevice_pdata(mc13xxx, format, NULL, 0); 708 return mc13xxx_add_subdevice_pdata(mc13xxx, format, NULL);
710} 709}
711 710
712static int mc13xxx_probe(struct spi_device *spi) 711static int mc13xxx_probe(struct spi_device *spi)
@@ -764,13 +763,8 @@ err_revision:
764 mc13xxx_add_subdevice(mc13xxx, "%s-codec"); 763 mc13xxx_add_subdevice(mc13xxx, "%s-codec");
765 764
766 if (pdata->flags & MC13XXX_USE_REGULATOR) { 765 if (pdata->flags & MC13XXX_USE_REGULATOR) {
767 struct mc13xxx_regulator_platform_data regulator_pdata = {
768 .num_regulators = pdata->num_regulators,
769 .regulators = pdata->regulators,
770 };
771
772 mc13xxx_add_subdevice_pdata(mc13xxx, "%s-regulator", 766 mc13xxx_add_subdevice_pdata(mc13xxx, "%s-regulator",
773 &regulator_pdata, sizeof(regulator_pdata)); 767 &pdata->regulators);
774 } 768 }
775 769
776 if (pdata->flags & MC13XXX_USE_RTC) 770 if (pdata->flags & MC13XXX_USE_RTC)
@@ -779,10 +773,8 @@ err_revision:
779 if (pdata->flags & MC13XXX_USE_TOUCHSCREEN) 773 if (pdata->flags & MC13XXX_USE_TOUCHSCREEN)
780 mc13xxx_add_subdevice(mc13xxx, "%s-ts"); 774 mc13xxx_add_subdevice(mc13xxx, "%s-ts");
781 775
782 if (pdata->flags & MC13XXX_USE_LED) { 776 if (pdata->flags & MC13XXX_USE_LED)
783 mc13xxx_add_subdevice_pdata(mc13xxx, "%s-led", 777 mc13xxx_add_subdevice_pdata(mc13xxx, "%s-led", pdata->leds);
784 pdata->leds, sizeof(*pdata->leds));
785 }
786 778
787 return 0; 779 return 0;
788} 780}