]> Pileus Git - ~andy/linux/commitdiff
Merge tag 'tty-3.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 11 Dec 2012 22:08:47 +0000 (14:08 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 11 Dec 2012 22:08:47 +0000 (14:08 -0800)
Pull TTY/Serial merge from Greg Kroah-Hartman:
 "Here's the big tty/serial tree set of changes for 3.8-rc1.

  Contained in here is a bunch more reworks of the tty port layer from
  Jiri and bugfixes from Alan, along with a number of other tty and
  serial driver updates by the various driver authors.

  Also, Jiri has been coerced^Wconvinced to be the co-maintainer of the
  TTY layer, which is much appreciated by me.

  All of these have been in the linux-next tree for a while.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
Fixed up some trivial conflicts in the staging tree, due to the fwserial
driver having come in both ways (but fixed up a bit in the serial tree),
and the ioctl handling in the dgrp driver having been done slightly
differently (staging tree got that one right, and removed both
TIOCGSOFTCAR and TIOCSSOFTCAR).

* tag 'tty-3.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (146 commits)
  staging: sb105x: fix potential NULL pointer dereference in mp_chars_in_buffer()
  staging/fwserial: Remove superfluous free
  staging/fwserial: Use WARN_ONCE when port table is corrupted
  staging/fwserial: Destruct embedded tty_port on teardown
  staging/fwserial: Fix build breakage when !CONFIG_BUG
  staging: fwserial: Add TTY-over-Firewire serial driver
  drivers/tty/serial/serial_core.c: clean up HIGH_BITS_OFFSET usage
  staging: dgrp: dgrp_tty.c: Audit the return values of get/put_user()
  staging: dgrp: dgrp_tty.c: Remove the TIOCSSOFTCAR ioctl handler from dgrp driver
  serial: ifx6x60: Add modem power off function in the platform reboot process
  serial: mxs-auart: unmap the scatter list before we copy the data
  serial: mxs-auart: disable the Receive Timeout Interrupt when DMA is enabled
  serial: max310x: Setup missing "can_sleep" field for GPIO
  tty/serial: fix ifx6x60.c declaration warning
  serial: samsung: add devicetree properties for non-Exynos SoCs
  serial: samsung: fix potential soft lockup during uart write
  tty: vt: Remove redundant null check before kfree.
  tty/8250 Add check for pci_ioremap_bar failure
  tty/8250 Add support for Commtech's Fastcom Async-335 and Fastcom Async-PCIe cards
  tty/8250 Add XR17D15x devices to the exar_handle_irq override
  ...

1  2 
MAINTAINERS
arch/x86/platform/ce4100/ce4100.c
drivers/ipack/devices/ipoctal.c
drivers/misc/pti.c
drivers/staging/Kconfig
drivers/staging/Makefile
drivers/staging/dgrp/dgrp_net_ops.c
drivers/staging/dgrp/dgrp_sysfs.c
drivers/staging/dgrp/dgrp_tty.c
drivers/tty/serial/atmel_serial.c
drivers/tty/vt/vt.c

diff --combined MAINTAINERS
index 1ea0eba7ee22940657d9dd5a246c511affcd6719,4513948c9e207b1387ec3c0e1882ebc3f759ba92..b68c3a10006c93c4b254a47629ae231101e1157a
@@@ -526,17 -526,17 +526,17 @@@ F:      drivers/video/geode
  F:    arch/x86/include/asm/geode.h
  
  AMD IOMMU (AMD-VI)
 -M:    Joerg Roedel <joerg.roedel@amd.com>
 +M:    Joerg Roedel <joro@8bytes.org>
  L:    iommu@lists.linux-foundation.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git
 -S:    Supported
 +S:    Maintained
  F:    drivers/iommu/amd_iommu*.[ch]
  F:    include/linux/amd-iommu.h
  
  AMD MICROCODE UPDATE SUPPORT
 -M:    Andreas Herrmann <andreas.herrmann3@amd.com>
 +M:    Andreas Herrmann <herrmann.der.user@googlemail.com>
  L:    amd64-microcode@amd64.org
 -S:    Supported
 +S:    Maintained
  F:    arch/x86/kernel/microcode_amd.c
  
  AMS (Apple Motion Sensor) DRIVER
@@@ -841,14 -841,6 +841,14 @@@ T:       git git://git.kernel.org/pub/scm/lin
  F:    arch/arm/mach-sa1100/jornada720.c
  F:    arch/arm/mach-sa1100/include/mach/jornada720.h
  
 +ARM/IGEP MACHINE SUPPORT
 +M:    Enric Balletbo i Serra <eballetbo@gmail.com>
 +M:    Javier Martinez Canillas <javier@dowhile0.org>
 +L:    linux-omap@vger.kernel.org
 +L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 +S:    Maintained
 +F:    arch/arm/mach-omap2/board-igep0020.c
 +
  ARM/INCOME PXA270 SUPPORT
  M:    Marek Vasut <marek.vasut@gmail.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -1237,7 -1229,6 +1237,7 @@@ F:      drivers/video/wm8505fb
  F:    drivers/video/wmt_ge_rops.*
  F:    drivers/tty/serial/vt8500_serial.c
  F:    drivers/rtc/rtc-vt8500-c
 +F:    drivers/mmc/host/wmt-sdmmc.c
  
  ARM/ZIPIT Z2 SUPPORT
  M:    Marek Vasut <marek.vasut@gmail.com>
@@@ -1369,6 -1360,14 +1369,6 @@@ S:     Maintaine
  F:    drivers/atm/
  F:    include/linux/atm*
  
 -ATMEL AT91 MCI DRIVER
 -M:    Ludovic Desroches <ludovic.desroches@atmel.com>
 -L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 -W:    http://www.atmel.com/products/AT91/
 -W:    http://www.at91.com/
 -S:    Maintained
 -F:    drivers/mmc/host/at91_mci.c
 -
  ATMEL AT91 / AT32 MCI DRIVER
  M:    Ludovic Desroches <ludovic.desroches@atmel.com>
  S:    Maintained
@@@ -1987,6 -1986,7 +1987,6 @@@ F:      fs/coda
  F:    include/linux/coda*.h
  
  COMMON CLK FRAMEWORK
 -M:    Mike Turquette <mturquette@ti.com>
  M:    Mike Turquette <mturquette@linaro.org>
  L:    linux-arm-kernel@lists.infradead.org (same as CLK API & CLKDEV)
  T:    git git://git.linaro.org/people/mturquette/linux.git
@@@ -2708,10 -2708,10 +2708,10 @@@ F:   include/linux/edac.
  
  EDAC-AMD64
  M:    Doug Thompson <dougthompson@xmission.com>
 -M:    Borislav Petkov <borislav.petkov@amd.com>
 +M:    Borislav Petkov <bp@alien8.de>
  L:    linux-edac@vger.kernel.org
  W:    bluesmoke.sourceforge.net
 -S:    Supported
 +S:    Maintained
  F:    drivers/edac/amd64_edac*
  
  EDAC-E752X
@@@ -3596,6 -3596,7 +3596,6 @@@ S:      Maintaine
  F:    drivers/hv/
  F:    drivers/hid/hid-hyperv.c
  F:    drivers/net/hyperv/
 -F:    drivers/staging/hv/
  
  I2C OVER PARALLEL PORT
  M:    Jean Delvare <khali@linux-fr.org>
@@@ -3752,7 -3753,7 +3752,7 @@@ S:      Maintaine
  F:    drivers/platform/x86/ideapad-laptop.c
  
  IDE/ATAPI DRIVERS
 -M:    Borislav Petkov <petkovbb@gmail.com>
 +M:    Borislav Petkov <bp@alien8.de>
  L:    linux-ide@vger.kernel.org
  S:    Maintained
  F:    Documentation/cdrom/ide-cd
@@@ -3788,15 -3789,6 +3788,15 @@@ M:    Stanislaw Gruszka <stf_xl@wp.pl
  S:    Maintained
  F:    drivers/usb/atm/ueagle-atm.c
  
 +INDUSTRY PACK SUBSYSTEM (IPACK)
 +M:    Samuel Iglesias Gonsalvez <siglesias@igalia.com>
 +M:    Jens Taprogge <jens.taprogge@taprogge.org>
 +M:    Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 +L:    industrypack-devel@lists.sourceforge.net
 +W:    http://industrypack.sourceforge.net
 +S:    Maintained
 +F:    drivers/ipack/
 +
  INTEGRITY MEASUREMENT ARCHITECTURE (IMA)
  M:    Mimi Zohar <zohar@us.ibm.com>
  S:    Supported
@@@ -4288,8 -4280,8 +4288,8 @@@ F:      include/linux/lockd
  F:    include/linux/sunrpc/
  
  KERNEL VIRTUAL MACHINE (KVM)
 -M:    Avi Kivity <avi@redhat.com>
  M:    Marcelo Tosatti <mtosatti@redhat.com>
 +M:    Gleb Natapov <gleb@redhat.com>
  L:    kvm@vger.kernel.org
  W:    http://kvm.qumranet.com
  S:    Supported
@@@ -5421,7 -5413,7 +5421,7 @@@ S:      Maintaine
  F:    sound/drivers/opl4/
  
  OPROFILE
 -M:    Robert Richter <robert.richter@amd.com>
 +M:    Robert Richter <rric@kernel.org>
  L:    oprofile-list@lists.sf.net
  S:    Maintained
  F:    arch/*/include/asm/oprofile*.h
@@@ -5696,12 -5688,6 +5696,12 @@@ S:    Maintaine
  F:    drivers/pinctrl/
  F:    include/linux/pinctrl/
  
 +PIN CONTROLLER - ATMEL AT91
 +M:    Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
 +L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
 +S:    Maintained
 +F:    drivers/pinctrl/pinctrl-at91.c
 +
  PIN CONTROLLER - ST SPEAR
  M:    Viresh Kumar <viresh.linux@gmail.com>
  L:    spear-devel@list.st.com
@@@ -7430,6 -7416,7 +7430,7 @@@ K:      ^Subject:.*(?i)trivia
  
  TTY LAYER
  M:    Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+ M:    Jiri Slaby <jslaby@suse.cz>
  S:    Supported
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git
  F:    drivers/tty/
@@@ -8212,7 -8199,7 +8213,7 @@@ F:      drivers/platform/x8
  
  X86 MCE INFRASTRUCTURE
  M:    Tony Luck <tony.luck@intel.com>
 -M:    Borislav Petkov <bp@amd64.org>
 +M:    Borislav Petkov <bp@alien8.de>
  L:    linux-edac@vger.kernel.org
  S:    Maintained
  F:    arch/x86/kernel/cpu/mcheck/*
index 92525cb8e54c84c0ebe6b2caeacb47f4f8ab299b,0dcc30e9df8cde01308f81e3bf343871a47e16ff..f8ab4945892ee8f484006e568c1def8f1beff8bd
  #include <asm/i8259.h>
  #include <asm/io.h>
  #include <asm/io_apic.h>
 +#include <asm/emergency-restart.h>
  
  static int ce4100_i8042_detect(void)
  {
        return 0;
  }
  
 +/*
 + * The CE4100 platform has an internal 8051 Microcontroller which is
 + * responsible for signaling to the external Power Management Unit the
 + * intention to reset, reboot or power off the system. This 8051 device has
 + * its command register mapped at I/O port 0xcf9 and the value 0x4 is used
 + * to power off the system.
 + */
 +static void ce4100_power_off(void)
 +{
 +      outb(0x4, 0xcf9);
 +}
 +
  #ifdef CONFIG_SERIAL_8250
  
  static unsigned int mem_serial_in(struct uart_port *p, int offset)
@@@ -105,8 -92,11 +105,11 @@@ static void ce4100_serial_fixup(int por
                up->membase =
                        (void __iomem *)__fix_to_virt(FIX_EARLYCON_MEM_BASE);
                up->membase += up->mapbase & ~PAGE_MASK;
+               up->mapbase += port * 0x100;
+               up->membase += port * 0x100;
                up->iotype   = UPIO_MEM32;
                up->regshift = 2;
+               up->irq = 4;
        }
  #endif
        up->iobase = 0;
@@@ -152,19 -142,8 +155,19 @@@ void __init x86_ce4100_early_setup(void
        x86_init.mpparse.find_smp_config = x86_init_noop;
        x86_init.pci.init = ce4100_pci_init;
  
 +      /*
 +       * By default, the reboot method is ACPI which is supported by the
 +       * CE4100 bootloader CEFDK using FADT.ResetReg Address and ResetValue
 +       * the bootloader will however issue a system power off instead of
 +       * reboot. By using BOOT_KBD we ensure proper system reboot as
 +       * expected.
 +       */
 +      reboot_type = BOOT_KBD;
 +
  #ifdef CONFIG_X86_IO_APIC
        x86_init.pci.init_irq = sdv_pci_init;
        x86_init.mpparse.setup_ioapic_ids = setup_ioapic_ids_from_mpc_nocheck;
  #endif
 +
 +      pm_power_off = ce4100_power_off;
  }
index c06ab396e84f4a7c60642f388712f1e59070f7cd,729cb642840ad97872562695470d7fc73ee866ad..576d53d926776cd270ce4572e6a3e0a1d48857f0
@@@ -2,10 -2,9 +2,10 @@@
   * ipoctal.c
   *
   * driver for the GE IP-OCTAL boards
 - * Copyright (c) 2009 Nicolas Serafini, EIC2 SA
 - * Copyright (c) 2010,2011 Samuel Iglesias Gonsalvez <siglesia@cern.ch>, CERN
 - * Copyright (c) 2012 Samuel Iglesias Gonsalvez <siglesias@igalia.com>, Igalia
 + *
 + * Copyright (C) 2009-2012 CERN (www.cern.ch)
 + * Author: Nicolas Serafini, EIC2 SA
 + * Author: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
   *
   * This program is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License as published by the Free
@@@ -22,7 -21,7 +22,7 @@@
  #include <linux/slab.h>
  #include <linux/atomic.h>
  #include <linux/io.h>
 -#include "../ipack.h"
 +#include <linux/ipack.h>
  #include "ipoctal.h"
  #include "scc2698.h"
  
@@@ -54,8 -53,6 +54,8 @@@ struct ipoctal 
        struct ipoctal_channel          channel[NR_CHANNELS];
        unsigned char                   write;
        struct tty_driver               *tty_drv;
 +      u8 __iomem                      *mem8_space;
 +      u8 __iomem                      *int_space;
  };
  
  static int ipoctal_port_activate(struct tty_port *port, struct tty_struct *tty)
@@@ -255,12 -252,35 +255,12 @@@ static irqreturn_t ipoctal_irq_handler(
                ipoctal_irq_channel(&ipoctal->channel[i]);
  
        /* Clear the IPack device interrupt */
 -      readw(ipoctal->dev->int_space.address + ACK_INT_REQ0);
 -      readw(ipoctal->dev->int_space.address + ACK_INT_REQ1);
 +      readw(ipoctal->int_space + ACK_INT_REQ0);
 +      readw(ipoctal->int_space + ACK_INT_REQ1);
  
        return IRQ_HANDLED;
  }
  
 -static int ipoctal_check_model(struct ipack_device *dev, unsigned char *id)
 -{
 -      unsigned char manufacturerID;
 -      unsigned char board_id;
 -
 -
 -      manufacturerID = ioread8(dev->id_space.address + IPACK_IDPROM_OFFSET_MANUFACTURER_ID);
 -      if (manufacturerID != IPACK1_VENDOR_ID_SBS)
 -              return -ENODEV;
 -      board_id = ioread8(dev->id_space.address + IPACK_IDPROM_OFFSET_MODEL);
 -      switch (board_id) {
 -      case IPACK1_DEVICE_ID_SBS_OCTAL_232:
 -      case IPACK1_DEVICE_ID_SBS_OCTAL_422:
 -      case IPACK1_DEVICE_ID_SBS_OCTAL_485:
 -              *id = board_id;
 -              break;
 -      default:
 -              return -ENODEV;
 -      }
 -
 -      return 0;
 -}
 -
  static const struct tty_port_operations ipoctal_tty_port_ops = {
        .dtr_rts = NULL,
        .activate = ipoctal_port_activate,
  static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr,
                             unsigned int slot)
  {
 -      int res = 0;
 +      int res;
        int i;
        struct tty_driver *tty;
        char name[20];
 -      unsigned char board_id;
        struct ipoctal_channel *channel;
 +      struct ipack_region *region;
 +      void __iomem *addr;
        union scc2698_channel __iomem *chan_regs;
        union scc2698_block __iomem *block_regs;
  
 -      res = ipoctal->dev->bus->ops->map_space(ipoctal->dev, 0,
 -                                              IPACK_ID_SPACE);
 -      if (res) {
 -              dev_err(&ipoctal->dev->dev,
 -                      "Unable to map slot [%d:%d] ID space!\n",
 -                      bus_nr, slot);
 -              return res;
 -      }
 -
 -      res = ipoctal_check_model(ipoctal->dev, &board_id);
 -      if (res) {
 -              ipoctal->dev->bus->ops->unmap_space(ipoctal->dev,
 -                                                  IPACK_ID_SPACE);
 -              goto out_unregister_id_space;
 -      }
 -      ipoctal->board_id = board_id;
 +      ipoctal->board_id = ipoctal->dev->id_device;
  
 -      res = ipoctal->dev->bus->ops->map_space(ipoctal->dev, 0,
 -                                              IPACK_IO_SPACE);
 -      if (res) {
 +      region = &ipoctal->dev->region[IPACK_IO_SPACE];
 +      addr = devm_ioremap_nocache(&ipoctal->dev->dev,
 +                                  region->start, region->size);
 +      if (!addr) {
                dev_err(&ipoctal->dev->dev,
                        "Unable to map slot [%d:%d] IO space!\n",
                        bus_nr, slot);
 -              goto out_unregister_id_space;
 +              return -EADDRNOTAVAIL;
        }
 +      /* Save the virtual address to access the registers easily */
 +      chan_regs =
 +              (union scc2698_channel __iomem *) addr;
 +      block_regs =
 +              (union scc2698_block __iomem *) addr;
  
 -      res = ipoctal->dev->bus->ops->map_space(ipoctal->dev, 0,
 -                                              IPACK_INT_SPACE);
 -      if (res) {
 +      region = &ipoctal->dev->region[IPACK_INT_SPACE];
 +      ipoctal->int_space =
 +              devm_ioremap_nocache(&ipoctal->dev->dev,
 +                                   region->start, region->size);
 +      if (!ipoctal->int_space) {
                dev_err(&ipoctal->dev->dev,
                        "Unable to map slot [%d:%d] INT space!\n",
                        bus_nr, slot);
 -              goto out_unregister_io_space;
 +              return -EADDRNOTAVAIL;
        }
  
 -      res = ipoctal->dev->bus->ops->map_space(ipoctal->dev,
 -                                         0x8000, IPACK_MEM_SPACE);
 -      if (res) {
 +      region = &ipoctal->dev->region[IPACK_MEM8_SPACE];
 +      ipoctal->mem8_space =
 +              devm_ioremap_nocache(&ipoctal->dev->dev,
 +                                   region->start, 0x8000);
 +      if (!addr) {
                dev_err(&ipoctal->dev->dev,
 -                      "Unable to map slot [%d:%d] MEM space!\n",
 +                      "Unable to map slot [%d:%d] MEM8 space!\n",
                        bus_nr, slot);
 -              goto out_unregister_int_space;
 +              return -EADDRNOTAVAIL;
        }
  
 -      /* Save the virtual address to access the registers easily */
 -      chan_regs =
 -              (union scc2698_channel __iomem *) ipoctal->dev->io_space.address;
 -      block_regs =
 -              (union scc2698_block __iomem *) ipoctal->dev->io_space.address;
  
        /* Disable RX and TX before touching anything */
        for (i = 0; i < NR_CHANNELS ; i++) {
        ipoctal->dev->bus->ops->request_irq(ipoctal->dev,
                                       ipoctal_irq_handler, ipoctal);
        /* Dummy write */
 -      iowrite8(1, ipoctal->dev->mem_space.address + 1);
 +      iowrite8(1, ipoctal->mem8_space + 1);
  
        /* Register the TTY device */
  
        /* Each IP-OCTAL channel is a TTY port */
        tty = alloc_tty_driver(NR_CHANNELS);
  
 -      if (!tty) {
 -              res = -ENOMEM;
 -              goto out_unregister_slot_unmap;
 -      }
 +      if (!tty)
 +              return -ENOMEM;
  
        /* Fill struct tty_driver with ipoctal data */
        tty->owner = THIS_MODULE;
        if (res) {
                dev_err(&ipoctal->dev->dev, "Can't register tty driver.\n");
                put_tty_driver(tty);
 -              goto out_unregister_slot_unmap;
 +              return res;
        }
  
        /* Save struct tty_driver for use it when uninstalling the device */
                tty_dev = tty_port_register_device(&channel->tty_port, tty, i, NULL);
                if (IS_ERR(tty_dev)) {
                        dev_err(&ipoctal->dev->dev, "Failed to register tty device.\n");
+                       tty_port_destroy(&channel->tty_port);
                        continue;
                }
                dev_set_drvdata(tty_dev, channel);
        }
  
        return 0;
 -
 -out_unregister_slot_unmap:
 -      ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_ID_SPACE);
 -out_unregister_int_space:
 -      ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_INT_SPACE);
 -out_unregister_io_space:
 -      ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_IO_SPACE);
 -out_unregister_id_space:
 -      ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_MEM_SPACE);
 -      return res;
  }
  
  static inline int ipoctal_copy_write_buffer(struct ipoctal_channel *channel,
@@@ -678,7 -720,7 +679,7 @@@ static int ipoctal_probe(struct ipack_d
                return -ENOMEM;
  
        ipoctal->dev = dev;
 -      res = ipoctal_inst_slot(ipoctal, dev->bus_nr, dev->slot);
 +      res = ipoctal_inst_slot(ipoctal, dev->bus->bus_nr, dev->slot);
        if (res)
                goto out_uninst;
  
@@@ -700,10 -742,15 +701,11 @@@ static void __ipoctal_remove(struct ipo
                struct ipoctal_channel *channel = &ipoctal->channel[i];
                tty_unregister_device(ipoctal->tty_drv, i);
                tty_port_free_xmit_buf(&channel->tty_port);
+               tty_port_destroy(&channel->tty_port);
        }
  
        tty_unregister_driver(ipoctal->tty_drv);
        put_tty_driver(ipoctal->tty_drv);
 -      ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_MEM_SPACE);
 -      ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_INT_SPACE);
 -      ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_IO_SPACE);
 -      ipoctal->dev->bus->ops->unmap_space(ipoctal->dev, IPACK_ID_SPACE);
        kfree(ipoctal);
  }
  
diff --combined drivers/misc/pti.c
index 7003031c9181b4a5a08d25bdba2f788b4a5f092d,a1f0d174e687e5a57dd795b9c6c0ac6a0f5f4355..f84ff0c060358d2d4e2fa6e78d070fd385f0eaa4
@@@ -76,7 -76,7 +76,7 @@@ struct pti_dev 
   */
  static DEFINE_MUTEX(alloclock);
  
 -static const struct pci_device_id pci_ids[] __devinitconst = {
 +static const struct pci_device_id pci_ids[] = {
                {PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x82B)},
                {0}
  };
@@@ -796,7 -796,7 +796,7 @@@ static const struct tty_port_operation
   *    0 for success
   *    otherwise, error
   */
 -static int __devinit pti_pci_probe(struct pci_dev *pdev,
 +static int pti_pci_probe(struct pci_dev *pdev,
                const struct pci_device_id *ent)
  {
        unsigned int a;
@@@ -879,14 -879,17 +879,17 @@@ err
   *               PCI bus.
   * @pdev: variable containing pci info of PTI.
   */
 -static void __devexit pti_pci_remove(struct pci_dev *pdev)
 +static void pti_pci_remove(struct pci_dev *pdev)
  {
        struct pti_dev *drv_data = pci_get_drvdata(pdev);
+       unsigned int a;
  
        unregister_console(&pti_console);
  
-       tty_unregister_device(pti_tty_driver, 0);
-       tty_unregister_device(pti_tty_driver, 1);
+       for (a = 0; a < PTITTY_MINOR_NUM; a++) {
+               tty_unregister_device(pti_tty_driver, a);
+               tty_port_destroy(&drv_data->port[a]);
+       }
  
        iounmap(drv_data->pti_ioaddr);
        pci_set_drvdata(pdev, NULL);
@@@ -901,7 -904,7 +904,7 @@@ static struct pci_driver pti_pci_drive
        .name           = PCINAME,
        .id_table       = pci_ids,
        .probe          = pti_pci_probe,
 -      .remove         = __devexit_p(pti_pci_remove),
 +      .remove         = pti_pci_remove,
  };
  
  /**
diff --combined drivers/staging/Kconfig
index 943ca607200c7eb0b91821f5e36b0e4e32f048ad,fc95eaba223b1005fc2d0f1535019116119906f1..329bdb42109f9a726bec9ebd74359a2f97bfd287
@@@ -52,6 -52,8 +52,6 @@@ source "drivers/staging/rtl8192e/Kconfi
  
  source "drivers/staging/rtl8712/Kconfig"
  
 -source "drivers/staging/rts_pstor/Kconfig"
 -
  source "drivers/staging/rts5139/Kconfig"
  
  source "drivers/staging/frontier/Kconfig"
@@@ -118,10 -120,14 +118,10 @@@ source "drivers/staging/omapdrm/Kconfig
  
  source "drivers/staging/android/Kconfig"
  
 -source "drivers/staging/telephony/Kconfig"
 -
  source "drivers/staging/ozwpan/Kconfig"
  
  source "drivers/staging/ccg/Kconfig"
  
 -source "drivers/staging/ipack/Kconfig"
 -
  source "drivers/staging/gdm72xx/Kconfig"
  
  source "drivers/staging/csr/Kconfig"
@@@ -138,6 -144,8 +138,8 @@@ source "drivers/staging/imx-drm/Kconfig
  
  source "drivers/staging/dgrp/Kconfig"
  
+ source "drivers/staging/sb105x/Kconfig"
  source "drivers/staging/fwserial/Kconfig"
  
  endif # STAGING
diff --combined drivers/staging/Makefile
index 20c764d7ab33cae7e0f48b31062dd4741968b476,76db1e242747549e06c8992d2eeb4b46be0efeee..c7ec486680f7f460226bae0444e16db604d9fc79
@@@ -19,6 -19,7 +19,6 @@@ obj-$(CONFIG_R8187SE)         += rtl8187se
  obj-$(CONFIG_RTL8192U)                += rtl8192u/
  obj-$(CONFIG_RTL8192E)                += rtl8192e/
  obj-$(CONFIG_R8712U)          += rtl8712/
 -obj-$(CONFIG_RTS_PSTOR)               += rts_pstor/
  obj-$(CONFIG_RTS5139)         += rts5139/
  obj-$(CONFIG_TRANZPORT)               += frontier/
  obj-$(CONFIG_IDE_PHISON)      += phison/
@@@ -28,6 -29,7 +28,6 @@@ obj-$(CONFIG_OCTEON_ETHERNET) += octeon
  obj-$(CONFIG_VT6655)          += vt6655/
  obj-$(CONFIG_VT6656)          += vt6656/
  obj-$(CONFIG_VME_BUS)         += vme/
 -obj-$(CONFIG_IPACK_BUS)               += ipack/
  obj-$(CONFIG_DX_SEP)            += sep/
  obj-$(CONFIG_IIO)             += iio/
  obj-$(CONFIG_ZRAM)            += zram/
@@@ -51,6 -53,7 +51,6 @@@ obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_
  obj-$(CONFIG_MFD_NVEC)                += nvec/
  obj-$(CONFIG_DRM_OMAP)                += omapdrm/
  obj-$(CONFIG_ANDROID)         += android/
 -obj-$(CONFIG_PHONE)           += telephony/
  obj-$(CONFIG_USB_WPAN_HCD)    += ozwpan/
  obj-$(CONFIG_USB_G_CCG)               += ccg/
  obj-$(CONFIG_WIMAX_GDM72XX)   += gdm72xx/
@@@ -61,4 -64,5 +61,5 @@@ obj-$(CONFIG_NET_VENDOR_SILICOM)      += sil
  obj-$(CONFIG_CED1401)         += ced1401/
  obj-$(CONFIG_DRM_IMX)         += imx-drm/
  obj-$(CONFIG_DGRP)            += dgrp/
+ obj-$(CONFIG_SB105X)          += sb105x/
  obj-$(CONFIG_FIREWIRE_SERIAL) += fwserial/
index c409cd03e8c165be69f06ad13631442f2e25ad0d,8185a57d31c541fad67b6a3f73e7bc251959efff..2d1bbfd5b67c6771db7dff7eea8208a0610ef918
@@@ -151,20 -151,15 +151,15 @@@ static void dgrp_read_data_block(struc
   * Copys the rbuf to the flipbuf and sends to line discipline.
   * Sends input buffer data to the line discipline.
   *
-  * There are several modes to consider here:
-  *    rawreadok, tty->real_raw, and IF_PARMRK
   */
  static void dgrp_input(struct ch_struct *ch)
  {
        struct nd_struct *nd;
        struct tty_struct *tty;
-       int remain;
        int data_len;
        int len;
-       int flip_len;
        int tty_count;
        ulong lock_flags;
-       struct tty_ldisc *ld;
        u8  *myflipbuf;
        u8  *myflipflagbuf;
  
  
        spin_unlock_irqrestore(&nd->nd_lock, lock_flags);
  
-       /* Decide how much data we can send into the tty layer */
-       if (dgrp_rawreadok && tty->real_raw)
-               flip_len = MYFLIPLEN;
-       else
-               flip_len = TTY_FLIPBUF_SIZE;
        /* data_len should be the number of chars that we read in */
        data_len = (ch->ch_rin - ch->ch_rout) & RBUF_MASK;
-       remain = data_len;
  
        /* len is the amount of data we are going to transfer here */
-       len = min(data_len, flip_len);
-       /* take into consideration length of ldisc */
-       len = min(len, (N_TTY_BUF_SIZE - 1) - tty->read_cnt);
-       ld = tty_ldisc_ref(tty);
-       /*
-        * If we were unable to get a reference to the ld,
-        * don't flush our buffer, and act like the ld doesn't
-        * have any space to put the data right now.
-        */
-       if (!ld) {
-               len = 0;
-       } else if (!ld->ops->receive_buf) {
-               spin_lock_irqsave(&nd->nd_lock, lock_flags);
-               ch->ch_rout = ch->ch_rin;
-               spin_unlock_irqrestore(&nd->nd_lock, lock_flags);
-               len = 0;
-       }
+       len = tty_buffer_request_room(tty, data_len);
  
        /* Check DPA flow control */
        if ((nd->nd_dpa_debug) &&
  
                dgrp_read_data_block(ch, myflipbuf, len);
  
-               /*
-                * In high performance mode, we don't have to update
-                * flag_buf or any of the counts or pointers into flip buf.
-                */
-               if (!dgrp_rawreadok || !tty->real_raw) {
-                       if (I_PARMRK(tty) || I_BRKINT(tty) || I_INPCK(tty))
-                               parity_scan(ch, myflipbuf, myflipflagbuf, &len);
-                       else
-                               memset(myflipflagbuf, TTY_NORMAL, len);
-               }
+               if (I_PARMRK(tty) || I_BRKINT(tty) || I_INPCK(tty))
+                       parity_scan(ch, myflipbuf, myflipflagbuf, &len);
+               else
+                       memset(myflipflagbuf, TTY_NORMAL, len);
  
                if ((nd->nd_dpa_debug) &&
                    (nd->nd_dpa_port == PORT_NUM(MINOR(tty_devnum(tty)))))
                        dgrp_dpa_data(nd, 1, myflipbuf, len);
  
-               /*
-                * If we're doing raw reads, jam it right into the
-                * line disc bypassing the flip buffers.
-                */
-               if (dgrp_rawreadok && tty->real_raw)
-                       ld->ops->receive_buf(tty, myflipbuf, NULL, len);
-               else {
-                       len = tty_buffer_request_room(tty, len);
-                       tty_insert_flip_string_flags(tty, myflipbuf,
-                                                    myflipflagbuf, len);
-                       /* Tell the tty layer its okay to "eat" the data now */
-                       tty_flip_buffer_push(tty);
-               }
+               tty_insert_flip_string_flags(tty, myflipbuf,
+                                            myflipflagbuf, len);
+               tty_flip_buffer_push(tty);
  
                ch->ch_rxcount += len;
        }
  
-       if (ld)
-               tty_ldisc_deref(ld);
        /*
         * Wake up any sleepers (maybe dgrp close) that might be waiting
         * for a channel flag state change.
@@@ -1057,13 -1006,13 +1006,13 @@@ static int dgrp_net_release(struct inod
  
        spin_unlock_irqrestore(&dgrp_poll_data.poll_lock, lock_flags);
  
 -done:
        down(&nd->nd_net_semaphore);
  
        dgrp_monitor_message(nd, "Net Close");
  
        up(&nd->nd_net_semaphore);
  
 +done:
        module_put(THIS_MODULE);
        file->private_data = NULL;
        return 0;
@@@ -1671,9 -1620,6 +1620,9 @@@ static int dgrp_send(struct nd_struct *
                                 * do the job.
                                 */
  
 +                              /* FIXME: jiffies - ch->ch_waketime can never
 +                                 be < 0. Someone needs to work out what is
 +                                 actually intended here */
                                if (ch->ch_pun.un_open_count &&
                                    (ch->ch_pun.un_flag &
                                    (UN_EMPTY|UN_TIME|UN_LOW|UN_PWAIT)) != 0) {
@@@ -2549,7 -2495,7 +2498,7 @@@ data
  
                        /*
                         *  Fabricate and insert a data packet header to
-                        *  preceed the remaining data when it comes in.
+                        *  preced the remaining data when it comes in.
                         */
  
                        if (remain < plen) {
                                                }
  
                                                /*
-                                                *  Handle delayed response arrival preceeding
+                                                *  Handle delayed response arrival preceding
                                                 *  the open response we are waiting for.
                                                 */
  
@@@ -3556,7 -3502,7 +3505,7 @@@ void dgrp_poll_handler(unsigned long ar
                /*
                 * Decrement statistics.  These are only for use with
                 * KME, so don't worry that the operations are done
-                * unlocked, and so the results are occassionally wrong.
+                * unlocked, and so the results are occasionally wrong.
                 */
  
                nd->nd_read_count -= (nd->nd_read_count +
index 43ab9f4d9349d6db20a2e1a53d7790950e7a5b9f,8b513e9111c1075f017bb50cfe38909ffbf263c3..be179adfb7c7a0d5cbb9b81e6a023d29f73baf99
@@@ -17,6 -17,7 +17,6 @@@
  #include "dgrp_common.h"
  
  #include <linux/kernel.h>
 -#include <linux/version.h>
  #include <linux/module.h>
  #include <linux/ctype.h>
  #include <linux/string.h>
@@@ -54,23 -55,6 +54,6 @@@ static DEVICE_ATTR(register_with_sysfs
                   dgrp_class_register_with_sysfs_show, NULL);
  
  
- static ssize_t dgrp_class_rawreadok_show(struct device *c,
-                                        struct device_attribute *attr,
-                                        char *buf)
- {
-       return snprintf(buf, PAGE_SIZE, "%d\n", dgrp_rawreadok);
- }
- static ssize_t dgrp_class_rawreadok_store(struct device *c,
-                                         struct device_attribute *attr,
-                                         const char *buf, size_t count)
- {
-       sscanf(buf, "0x%x\n", &dgrp_rawreadok);
-       return count;
- }
- static DEVICE_ATTR(rawreadok, 0600, dgrp_class_rawreadok_show,
-                  dgrp_class_rawreadok_store);
  static ssize_t dgrp_class_pollrate_show(struct device *c,
                                        struct device_attribute *attr,
                                        char *buf)
@@@ -90,7 -74,6 +73,6 @@@ static DEVICE_ATTR(pollrate, 0600, dgrp
  
  static struct attribute *dgrp_sysfs_global_settings_entries[] = {
        &dev_attr_pollrate.attr,
-       &dev_attr_rawreadok.attr,
        &dev_attr_register_with_sysfs.attr,
        NULL
  };
@@@ -176,7 -159,7 +158,7 @@@ static ssize_t dgrp_node_description_sh
        if (!nd)
                return 0;
  
 -      if (nd->nd_state == NS_READY && nd->nd_ps_desc)
 +      if (nd->nd_state == NS_READY)
                return snprintf(buf, PAGE_SIZE, "%s\n", nd->nd_ps_desc);
        return 0;
  }
index efa62ced7c8a9b4f8a60a91ed61b49d7fe263884,5647068b93858d029127662687af4435dcce571f..51d3ed3dca277e2d0cb1cf5d63a19711d996d6a2
@@@ -432,7 -432,7 +432,7 @@@ static void drp_param(struct ch_struct 
        /*
         * From the POSIX.1 spec (7.1.2.6): "If {_POSIX_VDISABLE}
         * is defined for the terminal device file, and the value
-        * of one of the changable special control characters (see
+        * of one of the changeable special control characters (see
         * 7.1.1.9) is {_POSIX_VDISABLE}, that function shall be
         * disabled, that is, no input data shall be recognized as
         * the disabled special character."
@@@ -2265,9 -2265,7 +2265,7 @@@ static int get_modem_info(struct ch_str
                | ((mlast & DM_RI)  ? TIOCM_RNG : 0)
                | ((mlast & DM_DSR) ? TIOCM_DSR : 0)
                | ((mlast & DM_CTS) ? TIOCM_CTS : 0);
-       put_user(mlast, (unsigned int __user *) value);
-       return 0;
+       return put_user(mlast, (unsigned int __user *) value);
  }
  
  /*
@@@ -2285,7 -2283,8 +2283,8 @@@ static int set_modem_info(struct ch_str
        if (error == 0)
                return -EFAULT;
  
-       get_user(arg, (unsigned int __user *) value);
+       if (get_user(arg, (unsigned int __user *) value))
+               return -EFAULT;
        mval |= ((arg & TIOCM_RTS) ? DM_RTS : 0)
                | ((arg & TIOCM_DTR) ? DM_DTR : 0);
  
@@@ -2615,6 -2614,10 +2614,6 @@@ static int dgrp_tty_ioctl(struct tty_st
                 */
                return 0;
  
 -      case TIOCGSOFTCAR:
 -              return put_user(C_CLOCAL(tty) ? 1 : 0,
 -                              (unsigned long __user *) arg);
 -
        case TIOCMGET:
                rc = access_ok(VERIFY_WRITE, (void __user *) arg,
                                 sizeof(unsigned int));
        - looking at the tty_ioctl code, these command all call our
        tty_set_termios at the driver's end, when a TCSETA* is sent,
        it is expecting the tty to have a termio structure,
-       NOT a termios stucture.  These two structures differ in size
+       NOT a termios structure.  These two structures differ in size
        and the tty_ioctl code does a conversion before processing them both.
        - we should treat the TCSETAW TCSETAF ioctls the same, and let
        the tty_ioctl code do the conversion stuff.
                break;
  
        case DIGI_GETCUSTOMBAUD:
-               rc = access_ok(VERIFY_WRITE, (void __user *) arg, sizeof(int));
-               if (rc == 0)
+               if (put_user(ch->ch_custom_speed, (unsigned int __user *) arg))
                        return -EFAULT;
-               put_user(ch->ch_custom_speed, (unsigned int __user *) arg);
                break;
  
        case DIGI_SETCUSTOMBAUD:
        {
                int new_rate;
  
-               get_user(new_rate, (unsigned int __user *) arg);
+               if (get_user(new_rate, (unsigned int __user *) arg))
+                       return -EFAULT;
                dgrp_set_custom_speed(ch, new_rate);
  
                break;
@@@ -2981,7 -2983,7 +2979,7 @@@ static void dgrp_tty_start(struct tty_s
  }
  
  /*
-  *    Stop the reciever
+  *    Stop the receiver
   */
  static void dgrp_tty_input_stop(struct tty_struct *tty)
  {
@@@ -3104,6 -3106,7 +3102,7 @@@ static void dgrp_tty_hangup(struct tty_
  void
  dgrp_tty_uninit(struct nd_struct *nd)
  {
+       unsigned int i;
        char id[3];
  
        ID_TO_CHAR(nd->nd_ID, id);
                put_tty_driver(nd->nd_xprint_ttdriver);
                nd->nd_ttdriver_flags &= ~XPRINT_TTDRV_REG;
        }
+       for (i = 0; i < CHAN_MAX; i++)
+               tty_port_destroy(&nd->nd_chan[i].port);
  }
  
  
@@@ -3320,7 -3325,6 +3321,6 @@@ dgrp_tty_init(struct nd_struct *nd
                init_waitqueue_head(&(ch->ch_pun.un_open_wait));
                init_waitqueue_head(&(ch->ch_pun.un_close_wait));
                tty_port_init(&ch->port);
-               tty_port_init(&ch->port);
        }
        return 0;
  }
index 65f891be12d1d6481849f93ce4d06e8ec6373a17,d2a98da2613311fe1e2aa18f6ac35743dd57590f..b95886c1198de58ad7d8b26f6d343db7ad276b61
@@@ -39,7 -39,6 +39,7 @@@
  #include <linux/atmel_pdc.h>
  #include <linux/atmel_serial.h>
  #include <linux/uaccess.h>
 +#include <linux/pinctrl/consumer.h>
  
  #include <asm/io.h>
  #include <asm/ioctls.h>
@@@ -1424,7 -1423,7 +1424,7 @@@ static struct uart_ops atmel_pops = 
  #endif
  };
  
- static void __devinit atmel_of_init_port(struct atmel_uart_port *atmel_port,
+ static void atmel_of_init_port(struct atmel_uart_port *atmel_port,
                                         struct device_node *np)
  {
        u32 rs485_delay[2];
  /*
   * Configure the port from the platform device resource info.
   */
- static void __devinit atmel_init_port(struct atmel_uart_port *atmel_port,
+ static void atmel_init_port(struct atmel_uart_port *atmel_port,
                                      struct platform_device *pdev)
  {
        struct uart_port *port = &atmel_port->uart;
@@@ -1767,14 -1766,13 +1767,14 @@@ static int atmel_serial_resume(struct p
  #define atmel_serial_resume NULL
  #endif
  
- static int __devinit atmel_serial_probe(struct platform_device *pdev)
+ static int atmel_serial_probe(struct platform_device *pdev)
  {
        struct atmel_uart_port *port;
        struct device_node *np = pdev->dev.of_node;
        struct atmel_uart_data *pdata = pdev->dev.platform_data;
        void *data;
        int ret = -ENODEV;
 +      struct pinctrl *pinctrl;
  
        BUILD_BUG_ON(ATMEL_SERIAL_RINGSIZE & (ATMEL_SERIAL_RINGSIZE - 1));
  
  
        atmel_init_port(port, pdev);
  
 +      pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
 +      if (IS_ERR(pinctrl)) {
 +              ret = PTR_ERR(pinctrl);
 +              goto err;
 +      }
 +
        if (!atmel_use_dma_rx(&port->uart)) {
                ret = -ENOMEM;
                data = kmalloc(sizeof(struct atmel_uart_char)
@@@ -1859,7 -1851,7 +1859,7 @@@ err
        return ret;
  }
  
- static int __devexit atmel_serial_remove(struct platform_device *pdev)
+ static int atmel_serial_remove(struct platform_device *pdev)
  {
        struct uart_port *port = platform_get_drvdata(pdev);
        struct atmel_uart_port *atmel_port = to_atmel_uart_port(port);
  
  static struct platform_driver atmel_serial_driver = {
        .probe          = atmel_serial_probe,
-       .remove         = __devexit_p(atmel_serial_remove),
+       .remove         = atmel_serial_remove,
        .suspend        = atmel_serial_suspend,
        .resume         = atmel_serial_resume,
        .driver         = {
diff --combined drivers/tty/vt/vt.c
index 4e0d0c3734b326f80c635b1839fb4397eadcc59f,607636b4734d65305062a97b6e9394b690d18933..8fd89687d068e58b5546a153f8ea894c32782f47
@@@ -539,25 -539,25 +539,25 @@@ static void insert_char(struct vc_data 
  {
        unsigned short *p = (unsigned short *) vc->vc_pos;
  
 -      scr_memmovew(p + nr, p, vc->vc_cols - vc->vc_x);
 +      scr_memmovew(p + nr, p, (vc->vc_cols - vc->vc_x) * 2);
        scr_memsetw(p, vc->vc_video_erase_char, nr * 2);
        vc->vc_need_wrap = 0;
        if (DO_UPDATE(vc))
                do_update_region(vc, (unsigned long) p,
 -                      (vc->vc_cols - vc->vc_x) / 2 + 1);
 +                      vc->vc_cols - vc->vc_x);
  }
  
  static void delete_char(struct vc_data *vc, unsigned int nr)
  {
        unsigned short *p = (unsigned short *) vc->vc_pos;
  
 -      scr_memcpyw(p, p + nr, vc->vc_cols - vc->vc_x - nr);
 +      scr_memcpyw(p, p + nr, (vc->vc_cols - vc->vc_x - nr) * 2);
        scr_memsetw(p + vc->vc_cols - vc->vc_x - nr, vc->vc_video_erase_char,
                        nr * 2);
        vc->vc_need_wrap = 0;
        if (DO_UPDATE(vc))
                do_update_region(vc, (unsigned long) p,
 -                      (vc->vc_cols - vc->vc_x) / 2);
 +                      vc->vc_cols - vc->vc_x);
  }
  
  static int softcursor_original;
@@@ -779,6 -779,7 +779,7 @@@ int vc_allocate(unsigned int currcons)     
                con_set_default_unimap(vc);
            vc->vc_screenbuf = kmalloc(vc->vc_screenbuf_size, GFP_KERNEL);
            if (!vc->vc_screenbuf) {
+               tty_port_destroy(&vc->port);
                kfree(vc);
                vc_cons[currcons].d = NULL;
                return -ENOMEM;
@@@ -999,8 -1000,10 +1000,10 @@@ void vc_deallocate(unsigned int currcon
                put_pid(vc->vt_pid);
                module_put(vc->vc_sw->owner);
                kfree(vc->vc_screenbuf);
-               if (currcons >= MIN_NR_CONSOLES)
+               if (currcons >= MIN_NR_CONSOLES) {
+                       tty_port_destroy(&vc->port);
                        kfree(vc);
+               }
                vc_cons[currcons].d = NULL;
        }
  }