From cb8d68097e3de5187ca370214782e381d04d12a7 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman <greg@kroah.com> Date: Fri, 4 Apr 2003 00:53:36 -0800 Subject: [PATCH] [PATCH] USB: remove redundant checks for NULL when it can never happen. --- drivers/usb/core/usb.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index ac3a4dfdad91..5261e669afb2 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c @@ -110,12 +110,6 @@ int usb_device_remove(struct device *dev) intf = list_entry(dev,struct usb_interface,dev); 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); if (intf->driver && intf->driver->disconnect) @@ -480,9 +474,6 @@ struct usb_interface *usb_find_interface(struct usb_driver *drv, kdev_t kdev) continue; intf = to_usb_interface(dev); - if (!intf) - continue; - if (kdev_same(intf->kdev,kdev)) { return intf; } @@ -548,12 +539,7 @@ static int usb_hotplug (struct device *dev, char **envp, int num_envp, return 0; intf = to_usb_interface(dev); - if (!intf) - return -ENODEV; - usb_dev = interface_to_usbdev (intf); - if (!usb_dev) - return -ENODEV; if (usb_dev->devnum < 0) { dbg ("device already deleted ??"); @@ -730,8 +716,6 @@ static void usb_release_dev(struct device *dev) struct usb_device *udev; udev = to_usb_device(dev); - if (!udev) - return; if (udev->bus && udev->bus->op && udev->bus->op->deallocate) udev->bus->op->deallocate(udev); -- 2.30.9