Skip to content

Commit

Permalink
platform: Remove most references to platform_bus device
Browse files Browse the repository at this point in the history
A number of board files in arch/arm and arch/unicore32
explicitly reference platform_bus device as a parent
for new platform devices.

This is unnecessary, as platform device API guarantees
that devices with NULL parent are going to by adopted
by the mentioned "root" device.

This patch removes or replaces with NULL such references.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Pawel Moll authored and Greg Kroah-Hartman committed Jul 24, 2014
1 parent 90125ed commit d216814
Show file tree
Hide file tree
Showing 19 changed files with 79 additions and 95 deletions.
3 changes: 1 addition & 2 deletions arch/arm/mach-bcm/board_bcm21664.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ static void bcm21664_restart(enum reboot_mode mode, const char *cmd)

static void __init bcm21664_init(void)
{
of_platform_populate(NULL, of_default_bus_match_table, NULL,
&platform_bus);
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
kona_l2_cache_init();
}

Expand Down
3 changes: 1 addition & 2 deletions arch/arm/mach-bcm/board_bcm281xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ static void bcm281xx_restart(enum reboot_mode mode, const char *cmd)

static void __init bcm281xx_init(void)
{
of_platform_populate(NULL, of_default_bus_match_table, NULL,
&platform_bus);
of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
kona_l2_cache_init();
}

Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-clps711x/board-edb7211.c
Original file line number Diff line number Diff line change
Expand Up @@ -158,16 +158,16 @@ static void __init edb7211_init_late(void)
gpio_request_array(edb7211_gpios, ARRAY_SIZE(edb7211_gpios));

platform_device_register(&edb7211_flash_pdev);
platform_device_register_data(&platform_bus, "platform-lcd", 0,
platform_device_register_data(NULL, "platform-lcd", 0,
&edb7211_lcd_power_pdata,
sizeof(edb7211_lcd_power_pdata));
platform_device_register_data(&platform_bus, "generic-bl", 0,
platform_device_register_data(NULL, "generic-bl", 0,
&edb7211_lcd_backlight_pdata,
sizeof(edb7211_lcd_backlight_pdata));
platform_device_register_simple("video-clps711x", 0, NULL, 0);
platform_device_register_simple("cs89x0", 0, edb7211_cs8900_resource,
ARRAY_SIZE(edb7211_cs8900_resource));
platform_device_register_data(&platform_bus, "i2c-gpio", 0,
platform_device_register_data(NULL, "i2c-gpio", 0,
&edb7211_i2c_pdata,
sizeof(edb7211_i2c_pdata));
}
Expand Down
6 changes: 3 additions & 3 deletions arch/arm/mach-clps711x/board-p720t.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,14 +348,14 @@ static void __init p720t_init_late(void)
{
WARN_ON(gpio_request_array(p720t_gpios, ARRAY_SIZE(p720t_gpios)));

platform_device_register_data(&platform_bus, "platform-lcd", 0,
platform_device_register_data(NULL, "platform-lcd", 0,
&p720t_lcd_power_pdata,
sizeof(p720t_lcd_power_pdata));
platform_device_register_data(&platform_bus, "generic-bl", 0,
platform_device_register_data(NULL, "generic-bl", 0,
&p720t_lcd_backlight_pdata,
sizeof(p720t_lcd_backlight_pdata));
platform_device_register_simple("video-clps711x", 0, NULL, 0);
platform_device_register_data(&platform_bus, "leds-gpio", 0,
platform_device_register_data(NULL, "leds-gpio", 0,
&p720t_gpio_led_pdata,
sizeof(p720t_gpio_led_pdata));
}
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-imx/mach-mx27ads.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ static void __init mx27ads_regulator_init(void)
vchip->set = vgpio_set;
gpiochip_add(vchip);

platform_device_register_data(&platform_bus, "reg-fixed-voltage",
platform_device_register_data(NULL, "reg-fixed-voltage",
PLATFORM_DEVID_AUTO,
&mx27ads_lcd_regulator_pdata,
sizeof(mx27ads_lcd_regulator_pdata));
Expand Down
14 changes: 7 additions & 7 deletions arch/arm/mach-shmobile/board-ape6evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,29 +248,29 @@ static void __init ape6evm_add_standard_devices(void)

regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies));

platform_device_register_resndata(&platform_bus, "smsc911x", -1,
platform_device_register_resndata(NULL, "smsc911x", -1,
lan9220_res, ARRAY_SIZE(lan9220_res),
&lan9220_data, sizeof(lan9220_data));

regulator_register_always_on(1, "MMC0 Vcc", vcc_mmc0_consumers,
ARRAY_SIZE(vcc_mmc0_consumers), 2800000);
platform_device_register_resndata(&platform_bus, "sh_mmcif", 0,
platform_device_register_resndata(NULL, "sh_mmcif", 0,
mmcif0_resources, ARRAY_SIZE(mmcif0_resources),
&mmcif0_pdata, sizeof(mmcif0_pdata));
platform_device_register_data(&platform_bus, "reg-fixed-voltage", 2,
platform_device_register_data(NULL, "reg-fixed-voltage", 2,
&vcc_sdhi0_info, sizeof(vcc_sdhi0_info));
platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 0,
platform_device_register_resndata(NULL, "sh_mobile_sdhi", 0,
sdhi0_resources, ARRAY_SIZE(sdhi0_resources),
&sdhi0_pdata, sizeof(sdhi0_pdata));
regulator_register_always_on(3, "SDHI1 Vcc", vcc_sdhi1_consumers,
ARRAY_SIZE(vcc_sdhi1_consumers), 3300000);
platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 1,
platform_device_register_resndata(NULL, "sh_mobile_sdhi", 1,
sdhi1_resources, ARRAY_SIZE(sdhi1_resources),
&sdhi1_pdata, sizeof(sdhi1_pdata));
platform_device_register_data(&platform_bus, "gpio-keys", -1,
platform_device_register_data(NULL, "gpio-keys", -1,
&ape6evm_keys_pdata,
sizeof(ape6evm_keys_pdata));
platform_device_register_data(&platform_bus, "leds-gpio", -1,
platform_device_register_data(NULL, "leds-gpio", -1,
&ape6evm_leds_pdata,
sizeof(ape6evm_leds_pdata));
}
Expand Down
19 changes: 8 additions & 11 deletions arch/arm/mach-shmobile/board-bockw.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ static struct renesas_usbhs_platform_info usbhs_info __initdata = {
#define USB1_DEVICE "renesas_usbhs"
#define ADD_USB_FUNC_DEVICE_IF_POSSIBLE() \
platform_device_register_resndata( \
&platform_bus, "renesas_usbhs", -1, \
NULL, "renesas_usbhs", -1, \
usbhsf_resources, \
ARRAY_SIZE(usbhsf_resources), \
&usbhs_info, sizeof(struct renesas_usbhs_platform_info))
Expand Down Expand Up @@ -236,7 +236,6 @@ static struct sh_eth_plat_data ether_platform_data __initdata = {
};

static struct platform_device_info ether_info __initdata = {
.parent = &platform_bus,
.name = "r8a777x-ether",
.id = -1,
.res = ether_resources,
Expand Down Expand Up @@ -322,7 +321,6 @@ static struct resource vin##idx##_resources[] __initdata = { \
}; \
\
static struct platform_device_info vin##idx##_info __initdata = { \
.parent = &platform_bus, \
.name = "r8a7778-vin", \
.id = idx, \
.res = vin##idx##_resources, \
Expand Down Expand Up @@ -621,10 +619,10 @@ static void __init bockw_init(void)
/* VIN1 has a pin conflict with Ether */
if (!IS_ENABLED(CONFIG_SH_ETH))
platform_device_register_full(&vin1_info);
platform_device_register_data(&platform_bus, "soc-camera-pdrv", 0,
platform_device_register_data(NULL, "soc-camera-pdrv", 0,
&iclink0_ml86v7667,
sizeof(iclink0_ml86v7667));
platform_device_register_data(&platform_bus, "soc-camera-pdrv", 1,
platform_device_register_data(NULL, "soc-camera-pdrv", 1,
&iclink1_ml86v7667,
sizeof(iclink1_ml86v7667));

Expand All @@ -637,12 +635,12 @@ static void __init bockw_init(void)
r8a7778_pinmux_init();

platform_device_register_resndata(
&platform_bus, "sh_mmcif", -1,
NULL, "sh_mmcif", -1,
mmc_resources, ARRAY_SIZE(mmc_resources),
&sh_mmcif_plat, sizeof(struct sh_mmcif_plat_data));

platform_device_register_resndata(
&platform_bus, "rcar_usb_phy", -1,
NULL, "rcar_usb_phy", -1,
usb_phy_resources,
ARRAY_SIZE(usb_phy_resources),
&usb_phy_platform_data,
Expand All @@ -668,7 +666,7 @@ static void __init bockw_init(void)
iowrite16(val, fpga + IRQ0MR);

platform_device_register_resndata(
&platform_bus, "smsc911x", -1,
NULL, "smsc911x", -1,
smsc911x_resources, ARRAY_SIZE(smsc911x_resources),
&smsc911x_data, sizeof(smsc911x_data));
}
Expand All @@ -685,7 +683,7 @@ static void __init bockw_init(void)
iounmap(base);

platform_device_register_resndata(
&platform_bus, "sh_mobile_sdhi", 0,
NULL, "sh_mobile_sdhi", 0,
sdhi0_resources, ARRAY_SIZE(sdhi0_resources),
&sdhi0_info, sizeof(struct sh_mobile_sdhi_info));
}
Expand All @@ -700,7 +698,7 @@ static void __init bockw_init(void)
"ak4554-adc-dac", 1, NULL, 0);

pdev = platform_device_register_resndata(
&platform_bus, "rcar_sound", -1,
NULL, "rcar_sound", -1,
rsnd_resources, ARRAY_SIZE(rsnd_resources),
&rsnd_info, sizeof(rsnd_info));

Expand All @@ -710,7 +708,6 @@ static void __init bockw_init(void)

for (i = 0; i < ARRAY_SIZE(rsnd_card_info); i++) {
struct platform_device_info cardinfo = {
.parent = &platform_bus,
.name = "asoc-simple-card",
.id = i,
.data = &rsnd_card_info[i],
Expand Down
5 changes: 2 additions & 3 deletions arch/arm/mach-shmobile/board-genmai.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ static const struct resource ether_resources[] __initconst = {
};

static const struct platform_device_info ether_info __initconst = {
.parent = &platform_bus,
.name = "r7s72100-ether",
.id = -1,
.res = ether_resources,
Expand Down Expand Up @@ -76,7 +75,7 @@ static const struct rspi_plat_data rspi_pdata __initconst = {
};

#define r7s72100_register_rspi(idx) \
platform_device_register_resndata(&platform_bus, "rspi-rz", idx, \
platform_device_register_resndata(NULL, "rspi-rz", idx, \
rspi##idx##_resources, \
ARRAY_SIZE(rspi##idx##_resources), \
&rspi_pdata, sizeof(rspi_pdata))
Expand Down Expand Up @@ -118,7 +117,7 @@ R7S72100_SCIF(6, 0xe800a000, gic_iid(245));
R7S72100_SCIF(7, 0xe800a800, gic_iid(249));

#define r7s72100_register_scif(index) \
platform_device_register_resndata(&platform_bus, "sh-sci", index, \
platform_device_register_resndata(NULL, "sh-sci", index, \
scif##index##_resources, \
ARRAY_SIZE(scif##index##_resources), \
&scif##index##_platform_data, \
Expand Down
26 changes: 12 additions & 14 deletions arch/arm/mach-shmobile/board-koelsch.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ static const struct resource ether_resources[] __initconst = {
};

static const struct platform_device_info ether_info __initconst = {
.parent = &platform_bus,
.name = "r8a7791-ether",
.id = -1,
.res = ether_resources,
Expand Down Expand Up @@ -230,7 +229,6 @@ static const struct resource sata0_resources[] __initconst = {
};

static const struct platform_device_info sata0_info __initconst = {
.parent = &platform_bus,
.name = "sata-r8a7791",
.id = 0,
.res = sata0_resources,
Expand Down Expand Up @@ -439,13 +437,13 @@ static void __init koelsch_add_standard_devices(void)
r8a7791_pinmux_init();
r8a7791_add_standard_devices();
platform_device_register_full(&ether_info);
platform_device_register_data(&platform_bus, "leds-gpio", -1,
platform_device_register_data(NULL, "leds-gpio", -1,
&koelsch_leds_pdata,
sizeof(koelsch_leds_pdata));
platform_device_register_data(&platform_bus, "gpio-keys", -1,
platform_device_register_data(NULL, "gpio-keys", -1,
&koelsch_keys_pdata,
sizeof(koelsch_keys_pdata));
platform_device_register_resndata(&platform_bus, "qspi", 0,
platform_device_register_resndata(NULL, "qspi", 0,
qspi_resources,
ARRAY_SIZE(qspi_resources),
&qspi_pdata, sizeof(qspi_pdata));
Expand All @@ -460,28 +458,28 @@ static void __init koelsch_add_standard_devices(void)
koelsch_add_i2c(4);
koelsch_add_i2c(5);

platform_device_register_data(&platform_bus, "reg-fixed-voltage", 0,
platform_device_register_data(NULL, "reg-fixed-voltage", 0,
&vcc_sdhi0_info, sizeof(struct fixed_voltage_config));
platform_device_register_data(&platform_bus, "reg-fixed-voltage", 1,
platform_device_register_data(NULL, "reg-fixed-voltage", 1,
&vcc_sdhi1_info, sizeof(struct fixed_voltage_config));
platform_device_register_data(&platform_bus, "reg-fixed-voltage", 2,
platform_device_register_data(NULL, "reg-fixed-voltage", 2,
&vcc_sdhi2_info, sizeof(struct fixed_voltage_config));
platform_device_register_data(&platform_bus, "gpio-regulator", 0,
platform_device_register_data(NULL, "gpio-regulator", 0,
&vccq_sdhi0_info, sizeof(struct gpio_regulator_config));
platform_device_register_data(&platform_bus, "gpio-regulator", 1,
platform_device_register_data(NULL, "gpio-regulator", 1,
&vccq_sdhi1_info, sizeof(struct gpio_regulator_config));
platform_device_register_data(&platform_bus, "gpio-regulator", 2,
platform_device_register_data(NULL, "gpio-regulator", 2,
&vccq_sdhi2_info, sizeof(struct gpio_regulator_config));

platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 0,
platform_device_register_resndata(NULL, "sh_mobile_sdhi", 0,
sdhi0_resources, ARRAY_SIZE(sdhi0_resources),
&sdhi0_info, sizeof(struct sh_mobile_sdhi_info));

platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 1,
platform_device_register_resndata(NULL, "sh_mobile_sdhi", 1,
sdhi1_resources, ARRAY_SIZE(sdhi1_resources),
&sdhi1_info, sizeof(struct sh_mobile_sdhi_info));

platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 2,
platform_device_register_resndata(NULL, "sh_mobile_sdhi", 2,
sdhi2_resources, ARRAY_SIZE(sdhi2_resources),
&sdhi2_info, sizeof(struct sh_mobile_sdhi_info));

Expand Down
Loading

0 comments on commit d216814

Please sign in to comment.