ARM: omap: resolve nebulous 'Error setting wl12xx data'
It's useful to print the error code when a called function fails so a diagnosis of why it failed is possible. In this case, it fails because we try to register some data for the wl12xx driver, but as the driver is not configured, a stub function is used which simply returns -ENOSYS. Let's do the simple thing for -rc and print the error code. Also, the return code from platform_register_device() at each of these sites was not being checked. Add some checking, and again print the error code. This should be fixed properly for the next merge window so we don't issue error messages merely because a driver is not configured. Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
@@ -617,6 +617,21 @@ static struct gpio omap3_evm_ehci_gpios[] __initdata = {
|
||||
{ OMAP3_EVM_EHCI_SELECT, GPIOF_OUT_INIT_LOW, "select EHCI port" },
|
||||
};
|
||||
|
||||
static void __init omap3_evm_wl12xx_init(void)
|
||||
{
|
||||
#ifdef CONFIG_WL12XX_PLATFORM_DATA
|
||||
int ret;
|
||||
|
||||
/* WL12xx WLAN Init */
|
||||
ret = wl12xx_set_platform_data(&omap3evm_wlan_data);
|
||||
if (ret)
|
||||
pr_err("error setting wl12xx data: %d\n", ret);
|
||||
ret = platform_device_register(&omap3evm_wlan_regulator);
|
||||
if (ret)
|
||||
pr_err("error registering wl12xx device: %d\n", ret);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void __init omap3_evm_init(void)
|
||||
{
|
||||
omap3_evm_get_revision();
|
||||
@@ -665,13 +680,7 @@ static void __init omap3_evm_init(void)
|
||||
omap_ads7846_init(1, OMAP3_EVM_TS_GPIO, 310, NULL);
|
||||
omap3evm_init_smsc911x();
|
||||
omap3_evm_display_init();
|
||||
|
||||
#ifdef CONFIG_WL12XX_PLATFORM_DATA
|
||||
/* WL12xx WLAN Init */
|
||||
if (wl12xx_set_platform_data(&omap3evm_wlan_data))
|
||||
pr_err("error setting wl12xx data\n");
|
||||
platform_device_register(&omap3evm_wlan_regulator);
|
||||
#endif
|
||||
omap3_evm_wl12xx_init();
|
||||
}
|
||||
|
||||
MACHINE_START(OMAP3EVM, "OMAP3 EVM")
|
||||
|
Reference in New Issue
Block a user