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


Groups > linux.kernel > #1527609

Re: [PATCH 1/2] power: supply: sbs-battery: use fixed device name

From Nicolas Saenz Julienne <nicolas.saenz@prodys.net>
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] power: supply: sbs-battery: use fixed device name
Date 2016-11-22 16:40 +0100
Message-ID <sGlkS-vj-37@gated-at.bofh.it> (permalink)
References <sG1ma-4Iy-3@gated-at.bofh.it> <sG1ma-4Iy-9@gated-at.bofh.it> <sGlbb-rU-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
> 

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


Thread

[PATCH 1/2] power: supply: sbs-battery: use fixed device name Nicola Saenz Julienne <nicolas.saenz@prodys.net> - 2016-11-21 19:20 +0100
  Re: [PATCH 1/2] power: supply: sbs-battery: use fixed device name Sebastian Reichel <sre@kernel.org> - 2016-11-22 16:30 +0100
    Re: [PATCH 1/2] power: supply: sbs-battery: use fixed device name Nicolas Saenz Julienne <nicolas.saenz@prodys.net> - 2016-11-22 16:40 +0100
      Re: [PATCH 1/2] power: supply: sbs-battery: use fixed device name Sebastian Reichel <sre@kernel.org> - 2016-11-22 17:20 +0100

csiph-web