Skip to content

Commit c4b7779

Browse files
Zhen Leimchehab
authored andcommitted
media: nuvoton: Fix an error check in npcm_video_ece_init()
When function of_find_device_by_node() fails, it returns NULL instead of an error code. So the corresponding error check logic should be modified to check whether the return value is NULL and set the error code to be returned as -ENODEV. Fixes: 46c15a4 ("media: nuvoton: Add driver for NPCM video capture and encoding engine") Cc: [email protected] Signed-off-by: Zhen Lei <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent c36b9ad commit c4b7779

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/media/platform/nuvoton/npcm-video.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,9 +1665,9 @@ static int npcm_video_ece_init(struct npcm_video *video)
16651665
dev_info(dev, "Support HEXTILE pixel format\n");
16661666

16671667
ece_pdev = of_find_device_by_node(ece_node);
1668-
if (IS_ERR(ece_pdev)) {
1668+
if (!ece_pdev) {
16691669
dev_err(dev, "Failed to find ECE device\n");
1670-
return PTR_ERR(ece_pdev);
1670+
return -ENODEV;
16711671
}
16721672
of_node_put(ece_node);
16731673

0 commit comments

Comments
 (0)