public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Saenz Julienne <nicolas.saenz@prodys.net>
To: Sebastian Reichel <sre@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org
Subject: Re: [PATCH 1/2] power: supply: sbs-battery: use fixed device name
Date: Tue, 22 Nov 2016 16:31:51 +0100	[thread overview]
Message-ID: <271e2a75-4676-b9ac-296b-282effc73d47@prodys.net> (raw)
In-Reply-To: <20161122152348.ip3gz3mea4fgrejl@earth>

Hi Sebastian,
sorry I wasn't aware of that feature, I'll have a look at the whole
thing and rework the patch.

Regards,
Nicolas

On 22/11/16 16:23, Sebastian Reichel wrote:
> Hi,
> 
> On Mon, Nov 21, 2016 at 07:04:50PM +0100, Nicola Saenz Julienne wrote:
>> The current device name for sbs-battery is derived from it's i2c address.
>> This is not acceptable if we want to be able to trigger the
>> "external_power_changed()" routine from a charger driver.
>>
>> Signed-off-by: Nicola Saenz Julienne <nicolas.saenz@prodys.net>
>> ---
>>  drivers/power/supply/sbs-battery.c | 6 +-----
>>  1 file changed, 1 insertion(+), 5 deletions(-)
>>
>> diff --git a/drivers/power/supply/sbs-battery.c b/drivers/power/supply/sbs-battery.c
>> index 8bb2eb3..9565c696 100644
>> --- a/drivers/power/supply/sbs-battery.c
>> +++ b/drivers/power/supply/sbs-battery.c
>> @@ -740,6 +740,7 @@ static void sbs_delayed_work(struct work_struct *work)
>>  }
>>  
>>  static const struct power_supply_desc sbs_default_desc = {
>> +	.name = "sbs-battery",
>>  	.type = POWER_SUPPLY_TYPE_BATTERY,
>>  	.properties = sbs_properties,
>>  	.num_properties = ARRAY_SIZE(sbs_properties),
>> @@ -762,11 +763,6 @@ static int sbs_probe(struct i2c_client *client,
>>  	if (!sbs_desc)
>>  		return -ENOMEM;
>>  
>> -	sbs_desc->name = devm_kasprintf(&client->dev, GFP_KERNEL, "sbs-%s",
>> -			dev_name(&client->dev));
>> -	if (!sbs_desc->name)
>> -		return -ENOMEM;
>> -
>>  	chip = devm_kzalloc(&client->dev, sizeof(struct sbs_info), GFP_KERNEL);
>>  	if (!chip)
>>  		return -ENOMEM;
> 
> NAK. This is not ok for systems using multiple sbs-batteries.
> Also please read:
> 
> Documentation/devicetree/bindings/power/supply/power_supply.txt
> 
> -- Sebastian
> 

  reply	other threads:[~2016-11-22 15:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-21 18:04 [PATCH 0/2] power: supply: add sbs-charger driver Nicola Saenz Julienne
2016-11-21 18:04 ` [PATCH 1/2] power: supply: sbs-battery: use fixed device name Nicola Saenz Julienne
2016-11-22 15:23   ` Sebastian Reichel
2016-11-22 15:31     ` Nicolas Saenz Julienne [this message]
2016-11-22 16:17       ` Sebastian Reichel
2016-11-21 18:04 ` [PATCH 2/2] power: supply: add sbs-charger driver Nicola Saenz Julienne
2016-11-22 16:11   ` Sebastian Reichel
2016-11-23  1:06   ` Phil Reid
2016-11-23  1:17     ` Phil Reid

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=271e2a75-4676-b9ac-296b-282effc73d47@prodys.net \
    --to=nicolas.saenz@prodys.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox