Re: [PATCH 1/2] i2c: xiic: Implement Power management

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

 



> +	ret = clk_prepare_enable(i2c->clk);
> +	if (ret)
> +		dev_err(&pdev->dev, "Unable to enable clock.\n");

Don't you want to bail out here? The clk refcounting will be messed up
if you continue.

> +err_clk_dis:
> +	clk_disable_unprepare(i2c->clk);
> +	pm_runtime_set_suspended(&pdev->dev);
> +	pm_runtime_disable(&pdev->dev);
> +	return ret;

To match the inverse of the activation order, I'd put the
clk_disable_unprepare after the pm_* calls. Couldn't it happen that
those calls need to change the clk state?

Attachment: signature.asc
Description: PGP signature


[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