summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLuca Ceresoli <luca.ceresoli@bootlin.com>2023-04-18 10:00:40 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2023-05-25 13:04:47 +0200
commit40ecb38e5c961174f86bfb4d5b1d2ae821cc45c2 (patch)
treeaf5048d8650491c0fb3d76d2848aff4318864b79 /drivers
parent6309986d7e42f68d6d13eccd81dfd7f3e2c3d92b (diff)
downloadlwn-40ecb38e5c961174f86bfb4d5b1d2ae821cc45c2.tar.gz
lwn-40ecb38e5c961174f86bfb4d5b1d2ae821cc45c2.zip
staging: media: tegra-video: improve error messages
tegra_vi_channels_alloc() can primarily fail for two reasons: 1. "ports" node not found 2. port_num > vi->soc->vi_max_channels Case 1 prints nothing, case 2 has a dev_err(). The caller [tegra_vi_init()] has a generic dev_err() on any failure. This mean that in case 2 we print two messages, and in case 1 we only print a generic message. Remove the generic message and add a specific message when case 1 happens, so that we always have one specific message without even increasing the number of dev_dbg*() calls. Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/media/tegra-video/vi.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c
index ddf683be506f..be27a93ebe2a 100644
--- a/drivers/staging/media/tegra-video/vi.c
+++ b/drivers/staging/media/tegra-video/vi.c
@@ -1363,7 +1363,7 @@ static int tegra_vi_channels_alloc(struct tegra_vi *vi)
ports = of_get_child_by_name(node, "ports");
if (!ports)
- return -ENODEV;
+ return dev_err_probe(vi->dev, -ENODEV, "%pOF: missing 'ports' node\n", node);
for_each_child_of_node(ports, port) {
if (!of_node_name_eq(port, "port"))
@@ -1923,11 +1923,8 @@ static int tegra_vi_init(struct host1x_client *client)
ret = tegra_vi_tpg_channels_alloc(vi);
else
ret = tegra_vi_channels_alloc(vi);
- if (ret < 0) {
- dev_err(vi->dev,
- "failed to allocate vi channels: %d\n", ret);
+ if (ret < 0)
goto free_chans;
- }
ret = tegra_vi_channels_init(vi);
if (ret < 0)