Skip to contentSkip to conversation

libata: Use correct PCI devices

PATCH New Holger Macht 1 participant 1 message Jan 20, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 8/8 libata: Use correct PCI devices

Commit 9a6d6a2ddabbd32c07f6a38b659e5f3db319fa5a made ata ports parent devices of scsi hosts, so we need to go yet another level up to be able to use the correct PCI devices.

---
 drivers/ata/libata-acpi.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/ata/libata-acpi.c +3 -3
index a39f9b3..b03e468 100644
@@ -996,7 +996,7 @@ static int ata_acpi_bind_host(struct device *dev, int host, acpi_handle *handle)
 	if (ap->flags & ATA_FLAG_ACPI_SATA)
 		return -ENODEV;
 
-	*handle = acpi_get_child(DEVICE_ACPI_HANDLE(dev->parent), ap->port_no);
+	*handle = acpi_get_child(DEVICE_ACPI_HANDLE(dev->parent->parent), ap->port_no);
 
 	if (!*handle)
 		return -ENODEV;
@@ -1036,13 +1036,13 @@ static int ata_acpi_find_device(struct device *dev, acpi_handle *handle)
 	unsigned int host, channel, id, lun;
 
 	if (sscanf(dev_name(dev), "host%u", &host) == 1) {
-		if (!is_pci_ata(dev->parent))
+		if (!is_pci_ata(dev->parent->parent))
 			return -ENODEV;
 
 		return ata_acpi_bind_host(dev, host, handle);
 	} else if (sscanf(dev_name(dev), "%d:%d:%d:%d",
 			&host, &channel, &id, &lun) == 4) {
-		if (!is_pci_ata(dev->parent->parent->parent))
+		if (!is_pci_ata(dev->parent->parent->parent->parent))
 			return -ENODEV;
 
 		return ata_acpi_bind_device(dev, channel, id, handle);
Signature · 1 line
1.7.8