[openwrt/openwrt] ramips: fix BUG_ON on mtk-mmc driver probe

LEDE Commits lede-commits at lists.infradead.org
Thu Apr 5 09:12:47 PDT 2018


nbd pushed a commit to openwrt/openwrt.git, branch master:
https://git.lede-project.org/6a621f4bd900b42fb1560691d676d0b3cc51b731

commit 6a621f4bd900b42fb1560691d676d0b3cc51b731
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Thu Apr 5 17:41:10 2018 +0200

    ramips: fix BUG_ON on mtk-mmc driver probe
    
    Our .dts files only have one device defined and this is unlikely to
    change, so statically initialize host->id to 0.
    
    Signed-off-by: Felix Fietkau <nbd at nbd.name>
---
 target/linux/ramips/files-4.14/drivers/mmc/host/mtk-mmc/sd.c | 4 +---
 target/linux/ramips/files-4.9/drivers/mmc/host/mtk-mmc/sd.c  | 4 +---
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/target/linux/ramips/files-4.14/drivers/mmc/host/mtk-mmc/sd.c b/target/linux/ramips/files-4.14/drivers/mmc/host/mtk-mmc/sd.c
index daedc62..ebfdc06 100644
--- a/target/linux/ramips/files-4.14/drivers/mmc/host/mtk-mmc/sd.c
+++ b/target/linux/ramips/files-4.14/drivers/mmc/host/mtk-mmc/sd.c
@@ -2799,9 +2799,7 @@ static int msdc_drv_probe(struct platform_device *pdev)
     host = mmc_priv(mmc);
     host->hw        = hw;
     host->mmc       = mmc;
-    BUG_ON(pdev->id < -1);
-    BUG_ON(pdev->id >= ARRAY_SIZE(drv_mode));
-    host->id        = (pdev->id == -1) ? 0 : pdev->id;
+    host->id        = 0;
     host->error     = 0;
     host->irq       = irq;    
     host->base      = (unsigned long) base;
diff --git a/target/linux/ramips/files-4.9/drivers/mmc/host/mtk-mmc/sd.c b/target/linux/ramips/files-4.9/drivers/mmc/host/mtk-mmc/sd.c
index daedc62..ebfdc06 100644
--- a/target/linux/ramips/files-4.9/drivers/mmc/host/mtk-mmc/sd.c
+++ b/target/linux/ramips/files-4.9/drivers/mmc/host/mtk-mmc/sd.c
@@ -2799,9 +2799,7 @@ static int msdc_drv_probe(struct platform_device *pdev)
     host = mmc_priv(mmc);
     host->hw        = hw;
     host->mmc       = mmc;
-    BUG_ON(pdev->id < -1);
-    BUG_ON(pdev->id >= ARRAY_SIZE(drv_mode));
-    host->id        = (pdev->id == -1) ? 0 : pdev->id;
+    host->id        = 0;
     host->error     = 0;
     host->irq       = irq;    
     host->base      = (unsigned long) base;



More information about the lede-commits mailing list