[PATCH v5 2/2] media: rcar-isp: distinguish absent cores from probe failures

From: Myeonghun Pak

Date: Mon Nov 09 2026 - 22:05:27 EST


risp_probe() interprets -ENODEV as an absent optional core, but resource
setup also returns it for initialization failures and deferred probing.

Reserve -ENODEV for missing core MMIO or the renesas,vspx property.
Preserve clock/reset errors, defer until the referenced VSPX device
exists, and use -ENXIO for malformed VSPX data or failed RPPX1 creation.
Convert remaining resource -ENODEV errors to -ENXIO so the parent
rejects failed initialization instead of continuing with the channel
selector.

Fixes: 2151350f60d1 ("media: rcar-isp: Add support for ISPCORE")
Suggested-by: Niklas Söderlund <niklas.soderlund@xxxxxxxxxxxx>
Co-developed-by: Ijae Kim <ae878000@xxxxxxxxx>
Signed-off-by: Ijae Kim <ae878000@xxxxxxxxx>
Signed-off-by: Myeonghun Pak <mhun512@xxxxxxxxx>
---
Changes in v5:
- Regenerate for git send-email; no code changes from v4.

No hardware runtime testing.

drivers/media/platform/renesas/rcar-isp/core.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/renesas/rcar-isp/core.c b/drivers/media/platform/renesas/rcar-isp/core.c
index 14f3c8f3505..0a322014f3d 100644
--- a/drivers/media/platform/renesas/rcar-isp/core.c
+++ b/drivers/media/platform/renesas/rcar-isp/core.c
@@ -800,20 +800,20 @@ static int risp_core_probe_resources(struct rcar_isp_core *core,

core->clk = devm_clk_get(&pdev->dev, "core");
if (IS_ERR(core->clk))
- return -ENODEV;
+ return PTR_ERR(core->clk);

core->rstc = devm_reset_control_get(&pdev->dev, "core");
if (IS_ERR(core->rstc))
- return -ENODEV;
+ return PTR_ERR(core->rstc);

of_vspx = of_parse_phandle(pdev->dev.of_node, "renesas,vspx", 0);
if (!of_vspx)
- return -ENODEV;
+ return -ENXIO;

vspx = of_find_device_by_node(of_vspx);
of_node_put(of_vspx);
if (!vspx)
- return -ENODEV;
+ return -EPROBE_DEFER;

/* Attach to VSP-X */
core->vspx.dev = &vspx->dev;
@@ -840,7 +840,7 @@ static int risp_core_probe_resources(struct rcar_isp_core *core,
clk_disable_unprepare(core->clk);

if (!core->rpp) {
- ret = -ENODEV;
+ ret = -ENXIO;
goto err_put_vspx;
}

@@ -860,10 +860,15 @@ int risp_core_probe(struct rcar_isp_core *core, struct platform_device *pdev,
core->csrstc = csrstc;
core->csbase = csbase;

+ /* Keep channel-selector-only configurations working. */
+ if (!platform_get_resource_byname(pdev, IORESOURCE_MEM, "core") ||
+ !of_find_property(pdev->dev.of_node, "renesas,vspx", NULL))
+ return -ENODEV;
+
ret = risp_core_probe_resources(core, pdev);
if (ret) {
core->base = NULL;
- return ret;
+ return ret == -ENODEV ? -ENXIO : ret;
}

ret = v4l2_device_register(core->dev, &core->v4l2_dev);