Commit 49d851ce authored by Wolfram Sang's avatar Wolfram Sang Committed by Greg Kroah-Hartman

i2c: rcar: enable RuntimePM before registering to the core

commit 4f7effddf4549d57114289f273710f077c4c330a upstream.

The core may register clients attached to this master which may use
funtionality from the master. So, RuntimePM must be enabled before, otherwise
this will fail. While here, move drvdata, too.
Reported-by: 's avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: 's avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: 's avatarWolfram Sang <wsa@the-dreams.de>
Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2aafe811
......@@ -673,15 +673,16 @@ static int rcar_i2c_probe(struct platform_device *pdev)
return ret;
}
pm_runtime_enable(dev);
platform_set_drvdata(pdev, priv);
ret = i2c_add_numbered_adapter(adap);
if (ret < 0) {
dev_err(dev, "reg adap failed: %d\n", ret);
pm_runtime_disable(dev);
return ret;
}
pm_runtime_enable(dev);
platform_set_drvdata(pdev, priv);
dev_info(dev, "probed\n");
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment