From aaf0885c30449d7b40d7cb5b07d6ff64b419c0d1 Mon Sep 17 00:00:00 2001 From: Marek Belisko Date: Fri, 15 Oct 2010 09:41:45 +0200 Subject: [PATCH] staging: ft1000: Use specific error return code for reg_ft1000_netdev(). Signed-off-by: Marek Belisko Signed-off-by: Greg Kroah-Hartman --- drivers/staging/ft1000/ft1000-usb/ft1000_hw.c | 6 +++--- drivers/staging/ft1000/ft1000-usb/ft1000_usb.c | 4 +++- drivers/staging/ft1000/ft1000-usb/ft1000_usb.h | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c index 1f91f2242ce4..46ce17cf19da 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c @@ -1103,7 +1103,7 @@ err_net: // Notes: // //--------------------------------------------------------------------------- -u16 reg_ft1000_netdev(struct ft1000_device *ft1000dev, struct usb_interface *intf) +int reg_ft1000_netdev(struct ft1000_device *ft1000dev, struct usb_interface *intf) { struct net_device *netdev; FT1000_INFO *pInfo; @@ -1124,7 +1124,7 @@ u16 reg_ft1000_netdev(struct ft1000_device *ft1000dev, struct usb_interface *int { DEBUG("reg_ft1000_netdev: could not register network device\n"); free_netdev(netdev); - return STATUS_FAILURE; + return rc; } @@ -1149,7 +1149,7 @@ u16 reg_ft1000_netdev(struct ft1000_device *ft1000dev, struct usb_interface *int pInfo->CardReady = 1; - return STATUS_SUCCESS; + return 0; } static int ft1000_reset(struct net_device *dev) diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c index a2c415e1b8f7..5fae9547247d 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.c @@ -191,7 +191,9 @@ static int ft1000_probe(struct usb_interface *interface, DEBUG("ft1000_probe::Card Ready!!!! Registering network device\n"); - reg_ft1000_netdev(ft1000dev, interface); + ret = reg_ft1000_netdev(ft1000dev, interface); + if (ret) + goto err_load; pft1000info->NetDevRegDone = 1; diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.h b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.h index 4368b49f66a3..2bc27f501441 100644 --- a/drivers/staging/ft1000/ft1000-usb/ft1000_usb.h +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_usb.h @@ -597,7 +597,7 @@ char *getfw (char *fn, size_t *pimgsz); int dsp_reload(struct ft1000_device *ft1000dev); u16 init_ft1000_netdev(struct ft1000_device *ft1000dev); struct usb_interface; -u16 reg_ft1000_netdev(struct ft1000_device *ft1000dev, struct usb_interface *intf); +int reg_ft1000_netdev(struct ft1000_device *ft1000dev, struct usb_interface *intf); int ft1000_poll(void* dev_id); void ft1000InitProc(struct net_device *dev);