Skip to contentSkip to conversation

ata: ahci_platform: fix DT probing

PATCH In review Rob Herring 2 participants 2 messages Nov 16, 2011

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

PATCH 1/1 ata: ahci_platform: fix DT probing

From: Rob Herring <[email protected]>

The change in commit 904c04feaf13ed "ahci_platform: Add the board_ids..." doesn't work for the DT probing case as platform_get_device_id returns NULL. Pick the default ahci_port_info in this case.

---
 drivers/ata/ahci_platform.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/ata/ahci_platform.c +1 -1
index ec55595..43b8758 100644
@@ -67,7 +67,7 @@ static int __init ahci_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct ahci_platform_data *pdata = dev_get_platdata(dev);
 	const struct platform_device_id *id = platform_get_device_id(pdev);
-	struct ata_port_info pi = ahci_port_info[id->driver_data];
+	struct ata_port_info pi = ahci_port_info[id ? id->driver_data : 0];
 	const struct ata_port_info *ppi[] = { &pi, NULL };
 	struct ahci_host_priv *hpriv;
 	struct ata_host *host;
Signature · 1 line
1.7.5.4
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Rob Herring

From: Rob Herring <[email protected]>

The change in commit 904c04feaf13ed "ahci_platform: Add the board_ids..." doesn't work for the DT probing case as platform_get_device_id returns NULL. Pick the default ahci_port_info in this case.

Quoted 7 lines

---

Thanks!

Signature · 2 lines
Anton Vorontsov
Email: [email protected]