Commit 4b255c6e authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman

staging: wilc1000: remove the use of goto label in wilc_init()

Added direct return in wilc_init() instead of goto label. Changes
are done to avoid the use of '_' in label name.
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Reviewed-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b2d26c8c
...@@ -3331,7 +3331,6 @@ static void get_periodic_rssi(struct timer_list *unused) ...@@ -3331,7 +3331,6 @@ static void get_periodic_rssi(struct timer_list *unused)
int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
{ {
int result = 0;
struct host_if_drv *hif_drv; struct host_if_drv *hif_drv;
struct wilc_vif *vif; struct wilc_vif *vif;
struct wilc *wilc; struct wilc *wilc;
...@@ -3345,10 +3344,9 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) ...@@ -3345,10 +3344,9 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
init_completion(&hif_wait_response); init_completion(&hif_wait_response);
hif_drv = kzalloc(sizeof(*hif_drv), GFP_KERNEL); hif_drv = kzalloc(sizeof(*hif_drv), GFP_KERNEL);
if (!hif_drv) { if (!hif_drv)
result = -ENOMEM; return -ENOMEM;
goto _fail_;
}
*hif_drv_handler = hif_drv; *hif_drv_handler = hif_drv;
for (i = 0; i < wilc->vif_num; i++) for (i = 0; i < wilc->vif_num; i++)
if (dev == wilc->vif[i]->ndev) { if (dev == wilc->vif[i]->ndev) {
...@@ -3359,7 +3357,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) ...@@ -3359,7 +3357,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
wilc_optaining_ip = false; wilc_optaining_ip = false;
if (clients_count == 0) { if (clients_count == 0) {
init_completion(&hif_thread_comp); init_completion(&hif_thread_comp);
init_completion(&hif_driver_comp); init_completion(&hif_driver_comp);
mutex_init(&hif_deinit_lock); mutex_init(&hif_deinit_lock);
...@@ -3370,12 +3368,12 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) ...@@ -3370,12 +3368,12 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
init_completion(&hif_drv->comp_get_rssi); init_completion(&hif_drv->comp_get_rssi);
init_completion(&hif_drv->comp_inactive_time); init_completion(&hif_drv->comp_inactive_time);
if (clients_count == 0) { if (clients_count == 0) {
hif_workqueue = create_singlethread_workqueue("WILC_wq"); hif_workqueue = create_singlethread_workqueue("WILC_wq");
if (!hif_workqueue) { if (!hif_workqueue) {
netdev_err(vif->ndev, "Failed to create workqueue\n"); netdev_err(vif->ndev, "Failed to create workqueue\n");
result = -ENOMEM; kfree(hif_drv);
goto _fail_; return -ENOMEM;
} }
periodic_rssi_vif = vif; periodic_rssi_vif = vif;
...@@ -3403,8 +3401,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler) ...@@ -3403,8 +3401,7 @@ int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler)
clients_count++; clients_count++;
_fail_: return 0;
return result;
} }
int wilc_deinit(struct wilc_vif *vif) int wilc_deinit(struct wilc_vif *vif)
......
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