From 3705a843bd98b3ccb7c4b6addfc182fe805a73ed Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 29 Oct 2010 08:14:16 -0700 Subject: [PATCH] beceem: remove bogus network device notifier Network device should not be messing with refcounts directly. See Documentation/networking/netdevices.txt Signed-off-by: Stephen Hemminger --- drivers/staging/bcm/Adapter.h | 2 +- drivers/staging/bcm/Bcmnet.c | 64 ----------------------------------- drivers/staging/bcm/Debug.c | 1 - drivers/staging/bcm/headers.h | 1 - 4 files changed, 1 insertion(+), 67 deletions(-) diff --git a/drivers/staging/bcm/Adapter.h b/drivers/staging/bcm/Adapter.h index 748460e898d8..eebb77f9413e 100644 --- a/drivers/staging/bcm/Adapter.h +++ b/drivers/staging/bcm/Adapter.h @@ -600,7 +600,7 @@ struct _MINI_ADAPTER struct semaphore NVMRdmWrmLock; BOOLEAN bNetworkInterfaceRegistered; - BOOLEAN bNetdeviceNotifierRegistered; + struct device *pstCreatedClassDevice; BOOLEAN bUsbClassDriverRegistered; // BOOLEAN InterfaceUpStatus; diff --git a/drivers/staging/bcm/Bcmnet.c b/drivers/staging/bcm/Bcmnet.c index 3262aff8dd4a..ce975d7f221f 100644 --- a/drivers/staging/bcm/Bcmnet.c +++ b/drivers/staging/bcm/Bcmnet.c @@ -4,48 +4,6 @@ #define DRV_VERSION "5.2.7.3P1" #define DRV_COPYRIGHT "Copyright 2010. Beceem Communications Inc" -static INT bcm_notify_event(struct notifier_block *nb, ULONG event, PVOID dev) -{ - struct net_device *ndev = (struct net_device*)dev; - PMINI_ADAPTER Adapter = GET_BCM_ADAPTER(gblpnetdev); - //PMINI_ADAPTER Adapter = (PMINI_ADAPTER)ndev->priv; - if(strncmp(ndev->name,gblpnetdev->name,5)==0) - { - switch(event) - { - case NETDEV_CHANGEADDR: - case NETDEV_GOING_DOWN: - /*ignore this */ - break; - case NETDEV_DOWN: - break; - - case NETDEV_UP: - break; - - case NETDEV_REGISTER: - /* Increment the Reference Count for "veth0" */ - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Register RefCount: %x\n", - netdev_refcnt_read(ndev)); - dev_hold(ndev); - break; - - case NETDEV_UNREGISTER: - /* Decrement the Reference Count for "veth0" */ - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Unregister RefCnt: %x\n", - netdev_refcnt_read(ndev)); - dev_put(ndev); - break; - }; - } - return NOTIFY_DONE; -} - -/* Notifier block to receive netdevice events */ -static struct notifier_block bcm_notifier_block = -{ - .notifier_call = bcm_notify_event, -}; struct net_device *gblpnetdev; /***************************************************************************************/ @@ -156,23 +114,6 @@ int register_networkdev(PMINI_ADAPTER Adapter) /* Read the MAC Address from EEPROM */ ReadMacAddressFromNVM(Adapter); - - /* Register the notifier block for getting netdevice events */ - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Registering netdevice notifier\n"); - result = register_netdevice_notifier(&bcm_notifier_block); - if(result) - { - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "BCM Notifier Block did not get registered"); - Adapter->bNetdeviceNotifierRegistered = FALSE; - return result; - } - else - { - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "BCM Notifier got Registered"); - Adapter->bNetdeviceNotifierRegistered = TRUE; - } - - result = register_netdev(Adapter->dev); if (!result) { @@ -209,11 +150,6 @@ void bcm_unregister_networkdev(PMINI_ADAPTER Adapter) if(Adapter->dev && !IS_ERR(Adapter->dev) && Adapter->bNetworkInterfaceRegistered) unregister_netdev(Adapter->dev); /* Unregister the notifier block */ - if(Adapter->bNetdeviceNotifierRegistered == TRUE) - { - BCM_DEBUG_PRINT(Adapter,DBG_TYPE_INITEXIT, DRV_ENTRY, DBG_LVL_ALL, "Unregistering netdevice notifier\n"); - unregister_netdevice_notifier(&bcm_notifier_block); - } } static int bcm_init(void) diff --git a/drivers/staging/bcm/Debug.c b/drivers/staging/bcm/Debug.c index 9f7f70ca1716..b86d8456cf7d 100644 --- a/drivers/staging/bcm/Debug.c +++ b/drivers/staging/bcm/Debug.c @@ -37,4 +37,3 @@ void bcm_print_buffer(UINT debug_level, const char *function_name, printk("\n"); } } - diff --git a/drivers/staging/bcm/headers.h b/drivers/staging/bcm/headers.h index 5867db5d0074..1a9bdf697420 100644 --- a/drivers/staging/bcm/headers.h +++ b/drivers/staging/bcm/headers.h @@ -22,7 +22,6 @@ #include #include #include -#include #include #include -- 2.34.1