mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
i2c: rcar: fix PM ref counts in probe error paths
[ Upstream commit3fe2ec59db] We have to take care of ID_P_PM_BLOCKED when bailing out during probe. Fixes:7ee24eb508("i2c: rcar: disable PM in multi-master mode") Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Wolfram Sang <wsa@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
ebd4f37ac1
commit
c9542f5f90
|
|
@ -999,8 +999,10 @@ static int rcar_i2c_probe(struct platform_device *pdev)
|
||||||
pm_runtime_enable(dev);
|
pm_runtime_enable(dev);
|
||||||
pm_runtime_get_sync(dev);
|
pm_runtime_get_sync(dev);
|
||||||
ret = rcar_i2c_clock_calculate(priv);
|
ret = rcar_i2c_clock_calculate(priv);
|
||||||
if (ret < 0)
|
if (ret < 0) {
|
||||||
goto out_pm_put;
|
pm_runtime_put(dev);
|
||||||
|
goto out_pm_disable;
|
||||||
|
}
|
||||||
|
|
||||||
rcar_i2c_write(priv, ICSAR, 0); /* Gen2: must be 0 if not using slave */
|
rcar_i2c_write(priv, ICSAR, 0); /* Gen2: must be 0 if not using slave */
|
||||||
|
|
||||||
|
|
@ -1029,19 +1031,19 @@ static int rcar_i2c_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
ret = platform_get_irq(pdev, 0);
|
ret = platform_get_irq(pdev, 0);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto out_pm_disable;
|
goto out_pm_put;
|
||||||
priv->irq = ret;
|
priv->irq = ret;
|
||||||
ret = devm_request_irq(dev, priv->irq, irqhandler, irqflags, dev_name(dev), priv);
|
ret = devm_request_irq(dev, priv->irq, irqhandler, irqflags, dev_name(dev), priv);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
dev_err(dev, "cannot get irq %d\n", priv->irq);
|
dev_err(dev, "cannot get irq %d\n", priv->irq);
|
||||||
goto out_pm_disable;
|
goto out_pm_put;
|
||||||
}
|
}
|
||||||
|
|
||||||
platform_set_drvdata(pdev, priv);
|
platform_set_drvdata(pdev, priv);
|
||||||
|
|
||||||
ret = i2c_add_numbered_adapter(adap);
|
ret = i2c_add_numbered_adapter(adap);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto out_pm_disable;
|
goto out_pm_put;
|
||||||
|
|
||||||
if (priv->flags & ID_P_HOST_NOTIFY) {
|
if (priv->flags & ID_P_HOST_NOTIFY) {
|
||||||
priv->host_notify_client = i2c_new_slave_host_notify_device(adap);
|
priv->host_notify_client = i2c_new_slave_host_notify_device(adap);
|
||||||
|
|
@ -1058,7 +1060,8 @@ static int rcar_i2c_probe(struct platform_device *pdev)
|
||||||
out_del_device:
|
out_del_device:
|
||||||
i2c_del_adapter(&priv->adap);
|
i2c_del_adapter(&priv->adap);
|
||||||
out_pm_put:
|
out_pm_put:
|
||||||
pm_runtime_put(dev);
|
if (priv->flags & ID_P_PM_BLOCKED)
|
||||||
|
pm_runtime_put(dev);
|
||||||
out_pm_disable:
|
out_pm_disable:
|
||||||
pm_runtime_disable(dev);
|
pm_runtime_disable(dev);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user