Skip to contentSkip to conversation

media: rkisp1: Promote link validation error to dev_err

PATCH In review Martijn Braam 2 participants 2 messages Jul 19, 2023 – Sep 22, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: rkisp1: Promote link validation error to dev_err

Show an error when the pipeline cannot start due to an invalid link instead of hiding it behind the debugging system.

---
 drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c +1 -1
index 8f3cba319762..9361b9086f6b 100644
@@ -1340,7 +1340,7 @@ static int rkisp1_capture_link_validate(struct media_link *link)
 	if (sd_fmt.format.height != cap->pix.fmt.height ||
 	    sd_fmt.format.width != cap->pix.fmt.width ||
 	    sd_fmt.format.code != fmt->mbus) {
-		dev_dbg(cap->rkisp1->dev,
+		dev_err(cap->rkisp1->dev,
 			"link '%s':%u -> '%s':%u not valid: 0x%04x/%ux%u != 0x%04x/%ux%u\n",
 			link->source->entity->name, link->source->index,
 			link->sink->entity->name, link->sink->index,
Signature · 7 lines
2.40.0


_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip
maintainer
#1 lore raw

Hi Martijn,

Thank you for the patch.

Quoted 2 lines · Martijn Braam

Show an error when the pipeline cannot start due to an invalid link instead of hiding it behind the debugging system.

While this can help debugging issues in applications, allowing unpriviledged applications to control messages being printed to the kernel log is frowned upon, is it could flood the log. This is why these messages use dev_dbg() and not dev_err().

Quoted 18 lines
---
 drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c +1 -1
index 8f3cba319762..9361b9086f6b 100644
@@ -1340,7 +1340,7 @@ static int rkisp1_capture_link_validate(struct media_link *link)
 	if (sd_fmt.format.height != cap->pix.fmt.height ||
 	    sd_fmt.format.width != cap->pix.fmt.width ||
 	    sd_fmt.format.code != fmt->mbus) {
-		dev_dbg(cap->rkisp1->dev,
+		dev_err(cap->rkisp1->dev,
 			"link '%s':%u -> '%s':%u not valid: 0x%04x/%ux%u != 0x%04x/%ux%u\n",
 			link->source->entity->name, link->source->index,
 			link->sink->entity->name, link->sink->index,
Signature · 3 lines
Regards,

Laurent Pinchart