Re: [PATCH] i2c: Encourage move to dev_pm_ops by warning on use of legacy methods

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

 



On Mon, 20 Dec 2010 21:41:00 +0000, Mark Brown wrote:
> Since the PM core wishes to transition away from the legacy suspend
> and resume methods and since removing them makes using PM core features
> like runtime PM much easier start warning when a driver is registered
> using the legacy methods.
> 
> Signed-off-by: Mark Brown <broonie@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
> ---
> 
> Clearly this is going to generate reams of warnings when lots of stuff
> is built in - I'm willing to work on fixing up drivers - so it should
> only be applied after the next merge window to give a chance for an
> active effort at migrating drivers before we spam everyone's logs.
> 
>  drivers/i2c/i2c-core.c |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
> index 6b4cc56..8cd82f4 100644
> --- a/drivers/i2c/i2c-core.c
> +++ b/drivers/i2c/i2c-core.c
> @@ -1140,6 +1140,14 @@ int i2c_register_driver(struct module *owner, struct i2c_driver *driver)
>  	if (res)
>  		return res;
>  
> +	/* Drivers should switch to dev_pm_ops instead. */
> +	if (driver->suspend)
> +		pr_warn("i2c-core: driver [%s] using legacy suspend method\n",
> +			driver->driver.name);
> +	if (driver->resume)
> +		pr_warn("i2c-core: driver [%s] using legacy resume method\n",
> +			driver->driver.name);
> +
>  	pr_debug("i2c-core: driver [%s] registered\n", driver->driver.name);
>  
>  	INIT_LIST_HEAD(&driver->clients);

Sorry for the delay. Applied, thanks.

-- 
Jean Delvare
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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