usb: corrected references to otg_notify when CONFIG_USB_OTG undefined
authorMark F. Brown <mark.f.brown@intel.com>
Fri, 3 Feb 2012 15:38:05 +0000 (07:38 -0800)
committerbuildbot <buildbot@intel.com>
Fri, 17 Feb 2012 10:33:59 +0000 (02:33 -0800)
BZ: 22291

Fixes errors:
drivers/usb/core/generic.c: In function 'generic_probe':
drivers/usb/core/generic.c:195: error: 'struct usb_hcd' has no member named 'otg_notify'
drivers/usb/core/generic.c:196: error: 'struct usb_hcd' has no member named 'otg_notify'
drivers/usb/core/generic.c:198: error: 'struct usb_hcd' has no member named 'otg_notify'

Change-Id: I5255fe1843f6a1f394252ddb1ea4267f8cee1063
Signed-off-by: Mark F. Brown <mark.f.brown@intel.com>
Reviewed-on: http://android.intel.com:8080/33983
Reviewed-by: Yang, Fei <fei.yang@intel.com>
Reviewed-by: Gross, Mark <mark.gross@intel.com>
Tested-by: Ng, Cheon-woei <cheon-woei.ng@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
drivers/usb/core/generic.c

index c997401..abb4422 100644 (file)
@@ -156,7 +156,6 @@ int usb_choose_configuration(struct usb_device *udev)
 
 static int generic_probe(struct usb_device *udev)
 {
-       struct usb_hcd  *hcd = bus_to_hcd(udev->bus);
        int err, c;
 
        /* Choose and set the configuration.  This registers the interfaces
@@ -166,7 +165,9 @@ static int generic_probe(struct usb_device *udev)
                ;               /* Don't configure if the device is owned */
        else if (udev->authorized == 0)
                dev_err(&udev->dev, "Device is not authorized for usage\n");
+#ifdef CONFIG_USB_OTG
        else if (is_otg_testdev(udev)) {
+               struct usb_hcd  *hcd = bus_to_hcd(udev->bus);
 
                /* According to USB OTG2.0 Spec Test mode support 6.4.2,
                 * for A-device enumeration, set_configuration(1), and
@@ -196,8 +197,9 @@ static int generic_probe(struct usb_device *udev)
                        hcd->otg_notify(udev, USB_OTG_TESTDEV_VBUSOFF);
                else
                        hcd->otg_notify(udev, USB_OTG_TESTDEV);
-
-       } else {
+       }
+#endif
+       else {
                c = usb_choose_configuration(udev);
                if (c >= 0) {
                        err = usb_set_configuration(udev, c);