If we could not get a valid pd for gate/mux, print a warning log.
And use IS_ERR_OR_NULL to check the pd pointer.
Signed-off-by: Peng Fan <peng.fan@nxp.com>
pd_args.np = np;
pd_args.args_count = 0;
clk->pd = genpd_get_from_provider(&pd_args);
+ if (IS_ERR(clk->pd))
+ pr_warn("%s: failed to get pd\n", __func__);
}
}
if (gate->pd == NULL && gate->pd_name)
populate_gate_pd(gate);
- if (!gate->pd)
+ if (IS_ERR_OR_NULL(gate->pd))
return -1;
if (gate->pd->status != GPD_STATE_ACTIVE)
if (gate->pd == NULL && gate->pd_name)
populate_gate_pd(gate);
- if (!gate->pd)
+ if (IS_ERR_OR_NULL(gate->pd))
return;
if (gate->pd->status != GPD_STATE_ACTIVE)
if (gate->pd == NULL && gate->pd_name)
populate_gate_pd(gate);
- if (!gate->pd)
+ if (IS_ERR_OR_NULL(gate->pd))
return 0;
if (gate->pd->status != GPD_STATE_ACTIVE)
pd_args.np = np;
pd_args.args_count = 0;
clk->pd = genpd_get_from_provider(&pd_args);
+ if (IS_ERR(clk->pd))
+ pr_warn("%s: failed to get pd\n", __func__);
}
}
if (mux->pd == NULL && mux->pd_name)
populate_mux_pd(mux);
- if (!mux->pd)
+ if (IS_ERR_OR_NULL(mux->pd))
return 0;
if (mux->pd->status != GPD_STATE_ACTIVE)
if (mux->pd == NULL && mux->pd_name)
populate_mux_pd(mux);
- if (!mux->pd)
+ if (IS_ERR_OR_NULL(mux->pd))
return -1;
if (mux->pd->status != GPD_STATE_ACTIVE)