INIT_LIST_HEAD(&dev->gadget.ep0->ep_list);
        dev->udc_usb_ep[0].pxa_ep = &dev->pxa_ep[0];
        ep0_idle(dev);
-       strcpy(dev->dev->bus_id, "");
 
        /* PXA endpoints init */
        for (i = 0; i < NR_PXA_ENDPOINTS; i++) {
                ep_err(ep, "wrong to have extra bytes for setup : 0x%08x\n", i);
        }
 
-       le16_to_cpus(&u.r.wValue);
-       le16_to_cpus(&u.r.wIndex);
-       le16_to_cpus(&u.r.wLength);
-
        ep_dbg(ep, "SETUP %02x.%02x v%04x i%04x l%04x\n",
                u.r.bRequestType, u.r.bRequest,
-               u.r.wValue, u.r.wIndex, u.r.wLength);
+               le16_to_cpu(u.r.wValue), le16_to_cpu(u.r.wIndex),
+               le16_to_cpu(u.r.wLength));
        if (unlikely(have_extrabytes))
                goto stall;
 
 {
        struct pxa_udc *udc = platform_get_drvdata(_dev);
 
-       udc_disable(udc);
+       if (udc_readl(udc, UDCCR) & UDCCR_UDE)
+               udc_disable(udc);
 }
 
 #ifdef CONFIG_PM
         * Upon exit from sleep mode and before clearing OTGPH,
         * Software must configure the USB OTG pad, UDC, and UHC
         * to the state they were in before entering sleep mode.
-        *
-        * Should be : PSSR |= PSSR_OTGPH;
         */
+       PSSR |= PSSR_OTGPH;
 
        return 0;
 }
 
 static int __init udc_init(void)
 {
+       if (!cpu_is_pxa27x())
+               return -ENODEV;
+
        printk(KERN_INFO "%s: version %s\n", driver_name, DRIVER_VERSION);
        return platform_driver_probe(&udc_driver, pxa_udc_probe);
 }
 
 #define ep_warn(ep, fmt, arg...) \
        dev_warn(ep->dev->dev, "%s:%s:" fmt, EPNAME(ep), __func__, ## arg)
 
+/*
+ * Cannot include pxa-regs.h, as register names are similar.
+ * So PSSR is redefined here. This should be removed once UDC registers will
+ * be gone from pxa-regs.h.
+ */
+#define PSSR           __REG(0x40F00004)       /* Power Manager Sleep Status */
+#define PSSR_OTGPH     (1 << 6)                /* OTG Peripheral Hold */
+
 #endif /* __LINUX_USB_GADGET_PXA27X_H */