You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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>
This commit is contained in:
committed by
Samuel Ortiz
parent
8615e4cba1
commit
4ec1b54c4d
@@ -683,14 +683,13 @@ out:
|
||||
EXPORT_SYMBOL_GPL(mc13783_adc_do_conversion);
|
||||
|
||||
static int mc13xxx_add_subdevice_pdata(struct mc13xxx *mc13xxx,
|
||||
const char *format, void *pdata, size_t pdata_size)
|
||||
const char *format, void *pdata)
|
||||
{
|
||||
char buf[30];
|
||||
const char *name = mc13xxx_get_chipname(mc13xxx);
|
||||
|
||||
struct mfd_cell cell = {
|
||||
.platform_data = pdata,
|
||||
.data_size = pdata_size,
|
||||
};
|
||||
|
||||
/* there is no asnprintf in the kernel :-( */
|
||||
@@ -706,7 +705,7 @@ static int mc13xxx_add_subdevice_pdata(struct mc13xxx *mc13xxx,
|
||||
|
||||
static int mc13xxx_add_subdevice(struct mc13xxx *mc13xxx, const char *format)
|
||||
{
|
||||
return mc13xxx_add_subdevice_pdata(mc13xxx, format, NULL, 0);
|
||||
return mc13xxx_add_subdevice_pdata(mc13xxx, format, NULL);
|
||||
}
|
||||
|
||||
static int mc13xxx_probe(struct spi_device *spi)
|
||||
@@ -764,13 +763,8 @@ err_revision:
|
||||
mc13xxx_add_subdevice(mc13xxx, "%s-codec");
|
||||
|
||||
if (pdata->flags & MC13XXX_USE_REGULATOR) {
|
||||
struct mc13xxx_regulator_platform_data regulator_pdata = {
|
||||
.num_regulators = pdata->num_regulators,
|
||||
.regulators = pdata->regulators,
|
||||
};
|
||||
|
||||
mc13xxx_add_subdevice_pdata(mc13xxx, "%s-regulator",
|
||||
®ulator_pdata, sizeof(regulator_pdata));
|
||||
&pdata->regulators);
|
||||
}
|
||||
|
||||
if (pdata->flags & MC13XXX_USE_RTC)
|
||||
@@ -779,10 +773,8 @@ err_revision:
|
||||
if (pdata->flags & MC13XXX_USE_TOUCHSCREEN)
|
||||
mc13xxx_add_subdevice(mc13xxx, "%s-ts");
|
||||
|
||||
if (pdata->flags & MC13XXX_USE_LED) {
|
||||
mc13xxx_add_subdevice_pdata(mc13xxx, "%s-led",
|
||||
pdata->leds, sizeof(*pdata->leds));
|
||||
}
|
||||
if (pdata->flags & MC13XXX_USE_LED)
|
||||
mc13xxx_add_subdevice_pdata(mc13xxx, "%s-led", pdata->leds);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user