diff --git a/drivers/media/platform/tegra/cdi/cdi_dev.c b/drivers/media/platform/tegra/cdi/cdi_dev.c index dcba0587..417b32aa 100644 --- a/drivers/media/platform/tegra/cdi/cdi_dev.c +++ b/drivers/media/platform/tegra/cdi/cdi_dev.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 -// Copyright (c) 2015-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// Copyright (c) 2015-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include #include @@ -656,7 +656,7 @@ static int cdi_dev_probe(struct i2c_client *client, for (i = 0; i < numLinks; i++) { err = of_property_read_u32_index(child_max20087, "links", i, &link); if (err == 0) { - if ((link >= 0) && (link < MAX_POWER_LINKS_PER_BLOCK)) { + if (link < MAX_POWER_LINKS_PER_BLOCK) { info->max20087.links[i] = (u8) link; } else { dev_err(&client->dev, "%s: Incorrect camera module index: %d\n", diff --git a/drivers/platform/tegra/rtcpu/clk-group.c b/drivers/platform/tegra/rtcpu/clk-group.c index 5b0ba9dc..e113d406 100644 --- a/drivers/platform/tegra/rtcpu/clk-group.c +++ b/drivers/platform/tegra/rtcpu/clk-group.c @@ -159,9 +159,14 @@ static void camrtc_clk_group_error( int error) { const char *name = "unnamed"; + int ret; - of_property_read_string_index(grp->device->of_node, + ret = of_property_read_string_index(grp->device->of_node, "clock-names", index, &name); + + if (ret < 0) + dev_warn(grp->device, "Cannot find clock in clock-names\n"); + dev_warn(grp->device, "%s clk %s (at [%d]): failed (%d)\n", op, name, index, error); } diff --git a/drivers/platform/tegra/rtcpu/reset-group.c b/drivers/platform/tegra/rtcpu/reset-group.c index 776dad6b..e4603d41 100644 --- a/drivers/platform/tegra/rtcpu/reset-group.c +++ b/drivers/platform/tegra/rtcpu/reset-group.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-2.0 -// Copyright (c) 2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved. #include "reset-group.h" @@ -96,9 +96,13 @@ static void camrtc_reset_group_error( int error) { const char *name = "unnamed"; + int ret; - of_property_read_string_index(grp->device->of_node, + ret = of_property_read_string_index(grp->device->of_node, grp->group_name, index, &name); + if (ret < 0) + dev_warn(grp->device, "Cannot find reset in %s\n", grp->group_name); + dev_warn(grp->device, "%s reset %s (at %s[%d]): %d\n", op, name, grp->group_name, index, error); }