]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mmc: sunxi: conditionally include MMC2 initialization code
authorIcenowy Zheng <icenowy@sipeed.com>
Thu, 22 Jul 2021 06:30:05 +0000 (14:30 +0800)
committerAndre Przywara <andre.przywara@arm.com>
Mon, 25 Oct 2021 13:54:57 +0000 (14:54 +0100)
Allwinner R329 has no MMC2.

Only include the code of MMC2 if the base address of it is defined.

Signed-off-by: Icenowy Zheng <icenowy@sipeed.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
drivers/mmc/sunxi_mmc.c

index c170c16d5ab73d19b64e7efca94589390ea4e1e5..4bf8a9b92ce374035c88fd0d3058e1fd693762e1 100644 (file)
@@ -72,10 +72,12 @@ static int mmc_resource_init(int sdc_no)
                priv->reg = (struct sunxi_mmc *)SUNXI_MMC1_BASE;
                priv->mclkreg = &ccm->sd1_clk_cfg;
                break;
+#ifdef SUNXI_MMC2_BASE
        case 2:
                priv->reg = (struct sunxi_mmc *)SUNXI_MMC2_BASE;
                priv->mclkreg = &ccm->sd2_clk_cfg;
                break;
+#endif
 #ifdef SUNXI_MMC3_BASE
        case 3:
                priv->reg = (struct sunxi_mmc *)SUNXI_MMC3_BASE;