]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
mmc: add function to get the number of available mmc interfaces
authorLothar Waßmann <LW@KARO-electronics.de>
Fri, 21 Aug 2015 14:26:41 +0000 (16:26 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 21 Aug 2015 14:26:41 +0000 (16:26 +0200)
drivers/mmc/mmc.c
include/mmc.h

index 85e9509ed19374115421bcc6fc5ba10c380f0a24..0c2fe351ba1d16d3543340538bdb09e201c98fc9 100644 (file)
@@ -20,6 +20,7 @@
 
 static struct list_head mmc_devices;
 static int cur_dev_num = -1;
+static int mmc_dev_count;
 
 __weak int board_mmc_getwp(struct mmc *mmc)
 {
@@ -1549,6 +1550,7 @@ struct mmc *mmc_create(const struct mmc_config *cfg, void *priv)
        INIT_LIST_HEAD(&mmc->link);
 
        list_add_tail(&mmc->link, &mmc_devices);
+       mmc_dev_count++;
 
        return mmc;
 }
@@ -1721,6 +1723,11 @@ int get_mmc_num(void)
        return cur_dev_num;
 }
 
+int get_mmc_dev_count(void)
+{
+       return mmc_dev_count;
+}
+
 void mmc_set_preinit(struct mmc *mmc, int preinit)
 {
        mmc->preinit = preinit;
index 09101e2c87a11cfa76c0412c92dd5e9b6eb5ab00..c0bcfb90762dc42fada8047eb0a34b3d50bed5ce 100644 (file)
@@ -373,6 +373,7 @@ struct mmc *find_mmc_device(int dev_num);
 int mmc_set_dev(int dev_num);
 void print_mmc_devices(char separator);
 int get_mmc_num(void);
+int get_mmc_dev_count(void);
 int mmc_switch_part(int dev_num, unsigned int part_num);
 int mmc_hwpart_config(struct mmc *mmc, const struct mmc_hwpart_conf *conf,
                      enum mmc_hwpart_conf_mode mode);