Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzi...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 20 May 2010 16:27:37 +0000 (09:27 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 20 May 2010 16:27:37 +0000 (09:27 -0700)
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: (49 commits)
  libata-sff: separate out BMDMA qc_issue
  libata-sff: prd is BMDMA specific
  libata-sff: ata_sff_[dumb_]qc_prep are BMDMA specific
  libata-sff: separate out BMDMA EH
  libata-sff: port_task is SFF specific
  libata-sff: ap->[last_]ctl are SFF specific
  libata-sff: rename ap->ops->drain_fifo() to sff_drain_fifo()
  libata-sff: introduce ata_sff_init/exit() and ata_sff_port_init()
  libata-sff: clean up BMDMA initialization
  libata-sff: clean up inheritance in several drivers
  libata-sff: reorder SFF/BMDMA functions
  sata_inic162x: kill PORT_PRD_ADDR initialization
  libata: kill ATA_FLAG_DISABLED
  libata-sff: kill unused prototype and make ata_dev_select() static
  libata-sff: update bmdma host bus error handling
  sata_mv: remove unnecessary initialization
  sata_inic162x: inic162x is not dependent on CONFIG_ATA_SFF
  pata_sch: use ata_pci_sff_init_one()
  pata_sil680: Do our own exec_command posting
  libata: Remove excess delay in the tf_load path
  ...

1  2 
Documentation/DocBook/libata.tmpl
drivers/ata/pata_pcmcia.c

@@@ -81,16 -81,14 +81,14 @@@ void (*port_disable) (struct ata_port *
        </programlisting>
  
        <para>
-       Called from ata_bus_probe() and ata_bus_reset() error paths,
-       as well as when unregistering from the SCSI module (rmmod, hot
-       unplug).
+       Called from ata_bus_probe() error path, as well as when
+       unregistering from the SCSI module (rmmod, hot unplug).
        This function should do whatever needs to be done to take the
        port out of use.  In most cases, ata_port_disable() can be used
        as this hook.
        </para>
        <para>
        Called from ata_bus_probe() on a failed probe.
-       Called from ata_bus_reset() on a failed bus reset.
        Called from ata_scsi_release().
        </para>
  
@@@ -227,6 -225,18 +225,18 @@@ u8   (*sff_check_altstatus)(struct ata_
  
        </sect2>
  
+       <sect2><title>Write specific ATA shadow register</title>
+       <programlisting>
+ void (*sff_set_devctl)(struct ata_port *ap, u8 ctl);
+       </programlisting>
+       <para>
+       Write the device control ATA shadow register to the hardware.
+       Most drivers don't need to define this.
+       </para>
+       </sect2>
        <sect2><title>Select ATA device on bus</title>
        <programlisting>
  void (*sff_dev_select)(struct ata_port *ap, unsigned int device);
@@@ -477,7 -487,7 +487,7 @@@ void (*host_stop) (struct ata_host_set 
        allocates space for a legacy IDE PRD table and returns.
        </para>
        <para>
 -      ->port_stop() is called after ->host_stop().  It's sole function
 +      ->port_stop() is called after ->host_stop().  Its sole function
        is to release DMA/memory resources, now that they are no longer
        actively being used.  Many drivers also free driver-private
        data from port at this time.
  #define DRV_NAME "pata_pcmcia"
  #define DRV_VERSION "0.3.5"
  
 -/*
 - *    Private data structure to glue stuff together
 - */
 -
 -struct ata_pcmcia_info {
 -      struct pcmcia_device *pdev;
 -      int             ndev;
 -      dev_node_t      node;
 -};
 -
  /**
   *    pcmcia_set_mode -       PCMCIA specific mode setup
   *    @link: link
@@@ -165,7 -175,7 +165,7 @@@ static struct ata_port_operations pcmci
        .sff_data_xfer  = ata_data_xfer_8bit,
        .cable_detect   = ata_cable_40wire,
        .set_mode       = pcmcia_set_mode_8bit,
-       .drain_fifo     = pcmcia_8bit_drain_fifo,
+       .sff_drain_fifo = pcmcia_8bit_drain_fifo,
  };
  
  
@@@ -238,6 -248,7 +238,6 @@@ static int pcmcia_init_one(struct pcmci
  {
        struct ata_host *host;
        struct ata_port *ap;
 -      struct ata_pcmcia_info *info;
        struct pcmcia_config_check *stk = NULL;
        int is_kme = 0, ret = -ENOMEM, p;
        unsigned long io_base, ctl_base;
        int n_ports = 1;
        struct ata_port_operations *ops = &pcmcia_port_ops;
  
 -      info = kzalloc(sizeof(*info), GFP_KERNEL);
 -      if (info == NULL)
 -              return -ENOMEM;
 -
 -      /* Glue stuff together. FIXME: We may be able to get rid of info with care */
 -      info->pdev = pdev;
 -      pdev->priv = info;
 -
        /* Set up attributes in order to probe card and get resources */
        pdev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
        pdev->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
        pdev->io.IOAddrLines = 3;
 -      pdev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
        pdev->conf.Attributes = CONF_ENABLE_IRQ;
        pdev->conf.IntType = INT_MEMORY_AND_IO;
  
        }
        io_base = pdev->io.BasePort1;
        ctl_base = stk->ctl_base;
 -      ret = pcmcia_request_irq(pdev, &pdev->irq);
 -      if (ret)
 +      if (!pdev->irq)
                goto failed;
  
        ret = pcmcia_request_configuration(pdev, &pdev->conf);
        }
  
        /* activate */
 -      ret = ata_host_activate(host, pdev->irq.AssignedIRQ, ata_sff_interrupt,
 +      ret = ata_host_activate(host, pdev->irq, ata_sff_interrupt,
                                IRQF_SHARED, &pcmcia_sht);
        if (ret)
                goto failed;
  
 -      info->ndev = 1;
 +      pdev->priv = host;
        kfree(stk);
        return 0;
  
  failed:
        kfree(stk);
 -      info->ndev = 0;
        pcmcia_disable_device(pdev);
  out1:
 -      kfree(info);
        return ret;
  }
  
  
  static void pcmcia_remove_one(struct pcmcia_device *pdev)
  {
 -      struct ata_pcmcia_info *info = pdev->priv;
 -      struct device *dev = &pdev->dev;
 -
 -      if (info != NULL) {
 -              /* If we have attached the device to the ATA layer, detach it */
 -              if (info->ndev) {
 -                      struct ata_host *host = dev_get_drvdata(dev);
 -                      ata_host_detach(host);
 -              }
 -              info->ndev = 0;
 -              pdev->priv = NULL;
 -      }
 +      struct ata_host *host = pdev->priv;
 +
 +      if (host)
 +              ata_host_detach(host);
 +
        pcmcia_disable_device(pdev);
 -      kfree(info);
  }
  
  static struct pcmcia_device_id pcmcia_devices[] = {