Commit c839f93b authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Simon Horman

ARM: shmobile: r8a7740: Use rmobile_add_devices_to_domains()

Use a table and the rmobile_add_devices_to_domains() helper function to
add all platform devices to their power domains at once, which is more
size-efficient than calling rmobile_add_device_to_domain() explicitly
for all devices individually.
Signed-off-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarSimon Horman <horms+renesas@verge.net.au>
parent 9eda01b2
...@@ -747,6 +747,19 @@ static void r8a7740_i2c_workaround(struct platform_device *pdev) ...@@ -747,6 +747,19 @@ static void r8a7740_i2c_workaround(struct platform_device *pdev)
void __init r8a7740_add_standard_devices(void) void __init r8a7740_add_standard_devices(void)
{ {
static struct pm_domain_device domain_devices[] __initdata = {
{ "A3SP", &scif0_device },
{ "A3SP", &scif1_device },
{ "A3SP", &scif2_device },
{ "A3SP", &scif3_device },
{ "A3SP", &scif4_device },
{ "A3SP", &scif5_device },
{ "A3SP", &scif6_device },
{ "A3SP", &scif7_device },
{ "A3SP", &scif8_device },
{ "A3SP", &i2c1_device },
};
/* I2C work-around */ /* I2C work-around */
r8a7740_i2c_workaround(&i2c0_device); r8a7740_i2c_workaround(&i2c0_device);
r8a7740_i2c_workaround(&i2c1_device); r8a7740_i2c_workaround(&i2c1_device);
...@@ -762,17 +775,8 @@ void __init r8a7740_add_standard_devices(void) ...@@ -762,17 +775,8 @@ void __init r8a7740_add_standard_devices(void)
ARRAY_SIZE(r8a7740_late_devices)); ARRAY_SIZE(r8a7740_late_devices));
/* add devices to PM domain */ /* add devices to PM domain */
rmobile_add_devices_to_domains(domain_devices,
rmobile_add_device_to_domain("A3SP", &scif0_device); ARRAY_SIZE(domain_devices));
rmobile_add_device_to_domain("A3SP", &scif1_device);
rmobile_add_device_to_domain("A3SP", &scif2_device);
rmobile_add_device_to_domain("A3SP", &scif3_device);
rmobile_add_device_to_domain("A3SP", &scif4_device);
rmobile_add_device_to_domain("A3SP", &scif5_device);
rmobile_add_device_to_domain("A3SP", &scif6_device);
rmobile_add_device_to_domain("A3SP", &scif7_device);
rmobile_add_device_to_domain("A3SP", &scif8_device);
rmobile_add_device_to_domain("A3SP", &i2c1_device);
} }
void __init r8a7740_add_early_devices(void) void __init r8a7740_add_early_devices(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment