libata: convert pata_pdc2027x to the new reset mechanism
PATCH 1/1 libata: convert pata_pdc2027x to the new reset mechanism
- Convert pata_pdc2027x to the new reset mechanism (->probe_reset)
- Increased the version to 0.74
Signed-off-by Albert Lee <[email protected]>
---
Patch against the pata_drivers branch
(bbbd62abb51c5804e113859e5bdccb0c9e84250a).
For your review, thanks.
drivers/scsi/pata_pdc2027x.c +32 -15
@@ -36,7 +36,7 @@#include <asm/io.h> #define DRV_NAME "pata_pdc2027x" -#define DRV_VERSION "0.73" +#define DRV_VERSION "0.74"#undef PDC_DEBUG#ifdef PDC_DEBUG
@@ -63,7 +63,7 @@ enum {static int pdc2027x_init_one (struct pci_dev *pdev,const struct pci_device_id *ent);static void pdc2027x_remove_one (struct pci_dev *pdev); -static void pdc2027x_phy_reset (struct ata_port *ap); +static int pdc2027x_probe_reset (struct ata_port *ap,unsigned int *classes);static void pdc2027x_set_piomode (struct ata_port *ap,struct ata_device *adev);static void pdc2027x_set_dmamode (struct ata_port *ap,struct ata_device *adev);static void pdc2027x_post_set_mode (struct ata_port *ap);
@@ -155,7 +155,7 @@ static struct ata_port_operations pdc202 .exec_command = ata_exec_command, .dev_select = ata_std_dev_select, - .phy_reset = pdc2027x_phy_reset, + .probe_reset = pdc2027x_probe_reset, .check_atapi_dma = pdc2027x_check_atapi_dma, .bmdma_setup = ata_bmdma_setup,
@@ -185,7 +185,7 @@ static struct ata_port_operations pdc202 .exec_command = ata_exec_command, .dev_select = ata_std_dev_select, - .phy_reset = pdc2027x_phy_reset, + .probe_reset = pdc2027x_probe_reset, .post_set_mode = pdc2027x_post_set_mode, .check_atapi_dma = pdc2027x_check_atapi_dma,
@@ -210,7 +210,7 @@ static struct ata_port_info pdc2027x_por { .sht = &pdc2027x_sht, .host_flags =ATA_FLAG_NO_LEGACY |ATA_FLAG_SLAVE_POSS | - ATA_FLAG_SRST | ATA_FLAG_MMIO, + ATA_FLAG_MMIO, .pio_mask = 0x1f, /* pio0-4 */ .mwdma_mask = 0x07, /* mwdma0-2 */ .udma_mask = ATA_UDMA5, /* udma0-5 */
@@ -220,7 +220,7 @@ static struct ata_port_info pdc2027x_por { .sht = &pdc2027x_sht, .host_flags =ATA_FLAG_NO_LEGACY |ATA_FLAG_SLAVE_POSS | - ATA_FLAG_SRST | ATA_FLAG_MMIO, + ATA_FLAG_MMIO, .pio_mask = 0x1f, /* pio0-4 */ .mwdma_mask = 0x07, /* mwdma0-2 */ .udma_mask = ATA_UDMA6, /* udma0-6 */
@@ -296,26 +296,43 @@ static inline int pdc2027x_port_enabled( }/** -* pdc2027x_phy_reset - Probe specified port on PATA host controller -* @ap: Port to probe +* pdc2027x_probeinit - probeinit for PATA host controller +* @ap: Target port * -* Probe PATA phy. +* Probeinit including cable detection. * * LOCKING: * None (inherited from caller). */ -static void pdc2027x_phy_reset (struct ata_port *ap) + +static void pdc2027x_probeinit (struct ata_port *ap) +{ +pdc2027x_cbl_detect (ap); +ata_std_probeinit (ap); +} + +/** +* pdc2027x_probe_reset - Perform reset on PATA port and classify +* @ap: Port to reset +* @classes: Resulting classes of attached devices +* +* Reset PATA phy and classify attached devices. +* +* LOCKING: +* None (inherited from caller). +*/ + +static int pdc2027x_probe_reset (struct ata_port *ap,unsigned int *classes) {/* Check whether port enabled */ if (!pdc2027x_port_enabled (ap)) { -ata_port_disable (ap);printk (KERN_INFO "ata%u: port disabled. ignoring.\n" , ap->id); -return ; +return 0 ; } -pdc2027x_cbl_detect (ap); -ata_port_probe (ap); -ata_bus_reset (ap); +return ata_drive_probe_reset (ap, pdc2027x_probeinit, + ata_std_softreset,NULL , + ata_std_postreset, classes); }/**
Quoted 4 lines · Albert Lee
- Convert
pata_pdc2027xto the new reset mechanism (->probe_reset)
- Increased the version to 0.74Signed-off-by Albert Lee <[email protected]>
Looks good.
Signature · 1 line
tejun