Commit 3d797215 authored by Wolfram Sang's avatar Wolfram Sang Committed by Greg Kroah-Hartman

i2c: rcar: enable RuntimePM before registering to the core

commit 4f7effdd 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: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d60c2e8a
...@@ -712,15 +712,16 @@ static int rcar_i2c_probe(struct platform_device *pdev) ...@@ -712,15 +712,16 @@ static int rcar_i2c_probe(struct platform_device *pdev)
return ret; return ret;
} }
pm_runtime_enable(dev);
platform_set_drvdata(pdev, priv);
ret = i2c_add_numbered_adapter(adap); ret = i2c_add_numbered_adapter(adap);
if (ret < 0) { if (ret < 0) {
dev_err(dev, "reg adap failed: %d\n", ret); dev_err(dev, "reg adap failed: %d\n", ret);
pm_runtime_disable(dev);
return ret; return ret;
} }
pm_runtime_enable(dev);
platform_set_drvdata(pdev, priv);
dev_info(dev, "probed\n"); dev_info(dev, "probed\n");
return 0; 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