mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-29 21:56:39 +07:00
[media] v4l: atmel-isi: Simplify error handling during DT parsing
Put the endpoint DT node earlier to avoid the need for goto statements to a cleanup code block in case of errors. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Josh Wu <josh.wu@atmel.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
parent
9626d03e8d
commit
375123976f
@ -899,9 +899,10 @@ static int atmel_isi_probe_dt(struct atmel_isi *isi,
|
||||
}
|
||||
|
||||
err = v4l2_of_parse_endpoint(np, &ep);
|
||||
of_node_put(np);
|
||||
if (err) {
|
||||
dev_err(&pdev->dev, "Could not parse the endpoint\n");
|
||||
goto err_probe_dt;
|
||||
return err;
|
||||
}
|
||||
|
||||
switch (ep.bus.parallel.bus_width) {
|
||||
@ -915,14 +916,10 @@ static int atmel_isi_probe_dt(struct atmel_isi *isi,
|
||||
default:
|
||||
dev_err(&pdev->dev, "Unsupported bus width: %d\n",
|
||||
ep.bus.parallel.bus_width);
|
||||
err = -EINVAL;
|
||||
goto err_probe_dt;
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
err_probe_dt:
|
||||
of_node_put(np);
|
||||
|
||||
return err;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int atmel_isi_probe(struct platform_device *pdev)
|
||||
|
Loading…
Reference in New Issue
Block a user