Commit 6cc918b8 authored by Jeff Garzik's avatar Jeff Garzik

[libata] make set_{pio,udma}mode hooks optional

Only one driver actually uses them.
parent dc22246b
......@@ -1453,7 +1453,8 @@ static void ata_host_set_pio(struct ata_port *ap)
if (ata_dev_present(&ap->device[i])) {
ap->device[i].pio_mode = (pio == 3) ?
XFER_PIO_3 : XFER_PIO_4;
ap->ops->set_piomode(ap, &ap->device[i], pio);
if (ap->ops->set_piomode)
ap->ops->set_piomode(ap, &ap->device[i], pio);
}
return;
......@@ -1517,7 +1518,9 @@ static void ata_host_set_udma(struct ata_port *ap)
for (i = 0; i < ATA_MAX_DEVICES; i++)
if (ata_dev_present(&ap->device[i])) {
ap->device[i].udma_mode = udma_mode;
ap->ops->set_udmamode(ap, &ap->device[i], udma_mode);
if (ap->ops->set_udmamode)
ap->ops->set_udmamode(ap, &ap->device[i],
udma_mode);
}
return;
......
......@@ -146,10 +146,6 @@ struct pdc_host_priv {
static u32 pdc_sata_scr_read (struct ata_port *ap, unsigned int sc_reg);
static void pdc_sata_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val);
static void pdc_sata_set_piomode (struct ata_port *ap, struct ata_device *adev,
unsigned int pio);
static void pdc_sata_set_udmamode (struct ata_port *ap, struct ata_device *adev,
unsigned int udma);
static int pdc_sata_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
static void pdc_dma_start(struct ata_queued_cmd *qc);
static void pdc20621_dma_start(struct ata_queued_cmd *qc);
......@@ -200,8 +196,6 @@ static Scsi_Host_Template pdc_sata_sht = {
static struct ata_port_operations pdc_sata_ops = {
.port_disable = ata_port_disable,
.set_piomode = pdc_sata_set_piomode,
.set_udmamode = pdc_sata_set_udmamode,
.tf_load = pdc_tf_load_mmio,
.tf_read = ata_tf_read_mmio,
.check_status = ata_check_status_mmio,
......@@ -220,8 +214,6 @@ static struct ata_port_operations pdc_sata_ops = {
static struct ata_port_operations pdc_20621_ops = {
.port_disable = ata_port_disable,
.set_piomode = pdc_sata_set_piomode,
.set_udmamode = pdc_sata_set_udmamode,
.tf_load = pdc_tf_load_mmio,
.tf_read = ata_tf_read_mmio,
.check_status = ata_check_status_mmio,
......@@ -378,19 +370,6 @@ static void pdc_sata_scr_write (struct ata_port *ap, unsigned int sc_reg,
writel(val, (void *) ap->ioaddr.scr_addr + (sc_reg * 4));
}
static void pdc_sata_set_piomode (struct ata_port *ap, struct ata_device *adev,
unsigned int pio)
{
/* dummy */
}
static void pdc_sata_set_udmamode (struct ata_port *ap, struct ata_device *adev,
unsigned int udma)
{
/* dummy */
}
enum pdc_packet_bits {
PDC_PKT_READ = (1 << 2),
PDC_PKT_NODATA = (1 << 3),
......
......@@ -75,10 +75,6 @@ enum {
SIL_QUIRK_UDMA5MAX = (1 << 1),
};
static void sil_set_piomode (struct ata_port *ap, struct ata_device *adev,
unsigned int pio);
static void sil_set_udmamode (struct ata_port *ap, struct ata_device *adev,
unsigned int udma);
static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
static void sil_dev_config(struct ata_port *ap, struct ata_device *dev);
static u32 sil_scr_read (struct ata_port *ap, unsigned int sc_reg);
......@@ -141,8 +137,6 @@ static Scsi_Host_Template sil_sht = {
static struct ata_port_operations sil_ops = {
.port_disable = ata_port_disable,
.dev_config = sil_dev_config,
.set_piomode = sil_set_piomode,
.set_udmamode = sil_set_udmamode,
.tf_load = ata_tf_load_mmio,
.tf_read = ata_tf_read_mmio,
.check_status = ata_check_status_mmio,
......@@ -287,22 +281,6 @@ static void sil_dev_config(struct ata_port *ap, struct ata_device *dev)
}
}
static void sil_set_piomode (struct ata_port *ap, struct ata_device *adev,
unsigned int pio)
{
/* We need empty implementation, the core doesn't test for NULL
* function pointer
*/
}
static void sil_set_udmamode (struct ata_port *ap, struct ata_device *adev,
unsigned int udma)
{
/* We need empty implementation, the core doesn't test for NULL
* function pointer
*/
}
static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
{
static int printed_version;
......
......@@ -149,24 +149,6 @@ static u8 k2_stat_check_status(struct ata_port *ap)
return readl((void *) ap->ioaddr.status_addr);
}
static void k2_sata_set_piomode (struct ata_port *ap, struct ata_device *adev,
unsigned int pio)
{
/* We need empty implementation, the core doesn't test for NULL
* function pointer
*/
}
static void k2_sata_set_udmamode (struct ata_port *ap, struct ata_device *adev,
unsigned int udma)
{
/* We need empty implementation, the core doesn't test for NULL
* function pointer
*/
}
#ifdef CONFIG_PPC_OF
/*
* k2_sata_proc_info
......@@ -239,8 +221,6 @@ static Scsi_Host_Template k2_sata_sht = {
static struct ata_port_operations k2_sata_ops = {
.port_disable = ata_port_disable,
.set_piomode = k2_sata_set_piomode,
.set_udmamode = k2_sata_set_udmamode,
.tf_load = k2_sata_tf_load,
.tf_read = k2_sata_tf_read,
.check_status = k2_stat_check_status,
......
......@@ -43,10 +43,6 @@ enum {
static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
static void svia_sata_phy_reset(struct ata_port *ap);
static void svia_port_disable(struct ata_port *ap);
static void svia_set_piomode (struct ata_port *ap, struct ata_device *adev,
unsigned int pio);
static void svia_set_udmamode (struct ata_port *ap, struct ata_device *adev,
unsigned int udma);
static unsigned int in_module_init = 1;
......@@ -83,8 +79,6 @@ static Scsi_Host_Template svia_sht = {
static struct ata_port_operations svia_sata_ops = {
.port_disable = svia_port_disable,
.set_piomode = svia_set_piomode,
.set_udmamode = svia_set_udmamode,
.tf_load = ata_tf_load_pio,
.tf_read = ata_tf_read_pio,
......@@ -166,38 +160,6 @@ static void svia_port_disable(struct ata_port *ap)
/* FIXME */
}
/**
* svia_set_piomode -
* @ap:
* @adev:
* @pio:
*
* LOCKING:
*
*/
static void svia_set_piomode (struct ata_port *ap, struct ata_device *adev,
unsigned int pio)
{
/* FIXME: needed? */
}
/**
* svia_set_udmamode -
* @ap:
* @adev:
* @udma:
*
* LOCKING:
*
*/
static void svia_set_udmamode (struct ata_port *ap, struct ata_device *adev,
unsigned int udma)
{
/* FIXME: needed? */
}
/**
* svia_init_one -
* @pdev:
......
......@@ -158,24 +158,6 @@ static void vsc_sata_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
}
static void vsc_sata_set_piomode (struct ata_port *ap, struct ata_device *adev,
unsigned int pio)
{
/* We need empty implementation, the core doesn't test for NULL
* function pointer
*/
}
static void vsc_sata_set_udmamode (struct ata_port *ap, struct ata_device *adev,
unsigned int udma)
{
/* We need empty implementation, the core doesn't test for NULL
* function pointer
*/
}
/*
* vsc_sata_interrupt
*
......@@ -234,8 +216,6 @@ static Scsi_Host_Template vsc_sata_sht = {
static struct ata_port_operations vsc_sata_ops = {
.port_disable = ata_port_disable,
.set_piomode = vsc_sata_set_piomode,
.set_udmamode = vsc_sata_set_udmamode,
.tf_load = vsc_sata_tf_load,
.tf_read = vsc_sata_tf_read,
.exec_command = ata_exec_command_mmio,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment