Skip to content

Commit 4e7b897

Browse files
elfringaloktiwa
authored andcommitted
media: c8sectpfe: Call of_node_put(i2c_bus) only once in c8sectpfe_probe()
[ Upstream commit b773530 ] An of_node_put(i2c_bus) call was immediately used after a pointer check for an of_find_i2c_adapter_by_node() call in this function implementation. Thus call such a function only once instead directly before the check. This issue was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Sasha Levin <[email protected]> (cherry picked from commit 33cc26204e3893f18bc8149046eaffcadeace0e4) Signed-off-by: Alok Tiwari <[email protected]>
1 parent 822bd09 commit 4e7b897

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -813,13 +813,12 @@ static int c8sectpfe_probe(struct platform_device *pdev)
813813
}
814814
tsin->i2c_adapter =
815815
of_find_i2c_adapter_by_node(i2c_bus);
816+
of_node_put(i2c_bus);
816817
if (!tsin->i2c_adapter) {
817818
dev_err(&pdev->dev, "No i2c adapter found\n");
818-
of_node_put(i2c_bus);
819819
ret = -ENODEV;
820820
goto err_clk_disable;
821821
}
822-
of_node_put(i2c_bus);
823822

824823
tsin->rst_gpio = of_get_named_gpio(child, "reset-gpios", 0);
825824

0 commit comments

Comments
 (0)