Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a76b62ca authored by Alan Cox's avatar Alan Cox Committed by Jeff Garzik
Browse files

libata: Change prototype of mode_filter to remove ata_port*



With Tejun having added adev->ap some time ago we can get rid of the
almost unused port being passed to mode filters. And while we are
doing filters, lets turn on the !IORDY filter as well.

Signed-off-by: default avatarAlan Cox <alan@redhat.com>

With some hand massaging from
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 9d2c7c75
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3545,7 +3545,7 @@ static void ata_dev_xfermask(struct ata_device *dev)
	}

	if (ap->ops->mode_filter)
		xfer_mask = ap->ops->mode_filter(ap, dev, xfer_mask);
		xfer_mask = ap->ops->mode_filter(dev, xfer_mask);

	/* Apply cable rule here.  Don't apply it early because when
	 * we handle hot plug the cable type can itself change.
+2 −2
Original line number Diff line number Diff line
@@ -893,12 +893,12 @@ int ata_pci_clear_simplex(struct pci_dev *pdev)
	return 0;
}

unsigned long ata_pci_default_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long xfer_mask)
unsigned long ata_pci_default_filter(struct ata_device *adev, unsigned long xfer_mask)
{
	/* Filter out DMA modes if the device has been configured by
	   the BIOS as PIO only */

	if (ap->ioaddr.bmdma_addr == 0)
	if (adev->ap->ioaddr.bmdma_addr == 0)
		xfer_mask &= ~(ATA_MASK_MWDMA | ATA_MASK_UDMA);
	return xfer_mask;
}
+2 −2
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ static void ali_early_error_handler(struct ata_port *ap)
 *	fix that later on. Also ensure we do not do UDMA on WDC drives
 */

static unsigned long ali_20_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long mask)
static unsigned long ali_20_filter(struct ata_device *adev, unsigned long mask)
{
	char model_num[ATA_ID_PROD_LEN + 1];
	/* No DMA on anything but a disk for now */
@@ -160,7 +160,7 @@ static unsigned long ali_20_filter(const struct ata_port *ap, struct ata_device
	ata_id_c_string(adev->id, model_num, ATA_ID_PROD, sizeof(model_num));
	if (strstr(model_num, "WDC"))
		return mask &= ~ATA_MASK_UDMA;
	return ata_pci_default_filter(ap, adev, mask);
	return ata_pci_default_filter(adev, mask);
}

/**
+2 −2
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ static int hpt_dma_blacklisted(const struct ata_device *dev, char *modestr, cons
 *	Block UDMA on devices that cause trouble with this controller.
 */

static unsigned long hpt366_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long mask)
static unsigned long hpt366_filter(struct ata_device *adev, unsigned long mask)
{
	if (adev->class == ATA_DEV_ATA) {
		if (hpt_dma_blacklisted(adev, "UDMA",  bad_ata33))
@@ -185,7 +185,7 @@ static unsigned long hpt366_filter(const struct ata_port *ap, struct ata_device
		if (hpt_dma_blacklisted(adev, "UDMA4", bad_ata66_4))
			mask &= ~(0x0F << ATA_SHIFT_UDMA);
	}
	return ata_pci_default_filter(ap, adev, mask);
	return ata_pci_default_filter(adev, mask);
}

/**
+4 −6
Original line number Diff line number Diff line
@@ -272,13 +272,12 @@ static const char *bad_ata100_5[] = {

/**
 *	hpt370_filter	-	mode selection filter
 *	@ap: ATA interface
 *	@adev: ATA device
 *
 *	Block UDMA on devices that cause trouble with this controller.
 */

static unsigned long hpt370_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long mask)
static unsigned long hpt370_filter(struct ata_device *adev, unsigned long mask)
{
	if (adev->class == ATA_DEV_ATA) {
		if (hpt_dma_blacklisted(adev, "UDMA", bad_ata33))
@@ -286,24 +285,23 @@ static unsigned long hpt370_filter(const struct ata_port *ap, struct ata_device
		if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5))
			mask &= ~(0x1F << ATA_SHIFT_UDMA);
	}
	return ata_pci_default_filter(ap, adev, mask);
	return ata_pci_default_filter(adev, mask);
}

/**
 *	hpt370a_filter	-	mode selection filter
 *	@ap: ATA interface
 *	@adev: ATA device
 *
 *	Block UDMA on devices that cause trouble with this controller.
 */

static unsigned long hpt370a_filter(const struct ata_port *ap, struct ata_device *adev, unsigned long mask)
static unsigned long hpt370a_filter(struct ata_device *adev, unsigned long mask)
{
	if (adev->class != ATA_DEV_ATA) {
		if (hpt_dma_blacklisted(adev, "UDMA100", bad_ata100_5))
			mask &= ~ (0x1F << ATA_SHIFT_UDMA);
	}
	return ata_pci_default_filter(ap, adev, mask);
	return ata_pci_default_filter(adev, mask);
}

/**
Loading