diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2012-12-07 01:20:27 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-12-09 00:34:02 -0500 |
commit | 65d2897c0f1b240420d657f41e561239fa10ba94 (patch) | |
tree | ebb17b49e84fe9394316dab9ae561572704d5902 /net/caif | |
parent | 406636340c301b46062b22f94e3815ef767bd6a3 (diff) |
caif_usb: Make the driver name check more efficient
Use the device model to get just the name, rather than using the
ethtool API to get all driver information.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/caif')
-rw-r--r-- | net/caif/caif_usb.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/net/caif/caif_usb.c b/net/caif/caif_usb.c index 582f80c8ef3d..3ebc8cbc91ff 100644 --- a/net/caif/caif_usb.c +++ b/net/caif/caif_usb.c | |||
@@ -128,17 +128,10 @@ static int cfusbl_device_notify(struct notifier_block *me, unsigned long what, | |||
128 | struct cflayer *layer, *link_support; | 128 | struct cflayer *layer, *link_support; |
129 | struct usbnet *usbnet; | 129 | struct usbnet *usbnet; |
130 | struct usb_device *usbdev; | 130 | struct usb_device *usbdev; |
131 | struct ethtool_drvinfo drvinfo; | ||
132 | 131 | ||
133 | /* | 132 | /* Check whether we have a NCM device, and find its VID/PID. */ |
134 | * Quirks: High-jack ethtool to find if we have a NCM device, | 133 | if (!(dev->dev.parent && dev->dev.parent->driver && |
135 | * and find it's VID/PID. | 134 | strcmp(dev->dev.parent->driver->name, "cdc_ncm") == 0)) |
136 | */ | ||
137 | if (dev->ethtool_ops == NULL || dev->ethtool_ops->get_drvinfo == NULL) | ||
138 | return 0; | ||
139 | |||
140 | dev->ethtool_ops->get_drvinfo(dev, &drvinfo); | ||
141 | if (strncmp(drvinfo.driver, "cdc_ncm", 7) != 0) | ||
142 | return 0; | 135 | return 0; |
143 | 136 | ||
144 | usbnet = netdev_priv(dev); | 137 | usbnet = netdev_priv(dev); |