MLK-16225: imx8 pm: Check of_device_is_available

This patch causes imx8-pd nodes marked with status = "disabled" to be
ignored. This is very common in devicetree handling.

When running with xen the hypervisor will convert all xen,passthrough
properties to status = "disabled" before passing dtb to dom0. This patch
allows power domains to be marked this way and have them be ignored by
the host automatically.

The alternative is to remove the power domain nodes and references using
/delete-node/ and /delete-property/ and that gets messy.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Ranjani Vaidyanathan <Ranjani.vaidyanathan@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
This commit is contained in:
Leonard Crestez 2017-10-05 17:03:01 +03:00 committed by Jason Liu
parent 5d41296b4c
commit e14fd75b25

View file

@ -211,6 +211,9 @@ static int __init imx8_add_pm_domains(struct device_node *parent,
struct imx8_pm_domain *imx8_pd;
sc_rsrc_t rsrc_id;
if (!of_device_is_available(np))
continue;
imx8_pd = kzalloc(sizeof(*imx8_pd), GFP_KERNEL);
if (!imx8_pd)
return -ENOMEM;
@ -260,6 +263,9 @@ static int __init imx8_init_pm_domains(void)
for_each_compatible_node(np, NULL, "nxp,imx8-pd") {
struct imx8_pm_domain *imx8_pd;
if (!of_device_is_available(np))
continue;
imx8_pd = kzalloc(sizeof(struct imx8_pm_domain), GFP_KERNEL);
if (!imx8_pd) {
pr_err("%s: failed to allocate memory for domain\n",