Skip to content

Commit 075daf2

Browse files
jhovoldsuperna9999
authored andcommitted
soc: amlogic: canvas: simplify lookup error handling
Simplify the canvas lookup error handling by dropping the OF node reference sooner. Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Link: https://patch.msgid.link/20250926142454.5929-3-johan@kernel.org Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
1 parent 32200f4 commit 075daf2

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

drivers/soc/amlogic/meson-canvas.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,9 @@ struct meson_canvas *meson_canvas_get(struct device *dev)
6060
return ERR_PTR(-ENODEV);
6161

6262
canvas_pdev = of_find_device_by_node(canvas_node);
63-
if (!canvas_pdev) {
64-
of_node_put(canvas_node);
65-
return ERR_PTR(-EPROBE_DEFER);
66-
}
67-
6863
of_node_put(canvas_node);
64+
if (!canvas_pdev)
65+
return ERR_PTR(-EPROBE_DEFER);
6966

7067
/*
7168
* If priv is NULL, it's probably because the canvas hasn't

0 commit comments

Comments
 (0)