Commit 711908df authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by Greg Kroah-Hartman

ath6kl: propagate errors on module setup

This propagates initial platform registration failures and
also HIF initialization failures.

Cc: Naveen Singh <nsingh@atheros.com>
Signed-off-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 0e7fd280
...@@ -125,31 +125,27 @@ ATH_DEBUG_INSTANTIATE_MODULE_VAR(hif, ...@@ -125,31 +125,27 @@ ATH_DEBUG_INSTANTIATE_MODULE_VAR(hif,
/* ------ Functions ------ */ /* ------ Functions ------ */
int HIFInit(OSDRV_CALLBACKS *callbacks) int HIFInit(OSDRV_CALLBACKS *callbacks)
{ {
int status; int r;
AR_DEBUG_ASSERT(callbacks != NULL); AR_DEBUG_ASSERT(callbacks != NULL);
A_REGISTER_MODULE_DEBUG_INFO(hif);
A_REGISTER_MODULE_DEBUG_INFO(hif); /* store the callback handlers */
osdrvCallbacks = *callbacks;
/* store the callback handlers */ /* Register with bus driver core */
osdrvCallbacks = *callbacks; registered = 1;
/* Register with bus driver core */
AR_DEBUG_PRINTF(ATH_DEBUG_TRACE, ("AR6000: HIFInit registering\n"));
registered = 1;
#if defined(CONFIG_PM) #if defined(CONFIG_PM)
if (callbacks->deviceSuspendHandler && callbacks->deviceResumeHandler) { if (callbacks->deviceSuspendHandler && callbacks->deviceResumeHandler)
ar6k_driver.drv.pm = &ar6k_device_pm_ops; ar6k_driver.drv.pm = &ar6k_device_pm_ops;
}
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
status = sdio_register_driver(&ar6k_driver);
AR_DEBUG_ASSERT(status==0);
if (status != 0) { r = sdio_register_driver(&ar6k_driver);
return A_ERROR; if (r < 0)
} return r;
return 0;
return 0;
} }
static int static int
......
...@@ -603,7 +603,7 @@ static int __init ...@@ -603,7 +603,7 @@ static int __init
ar6000_init_module(void) ar6000_init_module(void)
{ {
static int probed = 0; static int probed = 0;
int status; int r;
OSDRV_CALLBACKS osdrvCallbacks; OSDRV_CALLBACKS osdrvCallbacks;
a_module_debug_support_init(); a_module_debug_support_init();
...@@ -636,7 +636,9 @@ ar6000_init_module(void) ...@@ -636,7 +636,9 @@ ar6000_init_module(void)
osdrvCallbacks.devicePowerChangeHandler = ar6000_power_change_ev; osdrvCallbacks.devicePowerChangeHandler = ar6000_power_change_ev;
#endif #endif
ar6000_pm_init(); r = ar6000_pm_init();
if (r)
return r;
#ifdef DEBUG #ifdef DEBUG
/* Set the debug flags if specified at load time */ /* Set the debug flags if specified at load time */
...@@ -655,9 +657,9 @@ ar6000_init_module(void) ...@@ -655,9 +657,9 @@ ar6000_init_module(void)
memset(&aptcTR, 0, sizeof(APTC_TRAFFIC_RECORD)); memset(&aptcTR, 0, sizeof(APTC_TRAFFIC_RECORD));
#endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */ #endif /* ADAPTIVE_POWER_THROUGHPUT_CONTROL */
status = HIFInit(&osdrvCallbacks); r = HIFInit(&osdrvCallbacks);
if (status) if (r)
return -ENODEV; return r;
return 0; return 0;
} }
......
...@@ -660,24 +660,28 @@ ar6000_set_wlan_state(struct ar6_softc *ar, AR6000_WLAN_STATE state) ...@@ -660,24 +660,28 @@ ar6000_set_wlan_state(struct ar6_softc *ar, AR6000_WLAN_STATE state)
return status; return status;
} }
void ar6000_pm_init() int ar6000_pm_init()
{ {
A_REGISTER_MODULE_DEBUG_INFO(pm); int r;
A_REGISTER_MODULE_DEBUG_INFO(pm);
#ifdef CONFIG_PM #ifdef CONFIG_PM
/* /*
* Register ar6000_pm_device into system. * Register ar6000_pm_device into system.
* We should also add platform_device into the first item of array * We should also add platform_device into the first item of array
* of devices[] in file arch/xxx/mach-xxx/board-xxxx.c * of devices[] in file arch/xxx/mach-xxx/board-xxxx.c
*/ */
if (platform_driver_register(&ar6000_pm_device)) { r = platform_driver_register(&ar6000_pm_device);
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000: fail to register the power control driver.\n")); if (r < 0)
} return -ENODEV;
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
return 0;
} }
void ar6000_pm_exit() void ar6000_pm_exit()
{ {
#ifdef CONFIG_PM #ifdef CONFIG_PM
platform_driver_unregister(&ar6000_pm_device); platform_driver_unregister(&ar6000_pm_device);
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
} }
...@@ -178,7 +178,7 @@ int ar6000_power_change_ev(void *context, u32 config); ...@@ -178,7 +178,7 @@ int ar6000_power_change_ev(void *context, u32 config);
void ar6000_check_wow_status(struct ar6_softc *ar, struct sk_buff *skb, bool isEvent); void ar6000_check_wow_status(struct ar6_softc *ar, struct sk_buff *skb, bool isEvent);
#endif #endif
void ar6000_pm_init(void); int ar6000_pm_init(void);
void ar6000_pm_exit(void); void ar6000_pm_exit(void);
#ifdef CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT #ifdef CONFIG_AP_VIRTUAL_ADAPTER_SUPPORT
......
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