i2c: muxes: fix leaked i2c adapter device node references

Every call of of_parse_phandle() increments user count of found device
node, if OF_DYNAMIC is enabled.

The change fixes all similar addressed cases in drivers/i2c.

Signed-off-by: Vladimir Zapolskiy <vz@mleia.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
Vladimir Zapolskiy
2015-08-26 23:59:33 +03:00
committed by Wolfram Sang
parent 3fffd12839
commit bdbf4a29ee
4 changed files with 4 additions and 0 deletions

View File

@@ -197,6 +197,7 @@ static int i2c_arbitrator_probe(struct platform_device *pdev)
return -EINVAL;
}
arb->parent = of_get_i2c_adapter_by_node(parent_np);
of_node_put(parent_np);
if (!arb->parent) {
dev_err(dev, "Cannot find parent bus\n");
return -EPROBE_DEFER;