From patchwork Wed Nov 16 03:00:56 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: ata: ahci_platform: fix DT probing Date: Tue, 15 Nov 2011 17:00:56 -0000 From: Rob Herring X-Patchwork-Id: 125917 Message-Id: <1321412456-31107-1-git-send-email-robherring2@gmail.com> To: Jeff Garzik Cc: Rob Herring , Richard Zhu , Anton Vorontsov , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org From: Rob Herring 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. Signed-off-by: Rob Herring Cc: Richard Zhu Cc: Anton Vorontsov Cc: Jeff Garzik Cc: linux-ide@vger.kernel.org Cc: linux-kernel@vger.kernel.org Acked-by: Anton Vorontsov --- drivers/ata/ahci_platform.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index ec55595..43b8758 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c @@ -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;