Merge branch 'devel' of master.kernel.org:/home/rmk/linux-2.6-serial
authorLinus Torvalds <torvalds@g5.osdl.org>
Tue, 4 Jul 2006 04:31:05 +0000 (21:31 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 4 Jul 2006 04:31:05 +0000 (21:31 -0700)
* 'devel' of master.kernel.org:/home/rmk/linux-2.6-serial:
  [SERIAL] Ensure 8250_pci quirks are not marked __devinit
  [SERIAL] Convert fifosize to an unsigned int

1  2 
drivers/serial/8250_pci.c
drivers/serial/mpc52xx_uart.c
drivers/serial/serial_core.c
include/linux/serial_core.h

@@@ -134,7 -134,7 +134,7 @@@ afavlab_setup(struct serial_private *pr
   * and Keystone have one Diva chip with 3 UARTs.  Some later machines have
   * one Diva chip, but it has been expanded to 5 UARTs.
   */
- static int __devinit pci_hp_diva_init(struct pci_dev *dev)
+ static int pci_hp_diva_init(struct pci_dev *dev)
  {
        int rc = 0;
  
@@@ -194,7 -194,7 +194,7 @@@ pci_hp_diva_setup(struct serial_privat
  /*
   * Added for EKF Intel i960 serial boards
   */
- static int __devinit pci_inteli960ni_init(struct pci_dev *dev)
+ static int pci_inteli960ni_init(struct pci_dev *dev)
  {
        unsigned long oldval;
  
   * seems to be mainly needed on card using the PLX which also use I/O
   * mapped memory.
   */
- static int __devinit pci_plx9050_init(struct pci_dev *dev)
+ static int pci_plx9050_init(struct pci_dev *dev)
  {
        u8 irq_config;
        void __iomem *p;
@@@ -314,7 -314,7 +314,7 @@@ sbs_setup(struct serial_private *priv, 
  /* global control register offset for SBS PMC-OctalPro */
  #define OCT_REG_CR_OFF                0x500
  
- static int __devinit sbs_init(struct pci_dev *dev)
+ static int sbs_init(struct pci_dev *dev)
  {
        u8 __iomem *p;
  
@@@ -493,7 -493,7 +493,7 @@@ static const struct timedia_struct 
        { 0, NULL }
  };
  
- static int __devinit pci_timedia_init(struct pci_dev *dev)
+ static int pci_timedia_init(struct pci_dev *dev)
  {
        unsigned short *ids;
        int i, j;
@@@ -566,13 -566,13 +566,13 @@@ titan_400l_800l_setup(struct serial_pri
        return setup_port(priv, port, bar, offset, board->reg_shift);
  }
  
- static int __devinit pci_xircom_init(struct pci_dev *dev)
+ static int pci_xircom_init(struct pci_dev *dev)
  {
        msleep(100);
        return 0;
  }
  
- static int __devinit pci_netmos_init(struct pci_dev *dev)
+ static int pci_netmos_init(struct pci_dev *dev)
  {
        /* subdevice 0x00PS means <P> parallel, <S> serial */
        unsigned int num_serial = dev->subsystem_device & 0xf;
@@@ -594,8 -594,8 +594,8 @@@ pci_default_setup(struct serial_privat
        else
                offset += idx * board->uart_offset;
  
 -      maxnr = (pci_resource_len(priv->dev, bar) - board->first_offset) /
 -              (8 << board->reg_shift);
 +      maxnr = (pci_resource_len(priv->dev, bar) - board->first_offset) >>
 +              (board->reg_shift + 3);
  
        if (board->flags & FL_REGION_SZ_CAP && idx >= maxnr)
                return 1;
   */
  static struct pci_serial_quirk pci_serial_quirks[] = {
        /*
-        * AFAVLAB cards.
+        * AFAVLAB cards - these may be called via parport_serial
         *  It is not clear whether this applies to all products.
         */
        {
                .exit           = __devexit_p(sbs_exit),
        },
        /*
-        * SIIG cards.
+        * SIIG cards - these may be called via parport_serial
         */
        {
                .vendor         = PCI_VENDOR_ID_SIIG,
                .setup          = pci_default_setup,
        },
        /*
-        * Netmos cards
+        * Netmos cards - these may be called via parport_serial
         */
        {
                .vendor         = PCI_VENDOR_ID_NETMOS,
@@@ -44,6 -44,7 +44,6 @@@
   * will be mapped to.
   */
  
 -#include <linux/config.h>
  #include <linux/platform_device.h>
  #include <linux/module.h>
  #include <linux/tty.h>
@@@ -190,7 -191,7 +190,7 @@@ mpc52xx_uart_startup(struct uart_port *
  
        /* Request IRQ */
        ret = request_irq(port->irq, mpc52xx_uart_int,
 -              SA_INTERRUPT | SA_SAMPLE_RANDOM, "mpc52xx_psc_uart", port);
 +              IRQF_DISABLED | IRQF_SAMPLE_RANDOM, "mpc52xx_psc_uart", port);
        if (ret)
                return ret;
  
@@@ -692,6 -693,7 +692,6 @@@ static struct uart_driver mpc52xx_uart_
        .owner          = THIS_MODULE,
        .driver_name    = "mpc52xx_psc_uart",
        .dev_name       = "ttyPSC",
 -      .devfs_name     = "ttyPSC",
        .major          = SERIAL_PSC_MAJOR,
        .minor          = SERIAL_PSC_MINOR,
        .nr             = MPC52xx_PSC_MAXNUM,
@@@ -726,8 -728,7 +726,7 @@@ mpc52xx_uart_probe(struct platform_devi
  
        spin_lock_init(&port->lock);
        port->uartclk   = __res.bi_ipbfreq / 2; /* Look at CTLR doc */
-       port->fifosize  = 255; /* Should be 512 ! But it can't be */
-                              /* stored in a unsigned char       */
+       port->fifosize  = 512;
        port->iotype    = UPIO_MEM;
        port->flags     = UPF_BOOT_AUTOCONF |
                          ( uart_console(port) ? 0 : UPF_IOREMAP );
@@@ -22,6 -22,7 +22,6 @@@
   * along with this program; if not, write to the Free Software
   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   */
 -#include <linux/config.h>
  #include <linux/module.h>
  #include <linux/tty.h>
  #include <linux/slab.h>
   */
  static DEFINE_MUTEX(port_mutex);
  
 +/*
 + * lockdep: port->lock is initialized in two places, but we
 + *          want only one lock-class:
 + */
 +static struct lock_class_key port_lock_key;
 +
  #define HIGH_BITS_OFFSET      ((sizeof(long)-sizeof(int))*8)
  
  #define uart_users(state)     ((state)->count + ((state)->info ? (state)->info->blocked_open : 0))
@@@ -696,7 -691,8 +696,8 @@@ static int uart_set_info(struct uart_st
                    (new_serial.baud_base != port->uartclk / 16) ||
                    (close_delay != state->close_delay) ||
                    (closing_wait != state->closing_wait) ||
-                   (new_serial.xmit_fifo_size != port->fifosize) ||
+                   (new_serial.xmit_fifo_size &&
+                    new_serial.xmit_fifo_size != port->fifosize) ||
                    (((new_flags ^ old_flags) & ~UPF_USR_MASK) != 0))
                        goto exit;
                port->flags = ((port->flags & ~UPF_USR_MASK) |
        port->custom_divisor   = new_serial.custom_divisor;
        state->close_delay     = close_delay;
        state->closing_wait    = closing_wait;
-       port->fifosize         = new_serial.xmit_fifo_size;
+       if (new_serial.xmit_fifo_size)
+               port->fifosize = new_serial.xmit_fifo_size;
        if (state->info->tty)
                state->info->tty->low_latency =
                        (port->flags & UPF_LOW_LATENCY) ? 1 : 0;
@@@ -1871,7 -1868,6 +1873,7 @@@ uart_set_options(struct uart_port *port
         * early.
         */
        spin_lock_init(&port->lock);
 +      lockdep_set_class(&port->lock, &port_lock_key);
  
        memset(&termios, 0, sizeof(struct termios));
  
@@@ -2159,6 -2155,7 +2161,6 @@@ int uart_register_driver(struct uart_dr
  
        normal->owner           = drv->owner;
        normal->driver_name     = drv->driver_name;
 -      normal->devfs_name      = drv->devfs_name;
        normal->name            = drv->dev_name;
        normal->major           = drv->major;
        normal->minor_start     = drv->minor;
        normal->subtype         = SERIAL_TYPE_NORMAL;
        normal->init_termios    = tty_std_termios;
        normal->init_termios.c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL;
 -      normal->flags           = TTY_DRIVER_REAL_RAW | TTY_DRIVER_NO_DEVFS;
 +      normal->flags           = TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
        normal->driver_state    = drv;
        tty_set_operations(normal, &uart_ops);
  
@@@ -2254,10 -2251,8 +2256,10 @@@ int uart_add_one_port(struct uart_drive
         * If this port is a console, then the spinlock is already
         * initialised.
         */
 -      if (!(uart_console(port) && (port->cons->flags & CON_ENABLED)))
 +      if (!(uart_console(port) && (port->cons->flags & CON_ENABLED))) {
                spin_lock_init(&port->lock);
 +              lockdep_set_class(&port->lock, &port_lock_key);
 +      }
  
        uart_configure_port(drv, state, port);
  
@@@ -2319,7 -2314,7 +2321,7 @@@ int uart_remove_one_port(struct uart_dr
        mutex_unlock(&state->mutex);
  
        /*
 -       * Remove the devices from devfs
 +       * Remove the devices from the tty layer
         */
        tty_unregister_device(drv->tty_driver, port->line);
  
@@@ -67,8 -67,8 +67,8 @@@
  /* Parisc type numbers. */
  #define PORT_MUX      48
  
 -/* Atmel AT91RM9200 SoC */
 -#define PORT_AT91RM9200 49
 +/* Atmel AT91xxx SoC */
 +#define PORT_AT91     49
  
  /* Macintosh Zilog type numbers */
  #define PORT_MAC_ZILOG        50      /* m68k : not yet implemented */
  /* SUN4V Hypervisor Console */
  #define PORT_SUNHV    72
  
 +#define PORT_S3C2412  73
 +
 +
  #ifdef __KERNEL__
  
 -#include <linux/config.h>
  #include <linux/compiler.h>
  #include <linux/interrupt.h>
  #include <linux/circ_buf.h>
@@@ -216,10 -214,11 +216,11 @@@ struct uart_port 
        unsigned char __iomem   *membase;               /* read/write[bwl] */
        unsigned int            irq;                    /* irq number */
        unsigned int            uartclk;                /* base uart clock */
-       unsigned char           fifosize;               /* tx fifo size */
+       unsigned int            fifosize;               /* tx fifo size */
        unsigned char           x_char;                 /* xon/xoff char */
        unsigned char           regshift;               /* reg offset shift */
        unsigned char           iotype;                 /* io access style */
+       unsigned char           unused1;
  
  #define UPIO_PORT             (0)
  #define UPIO_HUB6             (1)
@@@ -336,6 -335,7 +337,6 @@@ struct uart_driver 
        struct module           *owner;
        const char              *driver_name;
        const char              *dev_name;
 -      const char              *devfs_name;
        int                      major;
        int                      minor;
        int                      nr;