[PATCH 5/6] mci: atmel_mci: fix devinfo DEV with OF enabled

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



devinfo DEV resulted in a NULL pointer expection.
As platform_data is only valid in non-DT setup,
fix this so we no longer reference platform_data
outside the probe function

Signed-off-by: Sam Ravnborg <sam@xxxxxxxxxxxx>
---
 drivers/mci/atmel_mci.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/mci/atmel_mci.c b/drivers/mci/atmel_mci.c
index 317cf4602..0d3b245ce 100644
--- a/drivers/mci/atmel_mci.c
+++ b/drivers/mci/atmel_mci.c
@@ -474,7 +474,6 @@ static int atmci_request(struct mci_host *mci, struct mci_cmd *cmd, struct mci_d
 static void atmci_info(struct device_d *mci_dev)
 {
 	struct atmel_mci *host = mci_dev->priv;
-	struct atmel_mci_platform_data *pd = host->hw_dev->platform_data;
 
 	printf("  Bus data width: %d bit\n", host->mci.bus_width);
 
@@ -490,7 +489,7 @@ static void atmci_info(struct device_d *mci_dev)
 		printf("- %u Hz upper limit", host->mci.f_max);
 
 	printf("\n  Card detection support: %s\n",
-		gpio_is_valid(pd->detect_pin) ? "yes" : "no");
+		gpio_is_valid(host->detect_pin) ? "yes" : "no");
 
 }
 /*
-- 
2.12.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux