Hi Mike, The only comment I wanted to do is maybe I prefer rename the board-igep0020 to board-igep00x0 to be more generic. Apart from this these patch series looks good for me and has my ack. Thanks. 2011/5/12 Mike Rapoport <mike@xxxxxxxxxxxxxx>: > IGEP2 and IGEP3 boards are very similar and can be merged into one file. > Start refactoring with changing igep2 to igep where applicable. > > Signed-off-by: Mike Rapoport <mike@xxxxxxxxxxxxxx> > --- > Âarch/arm/mach-omap2/board-igep0020.c | Â158 +++++++++++++++++----------------- > Â1 files changed, 79 insertions(+), 79 deletions(-) > > diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c > index c62c297e..ad20f7b 100644 > --- a/arch/arm/mach-omap2/board-igep0020.c > +++ b/arch/arm/mach-omap2/board-igep0020.c > @@ -112,7 +112,7 @@ static void __init igep2_get_revision(void) > Â* So MTD regards it as 4KiB page size and 256KiB block size 64*(2*2048) > Â*/ > > -static struct mtd_partition igep2_onenand_partitions[] = { > +static struct mtd_partition igep_onenand_partitions[] = { >    Â{ >        Â.name      = "X-Loader", >        Â.offset     = 0, > @@ -140,21 +140,21 @@ static struct mtd_partition igep2_onenand_partitions[] = { >    Â}, > Â}; > > -static struct omap_onenand_platform_data igep2_onenand_data = { > -    .parts = igep2_onenand_partitions, > -    .nr_parts = ARRAY_SIZE(igep2_onenand_partitions), > +static struct omap_onenand_platform_data igep_onenand_data = { > +    .parts = igep_onenand_partitions, > +    .nr_parts = ARRAY_SIZE(igep_onenand_partitions), >    Â.dma_channel  Â= -1,  /* disable DMA in OMAP OneNAND driver */ > Â}; > > -static struct platform_device igep2_onenand_device = { > +static struct platform_device igep_onenand_device = { >    Â.name      = "omap2-onenand", >    Â.id       = -1, >    Â.dev = { > -        .platform_data = &igep2_onenand_data, > +        .platform_data = &igep_onenand_data, >    Â}, > Â}; > > -static void __init igep2_flash_init(void) > +static void __init igep_flash_init(void) > Â{ >    Âu8 cs = 0; >    Âu8 onenandcs = GPMC_CS_NUM + 1; > @@ -166,7 +166,7 @@ static void __init igep2_flash_init(void) >        Â/* Check if NAND/oneNAND is configured */ >        Âif ((ret & 0xC00) == 0x800) >            Â/* NAND found */ > -            pr_err("IGEP2: Unsupported NAND found\n"); > +            pr_err("IGEP: Unsupported NAND found\n"); >        Âelse { >            Âret = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG7); >            Âif ((ret & 0x3F) == (ONENAND_MAP >> 24)) > @@ -176,18 +176,18 @@ static void __init igep2_flash_init(void) >    Â} > >    Âif (onenandcs > GPMC_CS_NUM) { > -        pr_err("IGEP2: Unable to find configuration in GPMC\n"); > +        pr_err("IGEP: Unable to find configuration in GPMC\n"); >        Âreturn; >    Â} > > -    igep2_onenand_data.cs = onenandcs; > +    igep_onenand_data.cs = onenandcs; > > -    if (platform_device_register(&igep2_onenand_device) < 0) > -        pr_err("IGEP2: Unable to register OneNAND device\n"); > +    if (platform_device_register(&igep_onenand_device) < 0) > +        pr_err("IGEP: Unable to register OneNAND device\n"); > Â} > > Â#else > -static void __init igep2_flash_init(void) {} > +static void __init igep_flash_init(void) {} > Â#endif > > Â#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) > @@ -211,11 +211,11 @@ static inline void __init igep2_init_smsc911x(void) > Âstatic inline void __init igep2_init_smsc911x(void) { } > Â#endif > > -static struct regulator_consumer_supply igep2_vmmc1_supply = > +static struct regulator_consumer_supply igep_vmmc1_supply = >    ÂREGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"); > > Â/* VMMC1 for OMAP VDD_MMC1 (i/o) and MMC1 card */ > -static struct regulator_init_data igep2_vmmc1 = { > +static struct regulator_init_data igep_vmmc1 = { >    Â.constraints = { >        Â.min_uV         = 1850000, >        Â.max_uV         = 3150000, > @@ -226,13 +226,13 @@ static struct regulator_init_data igep2_vmmc1 = { >                    Â| REGULATOR_CHANGE_STATUS, >    Â}, >    Â.num_consumer_supplies Â= 1, > -    .consumer_supplies   Â= &igep2_vmmc1_supply, > +    .consumer_supplies   Â= &igep_vmmc1_supply, > Â}; > > -static struct regulator_consumer_supply igep2_vio_supply = > +static struct regulator_consumer_supply igep_vio_supply = >    ÂREGULATOR_SUPPLY("vmmc_aux", "omap_hsmmc.1"); > > -static struct regulator_init_data igep2_vio = { > +static struct regulator_init_data igep_vio = { >    Â.constraints = { >        Â.min_uV         = 1800000, >        Â.max_uV         = 1800000, > @@ -244,34 +244,34 @@ static struct regulator_init_data igep2_vio = { >                    Â| REGULATOR_CHANGE_STATUS, >    Â}, >    Â.num_consumer_supplies Â= 1, > -    .consumer_supplies   Â= &igep2_vio_supply, > +    .consumer_supplies   Â= &igep_vio_supply, > Â}; > > -static struct regulator_consumer_supply igep2_vmmc2_supply = > +static struct regulator_consumer_supply igep_vmmc2_supply = >    ÂREGULATOR_SUPPLY("vmmc", "omap_hsmmc.1"); > > -static struct regulator_init_data igep2_vmmc2 = { > +static struct regulator_init_data igep_vmmc2 = { >    Â.constraints      Â= { >        Â.valid_modes_mask    = REGULATOR_MODE_NORMAL, >        Â.always_on       Â= 1, >    Â}, >    Â.num_consumer_supplies Â= 1, > -    .consumer_supplies   Â= &igep2_vmmc2_supply, > +    .consumer_supplies   Â= &igep_vmmc2_supply, > Â}; > > -static struct fixed_voltage_config igep2_vwlan = { > +static struct fixed_voltage_config igep_vwlan = { >    Â.supply_name      Â= "vwlan", >    Â.microvolts       = 3300000, >    Â.gpio          = -EINVAL, >    Â.enabled_at_boot    Â= 1, > -    .init_data       Â= &igep2_vmmc2, > +    .init_data       Â= &igep_vmmc2, > Â}; > > -static struct platform_device igep2_vwlan_device = { > +static struct platform_device igep_vwlan_device = { >    Â.name      = "reg-fixed-voltage", >    Â.id       = 0, >    Â.dev = { > -        .platform_data Â= &igep2_vwlan, > +        .platform_data Â= &igep_vwlan, >    Â}, > Â}; > > @@ -296,7 +296,7 @@ static struct omap2_hsmmc_info mmc[] = { > Â#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) > Â#include <linux/leds.h> > > -static struct gpio_led igep2_gpio_leds[] = { > +static struct gpio_led igep_gpio_leds[] = { >    Â[0] = { >        Â.name          = "gpio-led:red:d0", >        Â.gpio          = IGEP2_GPIO_LED0_RED, > @@ -320,34 +320,34 @@ static struct gpio_led igep2_gpio_leds[] = { >    Â}, > Â}; > > -static struct gpio_led_platform_data igep2_led_pdata = { > -    .leds      = igep2_gpio_leds, > -    .num_leds    = ARRAY_SIZE(igep2_gpio_leds), > +static struct gpio_led_platform_data igep_led_pdata = { > +    .leds      = igep_gpio_leds, > +    .num_leds    = ARRAY_SIZE(igep_gpio_leds), > Â}; > > -static struct platform_device igep2_led_device = { > +static struct platform_device igep_led_device = { >     .name  = "leds-gpio", >     .id   = -1, >     .dev  Â= { > -        Â.platform_data Â= Â&igep2_led_pdata, > +        Â.platform_data Â= Â&igep_led_pdata, >    Â}, > Â}; > > -static void __init igep2_leds_init(void) > +static void __init igep_leds_init(void) > Â{ > -    platform_device_register(&igep2_led_device); > +    platform_device_register(&igep_led_device); > Â} > > Â#else > -static struct gpio igep2_gpio_leds[] __initdata = { > +static struct gpio igep_gpio_leds[] __initdata = { >    Â{ IGEP2_GPIO_LED0_RED,  GPIOF_OUT_INIT_LOW, "gpio-led:red:d0"  }, >    Â{ IGEP2_GPIO_LED0_GREEN, GPIOF_OUT_INIT_LOW, "gpio-led:green:d0" }, >    Â{ IGEP2_GPIO_LED1_RED,  GPIOF_OUT_INIT_LOW, "gpio-led:red:d1"  }, > Â}; > > -static inline void igep2_leds_init(void) > +static inline void igep_leds_init(void) > Â{ > -    if (gpio_request_array(igep2_gpio_leds, ARRAY_SIZE(igep2_gpio_leds))) { > +    if (gpio_request_array(igep_gpio_leds, ARRAY_SIZE(igep_gpio_leds))) { >        Âpr_warning("IGEP v2: Could not obtain leds gpios\n"); >        Âreturn; >    Â} > @@ -363,7 +363,7 @@ static struct gpio igep2_twl_gpios[] = { >    Â{ -EINVAL, GPIOF_OUT_INIT_LOW, Â"GPIO_USBH_CPEN" }, > Â}; > > -static int igep2_twl_gpio_setup(struct device *dev, > +static int igep_twl_gpio_setup(struct device *dev, >        Âunsigned gpio, unsigned ngpio) > Â{ >    Âint ret; > @@ -392,23 +392,23 @@ static int igep2_twl_gpio_setup(struct device *dev, >    Âif (ret == 0) >        Âgpio_export(gpio + TWL4030_GPIO_MAX + 1, 0); >    Âelse > -        pr_warning("IGEP v2: Could not obtain gpio GPIO_LED1_GREEN\n"); > +        pr_warning("IGEP: Could not obtain gpio GPIO_LED1_GREEN\n"); > Â#else > -    igep2_gpio_leds[3].gpio = gpio + TWL4030_GPIO_MAX + 1; > +    igep_gpio_leds[3].gpio = gpio + TWL4030_GPIO_MAX + 1; > Â#endif > >    Âreturn 0; > Â}; > > -static struct twl4030_gpio_platform_data igep2_twl4030_gpio_pdata = { > +static struct twl4030_gpio_platform_data igep_twl4030_gpio_pdata = { >    Â.gpio_base   Â= OMAP_MAX_GPIO_LINES, >    Â.irq_base    = TWL4030_GPIO_IRQ_BASE, >    Â.irq_end    Â= TWL4030_GPIO_IRQ_END, >    Â.use_leds    = true, > -    .setup     Â= igep2_twl_gpio_setup, > +    .setup     Â= igep_twl_gpio_setup, > Â}; > > -static struct twl4030_usb_data igep2_usb_data = { > +static struct twl4030_usb_data igep_usb_data = { >    Â.usb_mode    = T2_USB_MODE_ULPI, > Â}; > > @@ -476,11 +476,11 @@ static void __init igep2_display_init(void) >        Âpr_err("IGEP v2: Could not obtain gpio GPIO_DVI_PUP\n"); > Â} > > -static struct platform_device *igep2_devices[] __initdata = { > -    &igep2_vwlan_device, > +static struct platform_device *igep_devices[] __initdata = { > +    &igep_vwlan_device, > Â}; > > -static void __init igep2_init_early(void) > +static void __init igep_init_early(void) > Â{ >    Âomap2_init_common_infrastructure(); >    Âomap2_init_common_devices(m65kxxxxam_sdrc_params, > @@ -525,18 +525,18 @@ static struct twl4030_keypad_data igep2_keypad_pdata = { >    Â.rep      Â= 1, > Â}; > > -static struct twl4030_platform_data igep2_twldata = { > +static struct twl4030_platform_data igep_twldata = { >    Â.irq_base    = TWL4030_IRQ_BASE, >    Â.irq_end    Â= TWL4030_IRQ_END, > >    Â/* platform_data for children goes here */ > -    .usb      Â= &igep2_usb_data, > +    .usb      Â= &igep_usb_data, >    Â.codec     Â= &igep2_codec_data, > -    .gpio      = &igep2_twl4030_gpio_pdata, > +    .gpio      = &igep_twl4030_gpio_pdata, >    Â.keypad     = &igep2_keypad_pdata, > -    .vmmc1     Â= &igep2_vmmc1, > +    .vmmc1     Â= &igep_vmmc1, >    Â.vpll2     Â= &igep2_vpll2, > -    .vio      Â= &igep2_vio, > +    .vio      Â= &igep_vio, > Â}; > > Âstatic struct i2c_board_info __initdata igep2_i2c3_boardinfo[] = { > @@ -545,11 +545,11 @@ static struct i2c_board_info __initdata igep2_i2c3_boardinfo[] = { >    Â}, > Â}; > > -static void __init igep2_i2c_init(void) > +static void __init igep_i2c_init(void) > Â{ >    Âint ret; > > -    omap3_pmic_init("twl4030", &igep2_twldata); > +    omap3_pmic_init("twl4030", &igep_twldata); > >    Â/* >     * Bus 3 is attached to the DVI port where devices like the pico DLP > @@ -561,7 +561,7 @@ static void __init igep2_i2c_init(void) >        Âpr_warning("IGEP2: Could not register I2C3 bus (%d)\n", ret); > Â} > > -static const struct usbhs_omap_board_data usbhs_bdata __initconst = { > +static const struct usbhs_omap_board_data igep2_usbhs_bdata __initconst = { >    Â.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, >    Â.port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED, >    Â.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED, > @@ -579,64 +579,64 @@ static struct omap_board_mux board_mux[] __initdata = { > Â#endif > > Â#if defined(CONFIG_LIBERTAS_SDIO) || defined(CONFIG_LIBERTAS_SDIO_MODULE) > -static struct gpio igep2_wlan_bt_gpios[] __initdata = { > +static struct gpio igep_wlan_bt_gpios[] __initdata = { >    Â{ -EINVAL, GPIOF_OUT_INIT_HIGH, "GPIO_WIFI_NPD"  Â}, >    Â{ -EINVAL, GPIOF_OUT_INIT_HIGH, "GPIO_WIFI_NRESET" }, >    Â{ -EINVAL, GPIOF_OUT_INIT_HIGH, "GPIO_BT_NRESET"  }, > Â}; > > -static void __init igep2_wlan_bt_init(void) > +static void __init igep_wlan_bt_init(void) > Â{ >    Âint err; > >    Â/* GPIO's for WLAN-BT combo depends on hardware revision */ >    Âif (hwrev == IGEP2_BOARD_HWREV_B) { > -        igep2_wlan_bt_gpios[0].gpio = IGEP2_RB_GPIO_WIFI_NPD; > -        igep2_wlan_bt_gpios[1].gpio = IGEP2_RB_GPIO_WIFI_NRESET; > -        igep2_wlan_bt_gpios[2].gpio = IGEP2_RB_GPIO_BT_NRESET; > +        igep_wlan_bt_gpios[0].gpio = IGEP2_RB_GPIO_WIFI_NPD; > +        igep_wlan_bt_gpios[1].gpio = IGEP2_RB_GPIO_WIFI_NRESET; > +        igep_wlan_bt_gpios[2].gpio = IGEP2_RB_GPIO_BT_NRESET; >    Â} else if (hwrev == IGEP2_BOARD_HWREV_C) { > -        igep2_wlan_bt_gpios[0].gpio = IGEP2_RC_GPIO_WIFI_NPD; > -        igep2_wlan_bt_gpios[1].gpio = IGEP2_RC_GPIO_WIFI_NRESET; > -        igep2_wlan_bt_gpios[2].gpio = IGEP2_RC_GPIO_BT_NRESET; > +        igep_wlan_bt_gpios[0].gpio = IGEP2_RC_GPIO_WIFI_NPD; > +        igep_wlan_bt_gpios[1].gpio = IGEP2_RC_GPIO_WIFI_NRESET; > +        igep_wlan_bt_gpios[2].gpio = IGEP2_RC_GPIO_BT_NRESET; >    Â} else >        Âreturn; > > -    err = gpio_request_array(igep2_wlan_bt_gpios, > -                ÂARRAY_SIZE(igep2_wlan_bt_gpios)); > +    err = gpio_request_array(igep_wlan_bt_gpios, > +                ÂARRAY_SIZE(igep_wlan_bt_gpios)); >    Âif (err) { >        Âpr_warning("IGEP2: Could not obtain WIFI/BT gpios\n"); >        Âreturn; >    Â} > > -    gpio_export(igep2_wlan_bt_gpios[0].gpio, 0); > -    gpio_export(igep2_wlan_bt_gpios[1].gpio, 0); > -    gpio_export(igep2_wlan_bt_gpios[2].gpio, 0); > +    gpio_export(igep_wlan_bt_gpios[0].gpio, 0); > +    gpio_export(igep_wlan_bt_gpios[1].gpio, 0); > +    gpio_export(igep_wlan_bt_gpios[2].gpio, 0); > > -    gpio_set_value(igep2_wlan_bt_gpios[1].gpio, 0); > +    gpio_set_value(igep_wlan_bt_gpios[1].gpio, 0); >    Âudelay(10); > -    gpio_set_value(igep2_wlan_bt_gpios[1].gpio, 1); > +    gpio_set_value(igep_wlan_bt_gpios[1].gpio, 1); > > Â} > Â#else > -static inline void __init igep2_wlan_bt_init(void) { } > +static inline void __init igep_wlan_bt_init(void) { } > Â#endif > > -static void __init igep2_init(void) > +static void __init igep_init(void) > Â{ >    Âomap3_mux_init(board_mux, OMAP_PACKAGE_CBB); > >    Â/* Get IGEP2 hardware revision */ >    Âigep2_get_revision(); >    Â/* Register I2C busses and drivers */ > -    igep2_i2c_init(); > -    platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices)); > +    igep_i2c_init(); > +    platform_add_devices(igep_devices, ARRAY_SIZE(igep_devices)); >    Âomap_display_init(&igep2_dss_data); >    Âomap_serial_init(); >    Âusb_musb_init(NULL); > -    usbhs_init(&usbhs_bdata); > +    usbhs_init(&igep2_usbhs_bdata); > > -    igep2_flash_init(); > -    igep2_leds_init(); > +    igep_flash_init(); > +    igep_leds_init(); >    Âigep2_display_init(); >    Âigep2_init_smsc911x(); > > @@ -644,7 +644,7 @@ static void __init igep2_init(void) >     * WLAN-BT combo module from MuRata which has a Marvell WLAN >     * (88W8686) + CSR Bluetooth chipset. Uses SDIO interface. >     */ > -    igep2_wlan_bt_init(); > +    igep_wlan_bt_init(); > > Â} > > @@ -652,8 +652,8 @@ MACHINE_START(IGEP0020, "IGEP v2 board") >    Â.boot_params  Â= 0x80000100, >    Â.reserve    Â= omap_reserve, >    Â.map_io     = omap3_map_io, > -    .init_early   = igep2_init_early, > +    .init_early   = igep_init_early, >    Â.init_irq    = omap_init_irq, > -    .init_machine  = igep2_init, > +    .init_machine  = igep_init, >    Â.timer     Â= &omap_timer, > ÂMACHINE_END > -- > 1.7.3.1 > > Acked-by: Enric Balletbo i Serra <eballetbo@xxxxxxxxxxx> -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html