| @@ -47,13 +47,6 @@ static struct scsi_host_template pata_platform_sht = { · 46 unmodified lines |
| 47 | ATA_PIO_SHT(DRV_NAME), | 47 | ATA_PIO_SHT(DRV_NAME), |
| 48 | }; | 48 | }; |
| 49 | | 49 | |
| 50 | static struct ata_port_operations pata_platform_port_ops = { | | |
| 51 | .inherits = &ata_sff_port_ops, | | |
| 52 | .sff_data_xfer = ata_sff_data_xfer32, | | |
| 53 | .cable_detect = ata_cable_unknown, | | |
| 54 | .set_mode = pata_platform_set_mode, | | |
| 55 | }; | | |
| 56 | | | |
| 57 | static void pata_platform_setup_port(struct ata_ioports *ioaddr, | 50 | static void pata_platform_setup_port(struct ata_ioports *ioaddr, |
| 58 | unsigned int shift) | 51 | unsigned int shift) |
| 59 | { | 52 | { |
| @@ -79,6 +72,7 @@ static void pata_platform_setup_port(struct ata_ioports *ioaddr, · 19 unmodified lines |
| 79 | * @ioport_shift: I/O port shift | 72 | * @ioport_shift: I/O port shift |
| 80 | * @__pio_mask: PIO mask | 73 | * @__pio_mask: PIO mask |
| 81 | * @sht: scsi_host_template to use when registering | 74 | * @sht: scsi_host_template to use when registering |
| | 75 | * @use16bit: Flag to indicate 16-bit IO instead of 32-bit |
| 82 | * | 76 | * |
| 83 | * Register a platform bus IDE interface. Such interfaces are PIO and we | 77 | * Register a platform bus IDE interface. Such interfaces are PIO and we |
| 84 | * assume do not support IRQ sharing. | 78 | * assume do not support IRQ sharing. |
| @@ -101,7 +95,7 @@ static void pata_platform_setup_port(struct ata_ioports *ioaddr, · 16 unmodified lines |
| 101 | int __pata_platform_probe(struct device *dev, struct resource *io_res, | 95 | int __pata_platform_probe(struct device *dev, struct resource *io_res, |
| 102 | struct resource *ctl_res, struct resource *irq_res, | 96 | struct resource *ctl_res, struct resource *irq_res, |
| 103 | unsigned int ioport_shift, int __pio_mask, | 97 | unsigned int ioport_shift, int __pio_mask, |
| 104 | struct scsi_host_template *sht) | 98 | struct scsi_host_template *sht, bool use16bit) |
| 105 | { | 99 | { |
| 106 | struct ata_host *host; | 100 | struct ata_host *host; |
| 107 | struct ata_port *ap; | 101 | struct ata_port *ap; |
| @@ -131,7 +125,15 @@ int __pata_platform_probe(struct device *dev, struct resource *io_res, · 23 unmodified lines |
| 131 | return -ENOMEM; | 125 | return -ENOMEM; |
| 132 | ap = host->ports[0]; | 126 | ap = host->ports[0]; |
| 133 | | 127 | |
| 134 | ap->ops = &pata_platform_port_ops; | 128 | ap->ops = devm_kzalloc(dev, sizeof(*ap->ops), GFP_KERNEL); |
| | 129 | ap->ops->inherits = &ata_sff_port_ops; |
| | 130 | ap->ops->cable_detect = ata_cable_unknown; |
| | 131 | ap->ops->set_mode = pata_platform_set_mode; |
| | 132 | if (use16bit) |
| | 133 | ap->ops->sff_data_xfer = ata_sff_data_xfer; |
| | 134 | else |
| | 135 | ap->ops->sff_data_xfer = ata_sff_data_xfer32; |
| | 136 | |
| 135 | ap->pio_mask = __pio_mask; | 137 | ap->pio_mask = __pio_mask; |
| 136 | ap->flags |= ATA_FLAG_SLAVE_POSS; | 138 | ap->flags |= ATA_FLAG_SLAVE_POSS; |
| 137 | | 139 | |
| @@ -218,7 +220,7 @@ static int pata_platform_probe(struct platform_device *pdev) · 80 unmodified lines |
| 218 | | 220 | |
| 219 | return __pata_platform_probe(&pdev->dev, io_res, ctl_res, irq_res, | 221 | return __pata_platform_probe(&pdev->dev, io_res, ctl_res, irq_res, |
| 220 | pp_info ? pp_info->ioport_shift : 0, | 222 | pp_info ? pp_info->ioport_shift : 0, |
| 221 | pio_mask, &pata_platform_sht); | 223 | pio_mask, &pata_platform_sht, false); |
| 222 | } | 224 | } |
| 223 | | 225 | |
| 224 | static struct platform_driver pata_platform_driver = { | 226 | static struct platform_driver pata_platform_driver = { |