On 25/11/2024 10:34, Vikram Sharma wrote:
Introducing a new function camss_link_err to avoid repition of
same error message, improving code maintainability.
Signed-off-by: Vikram Sharma <quic_vikramsa@xxxxxxxxxxx>
---
drivers/media/platform/qcom/camss/camss.c | 60 ++++++++++++++---------
1 file changed, 37 insertions(+), 23 deletions(-)
diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c
index 9fb31f4c18ad..520c5bc7a265 100644
--- a/drivers/media/platform/qcom/camss/camss.c
+++ b/drivers/media/platform/qcom/camss/camss.c
@@ -1993,6 +1993,26 @@ static int camss_init_subdevices(struct camss *camss)
return 0;
}
+/*
+ * camss_link_entities - Register subdev nodes and create links
+ * camss_link_err - print error in case link creation fails
+ * @src_name: name for source of the link
+ * @sink_name: name for sink of the link
+ */
+inline void camss_link_err(struct camss *camss,
+ const char *src_name,
+ const char *sink_name,
+ int ret)
+{
+ if (!camss || !src_name || !sink_name)
+ return;
You don't need this defensive coding error check, please drop.
Once done you can add
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@xxxxxxxxxx>