Re: [PATCH 1/8] mfd: twl-core: Rename struct twl4030_platform_data to twl_platform_data

From: Paul Kocialkowski
Date: Sat Apr 02 2016 - 15:59:17 EST


Hi,

Le mercredi 30 mars 2016 Ã 18:20 +0300, Grygorii Strashko a ÃcritÂ:
> On 03/29/2016 10:22 PM, Paul Kocialkowski wrote:
> > Since twl4030_platform_data also holds platform data (e.g. regulators) for
> > other
> > TWL chips, it makes sense to rename it to a non-model-specific name.
> >
> > This will also allow hooking more platform data structure to it in the
> > future.
>
> Do we really need this patch?
> In general ldb and r51 board files are going to be dropped soon and
> it not expected to support this PMIC devices for non-DT use cases.
> As result twl4030_platform_data will be dropped at all or made private.

I understand. Depending on how soon these legacy boards are dropped, a cleanup
might still be a good thing to have. Either way, it doesn't hurt and the patch
is ready already.

However, I'll refrain from introducing more twl cleanups (which I had planned on
doing) until we get rid of all the platform data stuff.

> > Signed-off-by: Paul Kocialkowski <contact@xxxxxxxx>
> > ---
> > Â arch/arm/mach-omap2/board-ldp.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ2 +-
> > Â arch/arm/mach-omap2/board-rx51-peripherals.c |ÂÂ2 +-
> > Â arch/arm/mach-omap2/twl-common.cÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ8 ++++----
> > Â arch/arm/mach-omap2/twl-common.hÂÂÂÂÂÂÂÂÂÂÂÂÂ| 14 +++++++-------
> > Â drivers/mfd/twl-core.cÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ4 ++--
> > Â include/linux/i2c/twl.hÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ|ÂÂ3 ++-
> > Â 6 files changed, 17 insertions(+), 16 deletions(-)
> >
> > diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-
> > ldp.c
> > index d9c3ffc..b8c2e21 100644
> > --- a/arch/arm/mach-omap2/board-ldp.c
> > +++ b/arch/arm/mach-omap2/board-ldp.c
> > @@ -321,7 +321,7 @@ static struct regulator_init_data ldp_vpll2 = {
> > ÂÂ .consumer_supplies = ldp_vpll2_supplies,
> > Â };
> >
> > -static struct twl4030_platform_data ldp_twldata = {
> > +static struct twl_platform_data ldp_twldata = {
> > ÂÂ /* platform_data for children goes here */
> > ÂÂ .vmmc1 = &ldp_vmmc1,
> > ÂÂ .vaux1 = &ldp_vaux1,
> > diff --git a/arch/arm/mach-omap2/board-rx51-peripherals.c b/arch/arm/mach-
> > omap2/board-rx51-peripherals.c
> > index da174c0..3739bff 100644
> > --- a/arch/arm/mach-omap2/board-rx51-peripherals.c
> > +++ b/arch/arm/mach-omap2/board-rx51-peripherals.c
> > @@ -957,7 +957,7 @@ static struct twl4030_audio_data rx51_audio_data
> > __initdata = {
> > ÂÂ .vibra = &rx51_vibra_data,
> > Â };
> >
> > -static struct twl4030_platform_data rx51_twldata __initdata = {
> > +static struct twl_platform_data rx51_twldata __initdata = {
> > ÂÂ /* platform_data for children goes here */
> > ÂÂ .gpio = &rx51_gpio_data,
> > ÂÂ .keypad = &rx51_kp_data,
> > diff --git a/arch/arm/mach-omap2/twl-common.c b/arch/arm/mach-omap2/twl-
> > common.c
> > index 292eca0..4e6532f 100644
> > --- a/arch/arm/mach-omap2/twl-common.c
> > +++ b/arch/arm/mach-omap2/twl-common.c
> > @@ -55,7 +55,7 @@ static int twl_get_voltage(void *data)
> >
> > Â void __init omap_pmic_init(int bus, u32 clkrate,
> > ÂÂ ÂÂÂconst char *pmic_type, int pmic_irq,
> > - ÂÂÂstruct twl4030_platform_data *pmic_data)
> > + ÂÂÂstruct twl_platform_data *pmic_data)
> > Â {
> > ÂÂ omap_mux_init_signal("sys_nirq", OMAP_PIN_INPUT_PULLUP |
> > OMAP_PIN_OFF_WAKEUPENABLE);
> > ÂÂ strlcpy(pmic_i2c_board_info.type, pmic_type,
> > @@ -68,7 +68,7 @@ void __init omap_pmic_init(int bus, u32 clkrate,
> >
> > Â #ifdef CONFIG_ARCH_OMAP4
> > Â void __init omap4_pmic_init(const char *pmic_type,
> > - ÂÂÂÂstruct twl4030_platform_data *pmic_data,
> > + ÂÂÂÂstruct twl_platform_data *pmic_data,
> > ÂÂ ÂÂÂÂstruct i2c_board_info *devices, int nr_devices)
> > Â {
> > ÂÂ /* PMIC part*/
> > @@ -205,7 +205,7 @@ static struct twl_regulator_driver_data
> > omap3_vdd2_drvdata = {
> > ÂÂ .set_voltage = twl_set_voltage,
> > Â };
> >
> > -void __init omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
> > +void __init omap3_pmic_get_config(struct twl_platform_data *pmic_data,
> > ÂÂ ÂÂu32 pdata_flags, u32 regulators_flags)
> > Â {
> > ÂÂ if (!pmic_data->vdd1) {
> > @@ -470,7 +470,7 @@ static struct regulator_init_data omap4_v2v1_idata = {
> > ÂÂ .consumer_supplies = omap4_v2v1_supply,
> > Â };
> >
> > -void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
> > +void __init omap4_pmic_get_config(struct twl_platform_data *pmic_data,
> > ÂÂ ÂÂu32 pdata_flags, u32 regulators_flags)
> > Â {
> > ÂÂ if (!pmic_data->vdd1) {
> > diff --git a/arch/arm/mach-omap2/twl-common.h b/arch/arm/mach-omap2/twl-
> > common.h
> > index 24b65d0..e7caa23 100644
> > --- a/arch/arm/mach-omap2/twl-common.h
> > +++ b/arch/arm/mach-omap2/twl-common.h
> > @@ -30,35 +30,35 @@
> > Â #define TWL_COMMON_REGULATOR_VPLL2 (1 << 5)
> >
> >
> > -struct twl4030_platform_data;
> > +struct twl_platform_data;
> > Â struct twl6040_platform_data;
> > Â struct omap_tw4030_pdata;
> > Â struct i2c_board_info;
> >
> > Â void omap_pmic_init(int bus, u32 clkrate, const char *pmic_type, int
> > pmic_irq,
> > - ÂÂÂÂstruct twl4030_platform_data *pmic_data);
> > + ÂÂÂÂstruct twl_platform_data *pmic_data);
> > Â void omap_pmic_late_init(void);
> >
> > Â static inline void omap2_pmic_init(const char *pmic_type,
> > - ÂÂÂstruct twl4030_platform_data *pmic_data)
> > + ÂÂÂstruct twl_platform_data *pmic_data)
> > Â {
> > ÂÂ omap_pmic_init(2, 2600, pmic_type, 7 + OMAP_INTC_START,
> > pmic_data);
> > Â }
> >
> > Â static inline void omap3_pmic_init(const char *pmic_type,
> > - ÂÂÂstruct twl4030_platform_data *pmic_data)
> > + ÂÂÂstruct twl_platform_data *pmic_data)
> > Â {
> > ÂÂ omap_pmic_init(1, 2600, pmic_type, 7 + OMAP_INTC_START,
> > pmic_data);
> > Â }
> >
> > Â void omap4_pmic_init(const char *pmic_type,
> > - ÂÂÂÂstruct twl4030_platform_data *pmic_data,
> > + ÂÂÂÂstruct twl_platform_data *pmic_data,
> > ÂÂ ÂÂÂÂstruct i2c_board_info *devices, int nr_devices);
> >
> > -void omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
> > +void omap3_pmic_get_config(struct twl_platform_data *pmic_data,
> > ÂÂ ÂÂÂu32 pdata_flags, u32 regulators_flags);
> >
> > -void omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
> > +void omap4_pmic_get_config(struct twl_platform_data *pmic_data,
> > ÂÂ ÂÂÂu32 pdata_flags, u32 regulators_flags);
> >
> > Â void omap_twl4030_audio_init(char *card_name, struct omap_tw4030_pdata
> > *pdata);
> > diff --git a/drivers/mfd/twl-core.c b/drivers/mfd/twl-core.c
> > index 831696e..dae52f7 100644
> > --- a/drivers/mfd/twl-core.c
> > +++ b/drivers/mfd/twl-core.c
> > @@ -721,7 +721,7 @@ add_regulator(int num, struct regulator_init_data
> > *pdata,
> > ÂÂÂ*/
> >
> > Â static int
> > -add_children(struct twl4030_platform_data *pdata, unsigned irq_base,
> > +add_children(struct twl_platform_data *pdata, unsigned irq_base,
> > ÂÂ unsigned long features)
> > Â {
> > ÂÂ struct device *child;
> > @@ -1083,7 +1083,7 @@ static struct of_dev_auxdata twl_auxdata_lookup[] = {
> > Â static int
> > Â twl_probe(struct i2c_client *client, const struct i2c_device_id *id)
> > Â {
> > - struct twl4030_platform_data *pdata =
> > dev_get_platdata(&client->dev);
> > + struct twl_platform_data *pdata = dev_get_platdata(&client-
> > >dev);
> > ÂÂ struct device_node *node = client->dev.of_node;
> > ÂÂ struct platform_device *pdev;
> > ÂÂ const struct regmap_config *twl_regmap_config;
> > diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
> > index 9ad7828..27bea30 100644
> > --- a/include/linux/i2c/twl.h
> > +++ b/include/linux/i2c/twl.h
> > @@ -704,7 +704,8 @@ struct twl4030_audio_data {
> > ÂÂ unsigned int irq_base;
> > Â };
> >
> > -struct twl4030_platform_data {
> > +struct twl_platform_data {
> > + /* TWL4030 platform data */
> > ÂÂ struct twl4030_clock_init_data *clock;
> > ÂÂ struct twl4030_bci_platform_data *bci;
> > ÂÂ struct twl4030_gpio_platform_data *gpio;
> >
>

Attachment: signature.asc
Description: This is a digitally signed message part