Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1725893

Re: [PATCH v5 3/3] eeprom: at24: enable runtime pm support

From Sakari Ailus <sakari.ailus@iki.fi>
Newsgroups linux.kernel
Subject Re: [PATCH v5 3/3] eeprom: at24: enable runtime pm support
Date 2017-09-04 09:40 +0200
Message-ID <ulU9c-2BO-17@gated-at.bofh.it> (permalink)
References <ulTd8-211-7@gated-at.bofh.it> <ulTmO-24c-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Divagar,

On Mon, Sep 04, 2017 at 12:10:45PM +0530, Divagar Mohandass wrote:
> Currently the device is kept in D0, there is an opportunity
> to save power by enabling runtime pm.
> 
> Device can be daisy chained from PMIC and we can't rely on I2C core
> for auto resume/suspend. Driver will decide when to resume/suspend.
> 
> Signed-off-by: Divagar Mohandass <divagar.mohandass@intel.com>
> ---
>  drivers/misc/eeprom/at24.c | 40 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 40 insertions(+)
> 
> diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c
> index 2199c42..03f5cb7 100644
> --- a/drivers/misc/eeprom/at24.c
> +++ b/drivers/misc/eeprom/at24.c
> @@ -750,9 +782,12 @@ static int at24_probe(struct i2c_client *client, const struct i2c_device_id *id)
>  	err = at24_read(at24, 0, &test_byte, 1);

You do pm_runtime_put()s here and drop the ones below as it's needed
unconditionally. Then I think we're done.

>  	if (err) {
>  		err = -ENODEV;
> +		pm_runtime_put(&client->dev);
>  		goto err_clients;
>  	}
>  
> +	pm_runtime_put(&client->dev);
> +
>  	at24->nvmem_config.name = dev_name(&client->dev);
>  	at24->nvmem_config.dev = &client->dev;
>  	at24->nvmem_config.read_only = !writable;

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ailus@iki.fi

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v5 0/3] enable eeprom "size" property and runtime pm Divagar Mohandass <divagar.mohandass@intel.com> - 2017-09-04 08:40 +0200
  [PATCH v5 3/3] eeprom: at24: enable runtime pm support Divagar Mohandass <divagar.mohandass@intel.com> - 2017-09-04 08:50 +0200
    Re: [PATCH v5 3/3] eeprom: at24: enable runtime pm support Sakari Ailus <sakari.ailus@iki.fi> - 2017-09-04 09:40 +0200
      RE: [PATCH v5 3/3] eeprom: at24: enable runtime pm support "Mohandass, Divagar" <divagar.mohandass@intel.com> - 2017-09-04 12:30 +0200
  [PATCH v5 1/3] dt-bindings: add eeprom "size" property Divagar Mohandass <divagar.mohandass@intel.com> - 2017-09-04 08:50 +0200
  [PATCH v5 2/3] eeprom: at24: add support to fetch eeprom device property "size" Divagar Mohandass <divagar.mohandass@intel.com> - 2017-09-04 08:50 +0200

csiph-web