i2c: arb-gpio-challenge: use of_get_i2c_adapter_by_node interface
authorVladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Mon, 27 Jul 2015 14:30:51 +0000 (17:30 +0300)
committerWolfram Sang <wsa@the-dreams.de>
Mon, 10 Aug 2015 06:37:36 +0000 (08:37 +0200)
This change is needed to properly lock I2C parent bus driver.

Prior to this change i2c_put_adapter() is misused, which may lead
to an overflow over zero of I2C bus driver user counter.

Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/muxes/i2c-arb-gpio-challenge.c

index 5cf1b60b69e2140e674c7245577971c12c3e65b5..71aac0911bf75eed8fbfc7a55ab006af75e69354 100644 (file)
@@ -196,7 +196,7 @@ static int i2c_arbitrator_probe(struct platform_device *pdev)
                dev_err(dev, "Cannot parse i2c-parent\n");
                return -EINVAL;
        }
-       arb->parent = of_find_i2c_adapter_by_node(parent_np);
+       arb->parent = of_get_i2c_adapter_by_node(parent_np);
        if (!arb->parent) {
                dev_err(dev, "Cannot find parent bus\n");
                return -EPROBE_DEFER;