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@nbd.name>
openwrt-18.06
Felix Fietkau 2018-04-05 17:41:10 +02:00
parent f9b2d369a6
commit 6a621f4bd9
2 changed files with 2 additions and 6 deletions

View File

@ -2799,9 +2799,7 @@ static int msdc_drv_probe(struct platform_device *pdev)
host = mmc_priv(mmc); host = mmc_priv(mmc);
host->hw = hw; host->hw = hw;
host->mmc = mmc; host->mmc = mmc;
BUG_ON(pdev->id < -1); host->id = 0;
BUG_ON(pdev->id >= ARRAY_SIZE(drv_mode));
host->id = (pdev->id == -1) ? 0 : pdev->id;
host->error = 0; host->error = 0;
host->irq = irq; host->irq = irq;
host->base = (unsigned long) base; host->base = (unsigned long) base;

View File

@ -2799,9 +2799,7 @@ static int msdc_drv_probe(struct platform_device *pdev)
host = mmc_priv(mmc); host = mmc_priv(mmc);
host->hw = hw; host->hw = hw;
host->mmc = mmc; host->mmc = mmc;
BUG_ON(pdev->id < -1); host->id = 0;
BUG_ON(pdev->id >= ARRAY_SIZE(drv_mode));
host->id = (pdev->id == -1) ? 0 : pdev->id;
host->error = 0; host->error = 0;
host->irq = irq; host->irq = irq;
host->base = (unsigned long) base; host->base = (unsigned long) base;