]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
mmc: omap_hsmmc: compile out write support if not needed
authorJean-Jacques Hiblot <jjhiblot@ti.com>
Fri, 23 Feb 2018 09:40:17 +0000 (10:40 +0100)
committerJaehoon Chung <jh80.chung@samsung.com>
Mon, 26 Feb 2018 01:52:15 +0000 (10:52 +0900)
This reduces the size of the binary by about 196 bytes.

Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Tested-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
drivers/mmc/omap_hsmmc.c

index e0b679aa2c5746f72aa0c3fb47e4ef114f83f620..8b57edc14aeece26aec134610a072434ea5aa74d 100644 (file)
@@ -1181,8 +1181,9 @@ static int mmc_read_data(struct hsmmc *mmc_base, char *buf, unsigned int size)
        return 0;
 }
 
        return 0;
 }
 
+#if CONFIG_IS_ENABLED(MMC_WRITE)
 static int mmc_write_data(struct hsmmc *mmc_base, const char *buf,
 static int mmc_write_data(struct hsmmc *mmc_base, const char *buf,
-                               unsigned int size)
+                         unsigned int size)
 {
        unsigned int *input_buf = (unsigned int *)buf;
        unsigned int mmc_stat;
 {
        unsigned int *input_buf = (unsigned int *)buf;
        unsigned int mmc_stat;
@@ -1235,7 +1236,13 @@ static int mmc_write_data(struct hsmmc *mmc_base, const char *buf,
        }
        return 0;
 }
        }
        return 0;
 }
-
+#else
+static int mmc_write_data(struct hsmmc *mmc_base, const char *buf,
+                         unsigned int size)
+{
+       return -ENOTSUPP;
+}
+#endif
 static void omap_hsmmc_stop_clock(struct hsmmc *mmc_base)
 {
        writel(readl(&mmc_base->sysctl) & ~CEN_ENABLE, &mmc_base->sysctl);
 static void omap_hsmmc_stop_clock(struct hsmmc *mmc_base)
 {
        writel(readl(&mmc_base->sysctl) & ~CEN_ENABLE, &mmc_base->sysctl);