Skip to content

Commit a39c258

Browse files
committed
Merge tag 'imx-drivers-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux into arm/drivers
i.MX drivers update for 5.10: - Use dev_err_probe() to simplify error handling for i.MX GPCv2 driver. - Add a check in i.MX SCU power domain driver to ignore the power domains that are not owned by the current partition. * tag 'imx-drivers-5.10' of git://git.kernel.org/pub/scm/linux/kernel/git/shawnguo/linux: firmware: imx: scu-pd: ignore power domain not owned soc: imx: gpcv2: Use dev_err_probe() to simplify error handling Link: https://lore.kernel.org/r/20200923073009.23678-1-shawnguo@kernel.org Signed-off-by: Olof Johansson <olof@lixom.net>
2 parents 8fc6726 + e2314cf commit a39c258

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

drivers/firmware/imx/scu-pd.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646

4747
#include <dt-bindings/firmware/imx/rsrc.h>
4848
#include <linux/firmware/imx/sci.h>
49+
#include <linux/firmware/imx/svc/rm.h>
4950
#include <linux/io.h>
5051
#include <linux/module.h>
5152
#include <linux/of.h>
@@ -256,6 +257,9 @@ imx_scu_add_pm_domain(struct device *dev, int idx,
256257
struct imx_sc_pm_domain *sc_pd;
257258
int ret;
258259

260+
if (!imx_sc_rm_is_resource_owned(pm_ipc_handle, pd_ranges->rsrc + idx))
261+
return NULL;
262+
259263
sc_pd = devm_kzalloc(dev, sizeof(*sc_pd), GFP_KERNEL);
260264
if (!sc_pd)
261265
return ERR_PTR(-ENOMEM);

drivers/soc/imx/gpcv2.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -487,22 +487,17 @@ static int imx_pgc_domain_probe(struct platform_device *pdev)
487487

488488
domain->regulator = devm_regulator_get_optional(domain->dev, "power");
489489
if (IS_ERR(domain->regulator)) {
490-
if (PTR_ERR(domain->regulator) != -ENODEV) {
491-
if (PTR_ERR(domain->regulator) != -EPROBE_DEFER)
492-
dev_err(domain->dev, "Failed to get domain's regulator\n");
493-
return PTR_ERR(domain->regulator);
494-
}
490+
if (PTR_ERR(domain->regulator) != -ENODEV)
491+
return dev_err_probe(domain->dev, PTR_ERR(domain->regulator),
492+
"Failed to get domain's regulator\n");
495493
} else if (domain->voltage) {
496494
regulator_set_voltage(domain->regulator,
497495
domain->voltage, domain->voltage);
498496
}
499497

500498
ret = imx_pgc_get_clocks(domain);
501-
if (ret) {
502-
if (ret != -EPROBE_DEFER)
503-
dev_err(domain->dev, "Failed to get domain's clocks\n");
504-
return ret;
505-
}
499+
if (ret)
500+
return dev_err_probe(domain->dev, ret, "Failed to get domain's clocks\n");
506501

507502
ret = pm_genpd_init(&domain->genpd, NULL, true);
508503
if (ret) {

0 commit comments

Comments
 (0)