diff options
Diffstat (limited to 'drivers/mmc/core/sdio_bus.c')
-rw-r--r-- | drivers/mmc/core/sdio_bus.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mmc/core/sdio_bus.c b/drivers/mmc/core/sdio_bus.c index 60885316afba..bee02e644d62 100644 --- a/drivers/mmc/core/sdio_bus.c +++ b/drivers/mmc/core/sdio_bus.c | |||
@@ -22,7 +22,9 @@ | |||
22 | #include <linux/mmc/card.h> | 22 | #include <linux/mmc/card.h> |
23 | #include <linux/mmc/host.h> | 23 | #include <linux/mmc/host.h> |
24 | #include <linux/mmc/sdio_func.h> | 24 | #include <linux/mmc/sdio_func.h> |
25 | #include <linux/of.h> | ||
25 | 26 | ||
27 | #include "core.h" | ||
26 | #include "sdio_cis.h" | 28 | #include "sdio_cis.h" |
27 | #include "sdio_bus.h" | 29 | #include "sdio_bus.h" |
28 | 30 | ||
@@ -295,6 +297,13 @@ static void sdio_acpi_set_handle(struct sdio_func *func) | |||
295 | static inline void sdio_acpi_set_handle(struct sdio_func *func) {} | 297 | static inline void sdio_acpi_set_handle(struct sdio_func *func) {} |
296 | #endif | 298 | #endif |
297 | 299 | ||
300 | static void sdio_set_of_node(struct sdio_func *func) | ||
301 | { | ||
302 | struct mmc_host *host = func->card->host; | ||
303 | |||
304 | func->dev.of_node = mmc_of_find_child_device(host, func->num); | ||
305 | } | ||
306 | |||
298 | /* | 307 | /* |
299 | * Register a new SDIO function with the driver model. | 308 | * Register a new SDIO function with the driver model. |
300 | */ | 309 | */ |
@@ -304,6 +313,7 @@ int sdio_add_func(struct sdio_func *func) | |||
304 | 313 | ||
305 | dev_set_name(&func->dev, "%s:%d", mmc_card_id(func->card), func->num); | 314 | dev_set_name(&func->dev, "%s:%d", mmc_card_id(func->card), func->num); |
306 | 315 | ||
316 | sdio_set_of_node(func); | ||
307 | sdio_acpi_set_handle(func); | 317 | sdio_acpi_set_handle(func); |
308 | ret = device_add(&func->dev); | 318 | ret = device_add(&func->dev); |
309 | if (ret == 0) { | 319 | if (ret == 0) { |
@@ -327,6 +337,7 @@ void sdio_remove_func(struct sdio_func *func) | |||
327 | 337 | ||
328 | dev_pm_domain_detach(&func->dev, false); | 338 | dev_pm_domain_detach(&func->dev, false); |
329 | device_del(&func->dev); | 339 | device_del(&func->dev); |
340 | of_node_put(func->dev.of_node); | ||
330 | put_device(&func->dev); | 341 | put_device(&func->dev); |
331 | } | 342 | } |
332 | 343 | ||