Patchwork [v5,04/12] libata: use correct PCI devices

login
register
mail settings
Submitter Lin Ming
Date June 18, 2012, 6:25 a.m.
Message ID <1340000766-129148-5-git-send-email-ming.m.lin@intel.com>
Download mbox | patch
Permalink /patch/165399/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Lin Ming - June 18, 2012, 6:25 a.m.
From: Holger Macht <holger@homac.de>

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.

Signed-off-by: Holger Macht <holger@homac.de>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
---
 drivers/ata/libata-acpi.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Sergei Shtylyov - June 18, 2012, 11:37 a.m.
On 18-06-2012 10:25, Lin Ming wrote:

> From: Holger Macht <holger@homac.de>

> Commit 9a6d6a2ddabbd32c07f6a38b659e5f3db319fa5a

    Please also specify that commit's summary in parens.

> 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.

> Signed-off-by: Holger Macht <holger@homac.de>
> Signed-off-by: Lin Ming <ming.m.lin@intel.com>

MBR, Sergei

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lin Ming - June 18, 2012, 12:03 p.m.
On Mon, Jun 18, 2012 at 7:37 PM, Sergei Shtylyov <sshtylyov@mvista.com> wrote:
> On 18-06-2012 10:25, Lin Ming wrote:
>
>> From: Holger Macht <holger@homac.de>
>
>
>> Commit 9a6d6a2ddabbd32c07f6a38b659e5f3db319fa5a
>
>
>   Please also specify that commit's summary in parens.

OK.

Thanks,
Lin Ming

>
>
>> 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.
>
>
>> Signed-off-by: Holger Macht <holger@homac.de>
>> Signed-off-by: Lin Ming <ming.m.lin@intel.com>
>
>
> MBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
index adc6336..98826e96 100644
--- a/drivers/ata/libata-acpi.c
+++ b/drivers/ata/libata-acpi.c
@@ -987,7 +987,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;
@@ -1021,13 +1021,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 (!compat_pci_ata(dev->parent))
+		if (!compat_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 (!compat_pci_ata(dev->parent->parent->parent))
+		if (!compat_pci_ata(dev->parent->parent->parent->parent))
 			return -ENODEV;
 
 		return ata_acpi_bind_device(dev, channel, id, handle);