summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/core/bus.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-06-30 11:07:25 +0200
committerUlf Hansson <ulf.hansson@linaro.org>2015-01-19 09:56:26 +0100
commit25185f3f31c924eecc6ff4f55f7acceabf24de11 (patch)
tree240b6d8ac9db0e2688938926f545b43335808d9f /drivers/mmc/core/bus.c
parenta31edf1e582111f05fb8315da9dd118c837bede5 (diff)
downloadlinux-25185f3f31c924eecc6ff4f55f7acceabf24de11.tar.bz2
mmc: Add SDIO function devicetree subnode parsing
This adds SDIO devicetree subnode parsing to the mmc core. While SDIO devices are runtime probable they sometimes need nonprobable additional information on embedded systems, like an additional gpio interrupt or a clock. This patch makes it possible to supply this information from the devicetree. SDIO drivers will find a pointer to the devicenode in their devices of_node pointer. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> [hdegoede@redhat.com: Misc. cleanups] Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/core/bus.c')
-rw-r--r--drivers/mmc/core/bus.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mmc/core/bus.c b/drivers/mmc/core/bus.c
index 86d271148528..c5ef10065a4a 100644
--- a/drivers/mmc/core/bus.c
+++ b/drivers/mmc/core/bus.c
@@ -16,6 +16,7 @@
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/stat.h>
+#include <linux/of.h>
#include <linux/pm_runtime.h>
#include <linux/mmc/card.h>
@@ -321,6 +322,8 @@ int mmc_add_card(struct mmc_card *card)
#endif
mmc_init_context_info(card->host);
+ card->dev.of_node = mmc_of_find_child_device(card->host, 0);
+
ret = device_add(&card->dev);
if (ret)
return ret;
@@ -349,6 +352,7 @@ void mmc_remove_card(struct mmc_card *card)
mmc_hostname(card->host), card->rca);
}
device_del(&card->dev);
+ of_node_put(card->dev.of_node);
}
put_device(&card->dev);