Commit b773530a authored by Markus Elfring's avatar Markus Elfring Committed by Hans Verkuil
Browse files

media: c8sectpfe: Call of_node_put(i2c_bus) only once in c8sectpfe_probe()



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: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
parent b50231ff
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -797,13 +797,12 @@ static int c8sectpfe_probe(struct platform_device *pdev)
		}
		tsin->i2c_adapter =
			of_find_i2c_adapter_by_node(i2c_bus);
		of_node_put(i2c_bus);
		if (!tsin->i2c_adapter) {
			dev_err(&pdev->dev, "No i2c adapter found\n");
			of_node_put(i2c_bus);
			ret = -ENODEV;
			goto err_node_put;
		}
		of_node_put(i2c_bus);

		/* Acquire reset GPIO and activate it */
		tsin->rst_gpio = devm_fwnode_gpiod_get(dev,