Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 6 May 2007 20:20:10 +0000 (13:20 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Sun, 6 May 2007 20:20:10 +0000 (13:20 -0700)
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (82 commits)
  [ARM] Add comments marking in-use ptrace numbers
  [ARM] Move syscall saving out of the way of utrace
  [ARM] 4360/1: S3C24XX: regs-udc.h remove unused macro
  [ARM] 4358/1: S3C24XX: mach-qt2410.c: remove linux/mmc/protocol.h header
  [ARM] mm 10: allow memory type to be specified with ioremap
  [ARM] mm 9: add additional device memory types
  [ARM] mm 8: define mem_types table L1 bit 4 to be for ARMv6
  [ARM] iop: add missing parens in macro
  [ARM] mm 7: remove duplicated __ioremap() prototypes
  ARM: OMAP: fix OMAP1 mpuio suspend/resume oops
  ARM: OMAP: MPUIO wake updates
  ARM: OMAP: speed up gpio irq handling
  ARM: OMAP: plat-omap changes for 2430 SDP
  ARM: OMAP: gpio object shrinkage, cleanup
  ARM: OMAP: /sys/kernel/debug/omap_gpio
  ARM: OMAP: Implement workaround for GPIO wakeup bug in OMAP2420 silicon
  ARM: OMAP: Enable 24xx GPIO autoidling
  [ARM] 4318/2: DSM-G600 Board Support
  [ARM] 4227/1: minor head.S fixups
  [ARM] 4328/1: Move i.MX UART regs to driver
  ...

1  2 
arch/arm/Kconfig
arch/arm/kernel/vmlinux.lds.S
drivers/ata/Kconfig
drivers/ata/Makefile
drivers/i2c/busses/i2c-pxa.c
drivers/mmc/host/pxamci.c
drivers/net/irda/pxaficp_ir.c
drivers/usb/gadget/pxa2xx_udc.c

diff --combined arch/arm/Kconfig
@@@ -29,6 -29,10 +29,10 @@@ config GENERIC_TIM
        bool
        default n
  
+ config GENERIC_CLOCKEVENTS
+       bool
+       default n
  config MMU
        bool
        default y
@@@ -67,6 -71,14 +71,14 @@@ config GENERIC_HARDIRQ
        bool
        default y
  
+ config STACKTRACE_SUPPORT
+       bool
+       default y
+ config LOCKDEP_SUPPORT
+       bool
+       default y
  config TRACE_IRQFLAGS_SUPPORT
        bool
        default y
@@@ -162,6 -174,8 +174,8 @@@ config ARCH_VERSATIL
        select ARM_AMBA
        select ARM_VIC
        select ICST307
+       select GENERIC_TIME
+       select GENERIC_CLOCKEVENTS
        help
          This enables support for ARM Ltd Versatile board.
  
@@@ -255,7 -269,6 +269,7 @@@ config ARCH_IOP13X
        depends on MMU
        select PLAT_IOP
        select PCI
 +      select ARCH_SUPPORTS_MSI
        help
          Support for Intel's IOP13XX (XScale) family of processors.
  
@@@ -263,6 -276,7 +277,7 @@@ config ARCH_IXP4X
        bool "IXP4xx-based"
        depends on MMU
        select GENERIC_TIME
+       select GENERIC_CLOCKEVENTS
        help
          Support for Intel's IXP4XX (XScale) family of processors.
  
@@@ -364,6 -378,7 +379,7 @@@ config ARCH_LH7A40
  config ARCH_OMAP
        bool "TI OMAP"
        select GENERIC_GPIO
+       select GENERIC_TIME
        help
          Support for TI's OMAP platform (OMAP1 and OMAP2).
  
@@@ -514,6 -529,8 +530,8 @@@ endmen
  
  menu "Kernel Features"
  
+ source "kernel/time/Kconfig"
  config SMP
        bool "Symmetric Multi-Processing (EXPERIMENTAL)"
        depends on EXPERIMENTAL && REALVIEW_MPCORE
@@@ -573,6 -590,7 +591,7 @@@ config PREEMP
  
  config NO_IDLE_HZ
        bool "Dynamic tick timer"
+       depends on !GENERIC_CLOCKEVENTS
        help
          Select this option if you want to disable continuous timer ticks
          and have them programmed to occur as required. This option saves
@@@ -670,6 -688,7 +689,7 @@@ config LEDS_TIME
        bool "Timer LED" if (!ARCH_CDB89712 && !ARCH_OMAP) || \
                            MACH_OMAP_H2 || MACH_OMAP_PERSEUS2
        depends on LEDS
+       depends on !GENERIC_CLOCKEVENTS
        default y if ARCH_EBSA110
        help
          If you say Y here, one of the system LEDs (the green one on the
@@@ -59,7 -59,7 +59,7 @@@ SECTION
                        usr/built-in.o(.init.ramfs)
                __initramfs_end = .;
  #endif
 -              . = ALIGN(64);
 +              . = ALIGN(4096);
                __per_cpu_start = .;
                        *(.data.percpu)
                __per_cpu_end = .;
@@@ -83,6 -83,9 +83,9 @@@
  
        .text : {                       /* Real text segment            */
                _text = .;              /* Text and read-only data      */
+                       __exception_text_start = .;
+                       *(.exception.text)
+                       __exception_text_end = .;
                        *(.text)
                        SCHED_TEXT
                        LOCK_TEXT
diff --combined drivers/ata/Kconfig
@@@ -156,6 -156,11 +156,6 @@@ config SATA_INIC162
        help
          This option enables support for Initio 162x Serial ATA.
  
 -config SATA_INTEL_COMBINED
 -      bool
 -      depends on IDE=y && !BLK_DEV_IDE_SATA && (SATA_AHCI || ATA_PIIX)
 -      default y
 -
  config SATA_ACPI
        bool
        depends on ACPI && PCI
@@@ -179,7 -184,7 +179,7 @@@ config PATA_AL
          If unsure, say N.
  
  config PATA_AMD
 -      tristate "AMD/NVidia PATA support (Experimental)"
 +      tristate "AMD/NVidia PATA support"
        depends on PCI
        help
          This option enables support for the AMD and NVidia PATA
@@@ -204,16 -209,6 +204,16 @@@ config PATA_ATIIX
  
          If unsure, say N.
  
 +config PATA_CMD640_PCI
 +      tristate "CMD640 PCI PATA support (Very Experimental)"
 +      depends on PCI && EXPERIMENTAL
 +      help
 +        This option enables support for the CMD640 PCI IDE
 +        interface chip. Only the primary channel is currently
 +        supported.
 +
 +        If unsure, say N.
 +
  config PATA_CMD64X
        tristate "CMD64x PATA support (Very Experimental)"
        depends on PCI&& EXPERIMENTAL
@@@ -278,7 -273,7 +278,7 @@@ config ATA_GENERI
          If unsure, say N.
  
  config PATA_HPT366
 -      tristate "HPT 366/368 PATA support (Very Experimental)"
 +      tristate "HPT 366/368 PATA support (Experimental)"
        depends on PCI && EXPERIMENTAL
        help
          This option enables support for the HPT 366 and 368
          If unsure, say N.
  
  config PATA_HPT37X
 -      tristate "HPT 370/370A/371/372/374/302 PATA support (Very Experimental)"
 +      tristate "HPT 370/370A/371/372/374/302 PATA support (Experimental)"
        depends on PCI && EXPERIMENTAL
        help
          This option enables support for the majority of the later HPT
@@@ -314,7 -309,7 +314,7 @@@ config PATA_HPT3X
          If unsure, say N.
  
  config PATA_ISAPNP
 -      tristate "ISA Plug and Play PATA support (Very Experimental)"
 +      tristate "ISA Plug and Play PATA support (Experimental)"
        depends on EXPERIMENTAL && ISAPNP
        help
          This option enables support for ISA plug & play ATA
          If unsure, say N.
  
  config PATA_IT821X
 -      tristate "IT8211/2 PATA support (Experimental)"
 -      depends on PCI && EXPERIMENTAL
 +      tristate "IT8211/2 PATA support"
 +      depends on PCI
        help
          This option enables support for the ITE 8211 and 8212
          PATA controllers via the new ATA layer, including RAID
@@@ -395,10 -390,10 +395,10 @@@ config PATA_MPII
          If unsure, say N.
  
  config PATA_OLDPIIX
 -      tristate "Intel PATA old PIIX support (Experimental)"
 -      depends on PCI && EXPERIMENTAL
 +      tristate "Intel PATA old PIIX support"
 +      depends on PCI
        help
 -        This option enables support for old(?) PIIX PATA support.
 +        This option enables support for early PIIX PATA support.
  
          If unsure, say N.
  
@@@ -449,7 -444,7 +449,7 @@@ config PATA_PCMCI
          If unsure, say N.
  
  config PATA_PDC_OLD
 -      tristate "Older Promise PATA controller support (Very Experimental)"
 +      tristate "Older Promise PATA controller support (Experimental)"
        depends on PCI && EXPERIMENTAL
        help
          This option enables support for the Promise 20246, 20262, 20263,
@@@ -464,7 -459,7 +464,7 @@@ config PATA_QD
          Support for QDI 6500 and 6580 PATA controllers on VESA local bus.
  
  config PATA_RADISYS
 -      tristate "RADISYS 82600 PATA support (Very experimental)"
 +      tristate "RADISYS 82600 PATA support (Very Experimental)"
        depends on PCI && EXPERIMENTAL
        help
          This option enables support for the RADISYS 82600
@@@ -482,7 -477,7 +482,7 @@@ config PATA_RZ100
          If unsure, say N.
  
  config PATA_SC1200
 -      tristate "SC1200 PATA support (Raving Lunatic)"
 +      tristate "SC1200 PATA support (Very Experimental)"
        depends on PCI && EXPERIMENTAL
        help
          This option enables support for the NatSemi/AMD SC1200 SoC
          If unsure, say N.
  
  config PATA_SERVERWORKS
 -      tristate "SERVERWORKS OSB4/CSB5/CSB6/HT1000 PATA support (Experimental)"
 -      depends on PCI && EXPERIMENTAL
 +      tristate "SERVERWORKS OSB4/CSB5/CSB6/HT1000 PATA support"
 +      depends on PCI
        help
          This option enables support for the Serverworks OSB4/CSB5/CSB6 and
          HT1000 PATA controllers, via the new ATA layer.
@@@ -550,13 -545,21 +550,21 @@@ config PATA_WINBOND_VL
  
  config PATA_PLATFORM
        tristate "Generic platform device PATA support"
-       depends on EMBEDDED
+       depends on EMBEDDED || ARCH_RPC
        help
          This option enables support for generic directly connected ATA
          devices commonly found on embedded systems.
  
          If unsure, say N.
  
+ config PATA_ICSIDE
+       tristate "Acorn ICS PATA support"
+       depends on ARM && ARCH_ACORN
+       help
+         On Acorn systems, say Y here if you wish to use the ICS PATA
+         interface card.  This is not required for ICS partition support.
+         If you are unsure, say N to this.
  config PATA_IXP4XX_CF
        tristate "IXP4XX Compact Flash support"
        depends on ARCH_IXP4XX
diff --combined drivers/ata/Makefile
@@@ -22,7 -22,6 +22,7 @@@ obj-$(CONFIG_PATA_ALI)                += pata_ali.
  obj-$(CONFIG_PATA_AMD)                += pata_amd.o
  obj-$(CONFIG_PATA_ARTOP)      += pata_artop.o
  obj-$(CONFIG_PATA_ATIIXP)     += pata_atiixp.o
 +obj-$(CONFIG_PATA_CMD640_PCI) += pata_cmd640.o
  obj-$(CONFIG_PATA_CMD64X)     += pata_cmd64x.o
  obj-$(CONFIG_PATA_CS5520)     += pata_cs5520.o
  obj-$(CONFIG_PATA_CS5530)     += pata_cs5530.o
@@@ -62,6 -61,7 +62,7 @@@ obj-$(CONFIG_PATA_TRIFLEX)    += pata_trif
  obj-$(CONFIG_PATA_IXP4XX_CF)  += pata_ixp4xx_cf.o
  obj-$(CONFIG_PATA_SCC)                += pata_scc.o
  obj-$(CONFIG_PATA_PLATFORM)   += pata_platform.o
+ obj-$(CONFIG_PATA_ICSIDE)     += pata_icside.o
  # Should be last but one libata driver
  obj-$(CONFIG_ATA_GENERIC)     += ata_generic.o
  # Should be last libata driver
@@@ -539,18 -539,6 +539,18 @@@ static inline void i2c_pxa_start_messag
        writel(icr | ICR_START | ICR_TB, _ICR(i2c));
  }
  
 +static inline void i2c_pxa_stop_message(struct pxa_i2c *i2c)
 +{
 +      u32 icr;
 +
 +      /*
 +       * Clear the STOP and ACK flags
 +       */
 +      icr = readl(_ICR(i2c));
 +      icr &= ~(ICR_STOP | ICR_ACKNAK);
 +      writel(icr, _IRC(i2c));
 +}
 +
  /*
   * We are protected by the adapter bus mutex.
   */
@@@ -593,7 -581,6 +593,7 @@@ static int i2c_pxa_do_xfer(struct pxa_i
         * The rest of the processing occurs in the interrupt handler.
         */
        timeout = wait_event_timeout(i2c->wait, i2c->msg_num == 0, HZ * 5);
 +      i2c_pxa_stop_message(i2c);
  
        /*
         * We place the return code in i2c->msg_idx.
@@@ -838,7 -825,7 +838,7 @@@ static const struct i2c_algorithm i2c_p
  };
  
  static struct pxa_i2c i2c_pxa = {
 -      .lock   = SPIN_LOCK_UNLOCKED,
 +      .lock   = __SPIN_LOCK_UNLOCKED(i2c_pxa.lock),
        .adap   = {
                .owner          = THIS_MODULE,
                .algo           = &i2c_pxa_algorithm,
@@@ -852,9 -839,7 +852,7 @@@ static int i2c_pxa_probe(struct platfor
  {
        struct pxa_i2c *i2c = &i2c_pxa;
        struct resource *res;
- #ifdef CONFIG_I2C_PXA_SLAVE
        struct i2c_pxa_platform_data *plat = dev->dev.platform_data;
- #endif
        int ret;
        int irq;
  
                pxa_gpio_mode(GPIO117_I2CSCL_MD);
                pxa_gpio_mode(GPIO118_I2CSDA_MD);
  #endif
-               pxa_set_cken(CKEN14_I2C, 1);
+               pxa_set_cken(CKEN_I2C, 1);
                break;
  #ifdef CONFIG_PXA27x
        case 1:
                local_irq_disable();
                PCFR |= PCFR_PI2CEN;
                local_irq_enable();
-               pxa_set_cken(CKEN15_PWRI2C, 1);
+               pxa_set_cken(CKEN_PWRI2C, 1);
  #endif
        }
  
        i2c->adap.algo_data = i2c;
        i2c->adap.dev.parent = &dev->dev;
  
+       if (plat) {
+               i2c->adap.class = plat->class;
+       }
        ret = i2c_add_adapter(&i2c->adap);
        if (ret < 0) {
                printk(KERN_INFO "I2C: Failed to add bus\n");
@@@ -946,11 -935,11 +948,11 @@@ eadapt
  ereqirq:
        switch (dev->id) {
        case 0:
-               pxa_set_cken(CKEN14_I2C, 0);
+               pxa_set_cken(CKEN_I2C, 0);
                break;
  #ifdef CONFIG_PXA27x
        case 1:
-               pxa_set_cken(CKEN15_PWRI2C, 0);
+               pxa_set_cken(CKEN_PWRI2C, 0);
                local_irq_disable();
                PCFR &= ~PCFR_PI2CEN;
                local_irq_enable();
@@@ -973,11 -962,11 +975,11 @@@ static int i2c_pxa_remove(struct platfo
        free_irq(i2c->irq, i2c);
        switch (dev->id) {
        case 0:
-               pxa_set_cken(CKEN14_I2C, 0);
+               pxa_set_cken(CKEN_I2C, 0);
                break;
  #ifdef CONFIG_PXA27x
        case 1:
-               pxa_set_cken(CKEN15_PWRI2C, 0);
+               pxa_set_cken(CKEN_PWRI2C, 0);
                local_irq_disable();
                PCFR &= ~PCFR_PI2CEN;
                local_irq_enable();
@@@ -24,6 -24,7 +24,6 @@@
  #include <linux/interrupt.h>
  #include <linux/dma-mapping.h>
  #include <linux/mmc/host.h>
 -#include <linux/mmc/protocol.h>
  
  #include <asm/dma.h>
  #include <asm/io.h>
@@@ -368,14 -369,14 +368,14 @@@ static void pxamci_set_ios(struct mmc_h
                if (CLOCKRATE / clk > ios->clock)
                        clk <<= 1;
                host->clkrt = fls(clk) - 1;
-               pxa_set_cken(CKEN12_MMC, 1);
+               pxa_set_cken(CKEN_MMC, 1);
  
                /*
                 * we write clkrt on the next command
                 */
        } else {
                pxamci_stop_clock(host);
-               pxa_set_cken(CKEN12_MMC, 0);
+               pxa_set_cken(CKEN_MMC, 0);
        }
  
        if (host->power_mode != ios->power_mode) {
@@@ -134,7 -134,7 +134,7 @@@ static int pxa_irda_set_speed(struct px
                        DCSR(si->rxdma) &= ~DCSR_RUN;
                        /* disable FICP */
                        ICCR0 = 0;
-                       pxa_set_cken(CKEN13_FICP, 0);
+                       pxa_set_cken(CKEN_FICP, 0);
  
                        /* set board transceiver to SIR mode */
                        si->pdata->transceiver_mode(si->dev, IR_SIRMODE);
                        pxa_gpio_mode(GPIO47_STTXD_MD);
  
                        /* enable the STUART clock */
-                       pxa_set_cken(CKEN5_STUART, 1);
+                       pxa_set_cken(CKEN_STUART, 1);
                }
  
                /* disable STUART first */
                /* disable STUART */
                STIER = 0;
                STISR = 0;
-               pxa_set_cken(CKEN5_STUART, 0);
+               pxa_set_cken(CKEN_STUART, 0);
  
                /* disable FICP first */
                ICCR0 = 0;
                pxa_gpio_mode(GPIO47_ICPTXD_MD);
  
                /* enable the FICP clock */
-               pxa_set_cken(CKEN13_FICP, 1);
+               pxa_set_cken(CKEN_FICP, 1);
  
                si->speed = speed;
                pxa_irda_fir_dma_rx_start(si);
@@@ -386,12 -386,12 +386,12 @@@ static void pxa_irda_fir_irq_eif(struc
  
                /* Align IP header to 20 bytes  */
                skb_reserve(skb, 1);
 -              memcpy(skb->data, si->dma_rx_buff, len);
 +              skb_copy_to_linear_data(skb, si->dma_rx_buff, len);
                skb_put(skb, len);
  
                /* Feed it to IrLAP  */
                skb->dev = dev;
 -              skb->mac.raw  = skb->data;
 +              skb_reset_mac_header(skb);
                skb->protocol = htons(ETH_P_IRDA);
                netif_rx(skb);
  
@@@ -484,7 -484,7 +484,7 @@@ static int pxa_irda_hard_xmit(struct sk
                unsigned long mtt = irda_get_mtt(skb);
  
                si->dma_tx_buff_len = skb->len;
 -              memcpy(si->dma_tx_buff, skb->data, skb->len);
 +              skb_copy_from_linear_data(skb, si->dma_tx_buff, skb->len);
  
                if (mtt)
                        while ((unsigned)(OSCR - si->last_oscr)/4 < mtt)
@@@ -593,7 -593,7 +593,7 @@@ static void pxa_irda_shutdown(struct px
        /* disable STUART SIR mode */
        STISR = 0;
        /* disable the STUART clock */
-       pxa_set_cken(CKEN5_STUART, 0);
+       pxa_set_cken(CKEN_STUART, 0);
  
        /* disable DMA */
        DCSR(si->txdma) &= ~DCSR_RUN;
        /* disable FICP */
        ICCR0 = 0;
        /* disable the FICP clock */
-       pxa_set_cken(CKEN13_FICP, 0);
+       pxa_set_cken(CKEN_FICP, 0);
  
        DRCMR17 = 0;
        DRCMR18 = 0;
@@@ -71,7 -71,7 +71,7 @@@
   * by the host to interact with this device, and allocates endpoints to
   * the different protocol interfaces.  The controller driver virtualizes
   * usb hardware so that the gadget drivers will be more portable.
 - * 
 + *
   * This UDC hardware wants to implement a bit too much USB protocol, so
   * it constrains the sorts of USB configuration change events that work.
   * The errata for these chips are misleading; some "fixed" bugs from
@@@ -141,7 -141,7 +141,7 @@@ MODULE_PARM_DESC (fifo_mode, "pxa2xx ud
  #endif
  
  /* ---------------------------------------------------------------------------
 - *    endpoint related parts of the api to the usb controller hardware,
 + *    endpoint related parts of the api to the usb controller hardware,
   *    used by gadget driver; and the inner talker-to-hardware core.
   * ---------------------------------------------------------------------------
   */
@@@ -293,7 -293,7 +293,7 @@@ static int pxa2xx_ep_enable (struct usb
  
  #ifdef        USE_DMA
        /* for (some) bulk and ISO endpoints, try to get a DMA channel and
 -       * bind it to the endpoint.  otherwise use PIO. 
 +       * bind it to the endpoint.  otherwise use PIO.
         */
        switch (ep->bmAttributes) {
        case USB_ENDPOINT_XFER_ISOC:
                if (!use_dma || !ep->reg_drcmr)
                        break;
                ep->dma = pxa_request_dma ((char *)_ep->name,
 -                              (le16_to_cpu (desc->wMaxPacketSize) > 64)
 +                              (le16_to_cpu (desc->wMaxPacketSize) > 64)
                                        ? DMA_PRIO_MEDIUM /* some iso */
                                        : DMA_PRIO_LOW,
                                dma_nodesc_handler, ep);
@@@ -361,7 -361,7 +361,7 @@@ static int pxa2xx_ep_disable (struct us
   */
  
  /*
 - *    pxa2xx_ep_alloc_request - allocate a request data structure
 + *    pxa2xx_ep_alloc_request - allocate a request data structure
   */
  static struct usb_request *
  pxa2xx_ep_alloc_request (struct usb_ep *_ep, gfp_t gfp_flags)
  
  
  /*
 - *    pxa2xx_ep_free_request - deallocate a request data structure
 + *    pxa2xx_ep_free_request - deallocate a request data structure
   */
  static void
  pxa2xx_ep_free_request (struct usb_ep *_ep, struct usb_request *_req)
@@@ -1031,7 -1031,7 +1031,7 @@@ pxa2xx_ep_queue(struct usb_ep *_ep, str
  
  
  /*
 - *    nuke - dequeue ALL requests
 + *    nuke - dequeue ALL requests
   */
  static void nuke(struct pxa2xx_ep *ep, int status)
  {
@@@ -1136,16 -1136,16 +1136,16 @@@ static int pxa2xx_ep_set_halt(struct us
                ep->dev->req_pending = 0;
                ep->dev->ep0state = EP0_STALL;
  
 -      /* and bulk/intr endpoints like dropping stalls too */
 -      } else {
 -              unsigned i;
 -              for (i = 0; i < 1000; i += 20) {
 -                      if (*ep->reg_udccs & UDCCS_BI_SST)
 -                              break;
 -                      udelay(20);
 -              }
 -      }
 -      local_irq_restore(flags);
 +      /* and bulk/intr endpoints like dropping stalls too */
 +      } else {
 +              unsigned i;
 +              for (i = 0; i < 1000; i += 20) {
 +                      if (*ep->reg_udccs & UDCCS_BI_SST)
 +                              break;
 +                      udelay(20);
 +              }
 +      }
 +      local_irq_restore(flags);
  
        DBG(DBG_VERBOSE, "%s halt\n", _ep->name);
        return 0;
@@@ -1216,7 -1216,7 +1216,7 @@@ static struct usb_ep_ops pxa2xx_ep_ops 
  
  
  /* ---------------------------------------------------------------------------
 - *    device-scoped parts of the api to the usb controller hardware
 + *    device-scoped parts of the api to the usb controller hardware
   * ---------------------------------------------------------------------------
   */
  
@@@ -1239,7 -1239,7 +1239,7 @@@ static void udc_enable (struct pxa2xx_u
  static void udc_disable(struct pxa2xx_udc *);
  
  /* We disable the UDC -- and its 48 MHz clock -- whenever it's not
 - * in active use.  
 + * in active use.
   */
  static int pullup(struct pxa2xx_udc *udc, int is_active)
  {
@@@ -1464,10 -1464,24 +1464,10 @@@ done
  
  #endif        /* CONFIG_USB_GADGET_DEBUG_FILES */
  
 -/* "function" sysfs attribute */
 -static ssize_t
 -show_function (struct device *_dev, struct device_attribute *attr, char *buf)
 -{
 -      struct pxa2xx_udc       *dev = dev_get_drvdata (_dev);
 -
 -      if (!dev->driver
 -                      || !dev->driver->function
 -                      || strlen (dev->driver->function) > PAGE_SIZE)
 -              return 0;
 -      return scnprintf (buf, PAGE_SIZE, "%s\n", dev->driver->function);
 -}
 -static DEVICE_ATTR (function, S_IRUGO, show_function, NULL);
 -
  /*-------------------------------------------------------------------------*/
  
  /*
 - *    udc_disable - disable USB device controller
 + *    udc_disable - disable USB device controller
   */
  static void udc_disable(struct pxa2xx_udc *dev)
  {
  
  #ifdef        CONFIG_ARCH_PXA
          /* Disable clock for USB device */
-       pxa_set_cken(CKEN11_USB, 0);
+       pxa_set_cken(CKEN_USB, 0);
  #endif
  
        ep0_idle (dev);
  
  
  /*
 - *    udc_reinit - initialize software state
 + *    udc_reinit - initialize software state
   */
  static void udc_reinit(struct pxa2xx_udc *dev)
  {
@@@ -1529,7 -1543,7 +1529,7 @@@ static void udc_enable (struct pxa2xx_u
  
  #ifdef        CONFIG_ARCH_PXA
          /* Enable clock for USB device */
-       pxa_set_cken(CKEN11_USB, 1);
+       pxa_set_cken(CKEN_USB, 1);
        udelay(5);
  #endif
  
@@@ -1621,20 -1635,18 +1621,20 @@@ int usb_gadget_register_driver(struct u
        dev->gadget.dev.driver = &driver->driver;
        dev->pullup = 1;
  
 -      device_add (&dev->gadget.dev);
 +      retval = device_add (&dev->gadget.dev);
 +      if (retval) {
 +fail:
 +              dev->driver = NULL;
 +              dev->gadget.dev.driver = NULL;
 +              return retval;
 +      }
        retval = driver->bind(&dev->gadget);
        if (retval) {
                DMSG("bind to driver %s --> error %d\n",
                                driver->driver.name, retval);
                device_del (&dev->gadget.dev);
 -
 -              dev->driver = NULL;
 -              dev->gadget.dev.driver = NULL;
 -              return retval;
 +              goto fail;
        }
 -      device_create_file(dev->dev, &dev_attr_function);
  
        /* ... then enable host detection and ep0; and we're ready
         * for set_configuration as well as eventual disconnect.
@@@ -1692,6 -1704,7 +1692,6 @@@ int usb_gadget_unregister_driver(struc
        dev->driver = NULL;
  
        device_del (&dev->gadget.dev);
 -      device_remove_file(dev->dev, &dev_attr_function);
  
        DMSG("unregistered gadget driver '%s'\n", driver->driver.name);
        dump_state(dev);
@@@ -2461,12 -2474,12 +2461,12 @@@ static struct pxa2xx_udc memory = 
  #define IXP465_AD             0x00000200
  
  /*
 - *    probe - binds to the platform device
 + *    probe - binds to the platform device
   */
  static int __init pxa2xx_udc_probe(struct platform_device *pdev)
  {
        struct pxa2xx_udc *dev = &memory;
 -      int retval, out_dma = 1, vbus_irq;
 +      int retval, out_dma = 1, vbus_irq, irq;
        u32 chiprev;
  
        /* insist on Intel/ARM/XScale */
                return -ENODEV;
        }
  
 -      pr_debug("%s: IRQ %d%s%s%s\n", driver_name, IRQ_USB,
 +      irq = platform_get_irq(pdev, 0);
 +      if (irq < 0)
 +              return -ENODEV;
 +
 +      pr_debug("%s: IRQ %d%s%s%s\n", driver_name, irq,
                dev->has_cfr ? "" : " (!cfr)",
                out_dma ? "" : " (broken dma-out)",
                SIZE_STR DMASTR
        dev->vbus = is_vbus_present();
  
        /* irq setup after old hardware state is cleaned up */
 -      retval = request_irq(IRQ_USB, pxa2xx_udc_irq,
 +      retval = request_irq(irq, pxa2xx_udc_irq,
                        IRQF_DISABLED, driver_name, dev);
        if (retval != 0) {
 -              printk(KERN_ERR "%s: can't get irq %i, err %d\n",
 -                      driver_name, IRQ_USB, retval);
 +              printk(KERN_ERR "%s: can't get irq %d, err %d\n",
 +                      driver_name, irq, retval);
                return -EBUSY;
        }
        dev->got_irq = 1;
                        printk(KERN_ERR "%s: can't get irq %i, err %d\n",
                                driver_name, LUBBOCK_USB_DISC_IRQ, retval);
  lubbock_fail0:
 -                      free_irq(IRQ_USB, dev);
 +                      free_irq(irq, dev);
                        return -EBUSY;
                }
                retval = request_irq(LUBBOCK_USB_IRQ,
                if (retval != 0) {
                        printk(KERN_ERR "%s: can't get irq %i, err %d\n",
                                driver_name, vbus_irq, retval);
 -                      free_irq(IRQ_USB, dev);
 +                      free_irq(irq, dev);
                        return -EBUSY;
                }
        }
@@@ -2632,7 -2641,7 +2632,7 @@@ static int __exit pxa2xx_udc_remove(str
        remove_proc_files();
  
        if (dev->got_irq) {
 -              free_irq(IRQ_USB, dev);
 +              free_irq(platform_get_irq(pdev, 0), dev);
                dev->got_irq = 0;
        }
  #ifdef CONFIG_ARCH_LUBBOCK
   *
   * For now, we punt and forcibly disconnect from the USB host when PXA
   * enters any suspend state.  While we're disconnected, we always disable
 - * the 48MHz USB clock ... allowing PXA sleep and/or 33 MHz idle states. 
 + * the 48MHz USB clock ... allowing PXA sleep and/or 33 MHz idle states.
   * Boards without software pullup control shouldn't use those states.
   * VBUS IRQs should probably be ignored so that the PXA device just acts
   * "dead" to USB hosts until system resume.
@@@ -2692,6 -2701,7 +2692,6 @@@ static int pxa2xx_udc_resume(struct pla
  /*-------------------------------------------------------------------------*/
  
  static struct platform_driver udc_driver = {
 -      .probe          = pxa2xx_udc_probe,
        .shutdown       = pxa2xx_udc_shutdown,
        .remove         = __exit_p(pxa2xx_udc_remove),
        .suspend        = pxa2xx_udc_suspend,
  static int __init udc_init(void)
  {
        printk(KERN_INFO "%s: version %s\n", driver_name, DRIVER_VERSION);
 -      return platform_driver_register(&udc_driver);
 +      return platform_driver_probe(&udc_driver, pxa2xx_udc_probe);
  }
  module_init(udc_init);