For kernels that have netdev_rx_handler_register() (>=2.6.35),
duplicate netdevs are detected by netdev_rx_handler_register().
So by adding duplicate detection to the netdev_rx_handler_register()
compatibility code the explicit check in netdev_create() can be removed.
Signed-off-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Jesse Gross <jesse@nicira.com>
                                             void *rx_handler,
                                             void *rx_handler_data)
 {
+       if (dev->br_port)
+               return -EBUSY;
        return 0;
 }
 static inline void netdev_rx_handler_unregister(struct net_device *dev) { }
 
                goto error_put;
        }
 
-       if (netdev_vport->dev->br_port) {
-               err = -EBUSY;
-               goto error_put;
-       }
-
        /* If we are using the vport stats layer initialize it to the current
         * values so we are roughly consistent with the device stats. */
        if (USE_VPORT_STATS) {