|
@@ -22,7 +22,9 @@
|
|
|
#include <linux/mmc/card.h>
|
|
|
#include <linux/mmc/host.h>
|
|
|
#include <linux/mmc/sdio_func.h>
|
|
|
+#include <linux/of.h>
|
|
|
|
|
|
+#include "core.h"
|
|
|
#include "sdio_cis.h"
|
|
|
#include "sdio_bus.h"
|
|
|
|
|
@@ -295,6 +297,13 @@ static void sdio_acpi_set_handle(struct sdio_func *func)
|
|
|
static inline void sdio_acpi_set_handle(struct sdio_func *func) {}
|
|
|
#endif
|
|
|
|
|
|
+static void sdio_set_of_node(struct sdio_func *func)
|
|
|
+{
|
|
|
+ struct mmc_host *host = func->card->host;
|
|
|
+
|
|
|
+ func->dev.of_node = mmc_of_find_child_device(host, func->num);
|
|
|
+}
|
|
|
+
|
|
|
/*
|
|
|
* Register a new SDIO function with the driver model.
|
|
|
*/
|
|
@@ -304,6 +313,7 @@ int sdio_add_func(struct sdio_func *func)
|
|
|
|
|
|
dev_set_name(&func->dev, "%s:%d", mmc_card_id(func->card), func->num);
|
|
|
|
|
|
+ sdio_set_of_node(func);
|
|
|
sdio_acpi_set_handle(func);
|
|
|
ret = device_add(&func->dev);
|
|
|
if (ret == 0) {
|
|
@@ -327,6 +337,7 @@ void sdio_remove_func(struct sdio_func *func)
|
|
|
|
|
|
dev_pm_domain_detach(&func->dev, false);
|
|
|
device_del(&func->dev);
|
|
|
+ of_node_put(func->dev.of_node);
|
|
|
put_device(&func->dev);
|
|
|
}
|
|
|
|