Commit cb8d6809 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB: remove redundant checks for NULL when it can never happen.

parent f20c266a
...@@ -110,12 +110,6 @@ int usb_device_remove(struct device *dev) ...@@ -110,12 +110,6 @@ int usb_device_remove(struct device *dev)
intf = list_entry(dev,struct usb_interface,dev); intf = list_entry(dev,struct usb_interface,dev);
driver = to_usb_driver(dev->driver); driver = to_usb_driver(dev->driver);
if (!driver) {
dev_err(dev, "%s does not have a valid driver to work with!",
__FUNCTION__);
return -ENODEV;
}
down(&driver->serialize); down(&driver->serialize);
if (intf->driver && intf->driver->disconnect) if (intf->driver && intf->driver->disconnect)
...@@ -480,9 +474,6 @@ struct usb_interface *usb_find_interface(struct usb_driver *drv, kdev_t kdev) ...@@ -480,9 +474,6 @@ struct usb_interface *usb_find_interface(struct usb_driver *drv, kdev_t kdev)
continue; continue;
intf = to_usb_interface(dev); intf = to_usb_interface(dev);
if (!intf)
continue;
if (kdev_same(intf->kdev,kdev)) { if (kdev_same(intf->kdev,kdev)) {
return intf; return intf;
} }
...@@ -548,12 +539,7 @@ static int usb_hotplug (struct device *dev, char **envp, int num_envp, ...@@ -548,12 +539,7 @@ static int usb_hotplug (struct device *dev, char **envp, int num_envp,
return 0; return 0;
intf = to_usb_interface(dev); intf = to_usb_interface(dev);
if (!intf)
return -ENODEV;
usb_dev = interface_to_usbdev (intf); usb_dev = interface_to_usbdev (intf);
if (!usb_dev)
return -ENODEV;
if (usb_dev->devnum < 0) { if (usb_dev->devnum < 0) {
dbg ("device already deleted ??"); dbg ("device already deleted ??");
...@@ -730,8 +716,6 @@ static void usb_release_dev(struct device *dev) ...@@ -730,8 +716,6 @@ static void usb_release_dev(struct device *dev)
struct usb_device *udev; struct usb_device *udev;
udev = to_usb_device(dev); udev = to_usb_device(dev);
if (!udev)
return;
if (udev->bus && udev->bus->op && udev->bus->op->deallocate) if (udev->bus && udev->bus->op && udev->bus->op->deallocate)
udev->bus->op->deallocate(udev); udev->bus->op->deallocate(udev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment