diff options
Diffstat (limited to 'drivers/of/platform.c')
-rw-r--r-- | drivers/of/platform.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/of/platform.c b/drivers/of/platform.c index a54ec1087fd2..b0d50d70a8a1 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c | |||
@@ -566,6 +566,10 @@ static int of_platform_notify(struct notifier_block *nb, | |||
566 | if (!of_node_check_flag(rd->dn->parent, OF_POPULATED_BUS)) | 566 | if (!of_node_check_flag(rd->dn->parent, OF_POPULATED_BUS)) |
567 | return NOTIFY_OK; /* not for us */ | 567 | return NOTIFY_OK; /* not for us */ |
568 | 568 | ||
569 | /* already populated? (driver using of_populate manually) */ | ||
570 | if (of_node_check_flag(rd->dn, OF_POPULATED)) | ||
571 | return NOTIFY_OK; | ||
572 | |||
569 | /* pdev_parent may be NULL when no bus platform device */ | 573 | /* pdev_parent may be NULL when no bus platform device */ |
570 | pdev_parent = of_find_device_by_node(rd->dn->parent); | 574 | pdev_parent = of_find_device_by_node(rd->dn->parent); |
571 | pdev = of_platform_device_create(rd->dn, NULL, | 575 | pdev = of_platform_device_create(rd->dn, NULL, |
@@ -581,6 +585,11 @@ static int of_platform_notify(struct notifier_block *nb, | |||
581 | break; | 585 | break; |
582 | 586 | ||
583 | case OF_RECONFIG_CHANGE_REMOVE: | 587 | case OF_RECONFIG_CHANGE_REMOVE: |
588 | |||
589 | /* already depopulated? */ | ||
590 | if (!of_node_check_flag(rd->dn, OF_POPULATED)) | ||
591 | return NOTIFY_OK; | ||
592 | |||
584 | /* find our device by node */ | 593 | /* find our device by node */ |
585 | pdev = of_find_device_by_node(rd->dn); | 594 | pdev = of_find_device_by_node(rd->dn); |
586 | if (pdev == NULL) | 595 | if (pdev == NULL) |