summaryrefslogtreecommitdiffstats
path: root/drivers/power/supply/ds2780_battery.c
AgeCommit message (Collapse)AuthorFilesLines
2021-01-16power: supply: ds2780: Switch to using the new API kobj_to_dev()Tian Tao1-4/+4
fixed the following coccicheck: drivers/power/supply/ds2780_battery.c:627:60-61: WARNING opportunity for kobj_to_dev() drivers/power/supply/ds2780_battery.c:672:60-61: WARNING opportunity for kobj_to_dev() drivers/power/supply/ds2780_battery.c:640:60-61: WARNING opportunity for kobj_to_dev() drivers/power/supply/ds2780_battery.c:685:60-61: WARNING opportunity for kobj_to_dev() Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2020-09-30power: supply: ds278x: fix spelling typoWang Qing1-3/+3
Modify the comment typo: "compliment" -> "complement". Signed-off-by: Wang Qing <wangqing@vivo.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner1-5/+1
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-13power: supply: ds2780: switch to devm_power_supply_registerSebastian Reichel1-12/+3
Simplify/Cleanup the driver by switching to devm_power_supply_register and dropping the driver's remove function. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2018-12-13power: supply: ds2780: fix race-condition in bin attribute registrationSebastian Reichel1-35/+20
This is a follow-up patch to the previous one, which fixed a race-condition during registration of the attribute group. This fixes the same issue for the binary attributes by adding them to the properly registered group. As a side effect the code is further cleaned up. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2018-12-13power: supply: ds2780: fix race-condition in sysfs registrationSebastian Reichel1-19/+4
This registers custom sysfs properties using the native functionality of the power-supply framework, which cleans up the code a bit and fixes a race-condition. Before this patch the sysfs attributes were not properly registered to udev. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2018-10-21power: supply: fix spelling mistake "Gauage" -> "Gauge"Colin Ian King1-1/+1
Trivial fix to spelling mistake in MODULE_DESCRIPTION text Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
2018-02-21power: add to_power_supply macro to the APIOgnjen Galic1-5/+0
This patch adds the to_power_supply macro to upcast a device to a power_supply struct. This is needed because the same piece of code using container_of is used in various other places, so we abstract away such low-level operations via a macro. Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Ognjen Galic <smclt30p@gmail.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2017-08-09power: supply: add const to bin_attribute structuresBhumika Goyal1-2/+2
Add const to bin_attribute structures as they are only passed to the functions sysfs_{remove/create}_bin_file or device_{remove/create}_bin_file. The corresponding parameters passed are of type const, so declare the structures to be const. Done using Coccinelle: @m disable optional_qualifier@ identifier s; position p; @@ static struct bin_attribute s@p={...}; @okay1@ position p; identifier m.s; @@ ( sysfs_create_bin_file(...,&s@p,...) | sysfs_remove_bin_file(...,&s@p,...) ) @bad@ position p!={m.p,okay1.p}; identifier m.s; @@ s@p @change depends on !bad disable optional_qualifier@ identifier m.s; @@ static +const struct bin_attribute s={...}; Same script was modified for device_{create/remove}_bin_file functions. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
2017-06-09w1: Add subsystem kernel public interfaceAndrew F. Davis1-1/+1
Like other subsystems we should be able to define slave devices outside of the w1 directory. To do this we move public facing interface definitions to include/linux/w1.h and rename the internal definition file to w1_internal.h. As w1_family.h and w1_int.h contained almost entirely public driver interface definitions we simply removed these files and moved the remaining definitions into w1_internal.h. With this we can now start to move slave devices out of w1/slaves and into the subsystem based on the function they implement, again like other drivers. Signed-off-by: Andrew F. Davis <afd@ti.com> Reviewed-by: Sebastian Reichel <sre@kernel.org> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-11power: move power supply drivers to power/supplySebastian Reichel1-0/+838
This moves all power supply drivers from drivers/power/ to drivers/power/supply/. The intention is a cleaner source tree, since drivers/power/ also contains frameworks unrelated to power supply, like adaptive voltage scaling. Signed-off-by: Sebastian Reichel <sre@kernel.org>