forked from luck/tmp_suning_uos_patched
net: remove duplicate code.
netdev_rx_handler_register() checks to see if the handler is already busy which was recently separated into netdev_is_rx_handler_busy(). So use the same function inside register() to avoid code duplication. Essentially this change should be a no-op Signed-off-by: Mahesh Bandewar <maheshb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
264b87fa61
commit
1b7cd0044e
|
@ -3961,9 +3961,7 @@ int netdev_rx_handler_register(struct net_device *dev,
|
||||||
rx_handler_func_t *rx_handler,
|
rx_handler_func_t *rx_handler,
|
||||||
void *rx_handler_data)
|
void *rx_handler_data)
|
||||||
{
|
{
|
||||||
ASSERT_RTNL();
|
if (netdev_is_rx_handler_busy(dev))
|
||||||
|
|
||||||
if (dev->rx_handler)
|
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
|
|
||||||
/* Note: rx_handler_data must be set before rx_handler */
|
/* Note: rx_handler_data must be set before rx_handler */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user