Re: [PATCH v3 1/2] i2c: rcar: reset controller is mandatory for Gen3+

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Wolfram,

[...]

>  		irqhandler = rcar_i2c_gen2_irq;
>  	}
>  
> -	if (priv->devtype == I2C_RCAR_GEN3) {
> -		priv->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
> -		if (!IS_ERR(priv->rstc)) {
> -			ret = reset_control_status(priv->rstc);
> -			if (ret < 0)
> -				priv->rstc = ERR_PTR(-ENOTSUPP);
> -		}
> -	}
> -
>  	/* Stay always active when multi-master to keep arbitration working */
>  	if (of_property_read_bool(dev->of_node, "multi-master"))
>  		priv->flags |= ID_P_PM_BLOCKED;
> @@ -1112,6 +1101,16 @@ static int rcar_i2c_probe(struct platform_device *pdev)
>  	if (of_property_read_bool(dev->of_node, "smbus"))
>  		priv->flags |= ID_P_HOST_NOTIFY;
>  
> +	if (priv->devtype == I2C_RCAR_GEN3) {
> +		priv->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
> +		if (IS_ERR(priv->rstc))
> +			goto out_pm_put;
> +
> +		ret = reset_control_status(priv->rstc);
> +		if (ret < 0)
> +			goto out_pm_put;
> +	}
> +

you moved this block to avoid the pm_runtime_put(dev);

Looks good!

Reviewed-by: Andi Shyti <andi.shyti@xxxxxxxxxx> 

Andi



[Index of Archives]     [Linux GPIO]     [Linux SPI]     [Linux Hardward Monitoring]     [LM Sensors]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux