linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] power: supply: bq24257: skip 'struct acpi_device_id' when !CONFIG_ACPI
@ 2020-09-11 16:27 Krzysztof Kozlowski
  2020-09-11 16:27 ` [PATCH 2/7] power: supply: bq2515x: fix kerneldoc Krzysztof Kozlowski
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-11 16:27 UTC (permalink / raw)
  To: Sebastian Reichel, Jonathan Bakker, linux-pm, linux-kernel
  Cc: Krzysztof Kozlowski

Since ACPI_PTR() is used to NULLify the value when !CONFIG_ACPI, the
struct acpi_device_id becomes unused:

  drivers/power/supply/bq24257_charger.c:1155:36: warning:
    'bq24257_acpi_match' defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/power/supply/bq24257_charger.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/power/supply/bq24257_charger.c b/drivers/power/supply/bq24257_charger.c
index 8e60cb0f3c3f..96cb3290bcaa 100644
--- a/drivers/power/supply/bq24257_charger.c
+++ b/drivers/power/supply/bq24257_charger.c
@@ -1152,6 +1152,7 @@ static const struct of_device_id bq24257_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, bq24257_of_match);
 
+#ifdef CONFIG_ACPI
 static const struct acpi_device_id bq24257_acpi_match[] = {
 	{ "BQ242500", BQ24250 },
 	{ "BQ242510", BQ24251 },
@@ -1159,6 +1160,7 @@ static const struct acpi_device_id bq24257_acpi_match[] = {
 	{},
 };
 MODULE_DEVICE_TABLE(acpi, bq24257_acpi_match);
+#endif
 
 static struct i2c_driver bq24257_driver = {
 	.driver = {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/7] power: supply: bq2515x: fix kerneldoc
  2020-09-11 16:27 [PATCH 1/7] power: supply: bq24257: skip 'struct acpi_device_id' when !CONFIG_ACPI Krzysztof Kozlowski
@ 2020-09-11 16:27 ` Krzysztof Kozlowski
  2020-09-11 16:27 ` [PATCH 3/7] power: supply: bq25890: skip 'struct acpi_device_id' when !CONFIG_ACPI Krzysztof Kozlowski
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-11 16:27 UTC (permalink / raw)
  To: Sebastian Reichel, Jonathan Bakker, linux-pm, linux-kernel
  Cc: Krzysztof Kozlowski

Fix kerneldoc W=1 warning:

  drivers/power/supply/bq2515x_charger.c:189: warning:
    Function parameter or member 'init_data' not described in 'bq2515x_device'

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/power/supply/bq2515x_charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/bq2515x_charger.c b/drivers/power/supply/bq2515x_charger.c
index 9dcb61ea4cf2..374b112f712a 100644
--- a/drivers/power/supply/bq2515x_charger.c
+++ b/drivers/power/supply/bq2515x_charger.c
@@ -168,7 +168,7 @@ enum bq2515x_id {
  * @device_id: value of device_id
  * @mains_online: boolean value indicating power supply online
  *
- * @bq2515x_init_data init_data: charger initialization data structure
+ * @init_data: charger initialization data structure
  */
 struct bq2515x_device {
 	struct power_supply *mains;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/7] power: supply: bq25890: skip 'struct acpi_device_id' when !CONFIG_ACPI
  2020-09-11 16:27 [PATCH 1/7] power: supply: bq24257: skip 'struct acpi_device_id' when !CONFIG_ACPI Krzysztof Kozlowski
  2020-09-11 16:27 ` [PATCH 2/7] power: supply: bq2515x: fix kerneldoc Krzysztof Kozlowski
@ 2020-09-11 16:27 ` Krzysztof Kozlowski
  2020-09-11 16:27 ` [PATCH 4/7] power: supply: goldfish: " Krzysztof Kozlowski
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-11 16:27 UTC (permalink / raw)
  To: Sebastian Reichel, Jonathan Bakker, linux-pm, linux-kernel
  Cc: Krzysztof Kozlowski

Since ACPI_PTR() is used to NULLify the value when !CONFIG_ACPI, the
struct acpi_device_id becomes unused:

  drivers/power/supply/bq25890_charger.c:1076:36: warning:
    'bq25890_acpi_match' defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/power/supply/bq25890_charger.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/power/supply/bq25890_charger.c b/drivers/power/supply/bq25890_charger.c
index 77150667e36b..74b129ddc298 100644
--- a/drivers/power/supply/bq25890_charger.c
+++ b/drivers/power/supply/bq25890_charger.c
@@ -1073,11 +1073,13 @@ static const struct of_device_id bq25890_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, bq25890_of_match);
 
+#ifdef CONFIG_ACPI
 static const struct acpi_device_id bq25890_acpi_match[] = {
 	{"BQ258900", 0},
 	{},
 };
 MODULE_DEVICE_TABLE(acpi, bq25890_acpi_match);
+#endif
 
 static struct i2c_driver bq25890_driver = {
 	.driver = {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/7] power: supply: goldfish: skip 'struct acpi_device_id' when !CONFIG_ACPI
  2020-09-11 16:27 [PATCH 1/7] power: supply: bq24257: skip 'struct acpi_device_id' when !CONFIG_ACPI Krzysztof Kozlowski
  2020-09-11 16:27 ` [PATCH 2/7] power: supply: bq2515x: fix kerneldoc Krzysztof Kozlowski
  2020-09-11 16:27 ` [PATCH 3/7] power: supply: bq25890: skip 'struct acpi_device_id' when !CONFIG_ACPI Krzysztof Kozlowski
@ 2020-09-11 16:27 ` Krzysztof Kozlowski
  2020-09-11 16:27 ` [PATCH 5/7] power: supply: rt9455: " Krzysztof Kozlowski
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-11 16:27 UTC (permalink / raw)
  To: Sebastian Reichel, Jonathan Bakker, linux-pm, linux-kernel
  Cc: Krzysztof Kozlowski

Since ACPI_PTR() is used to NULLify the value when !CONFIG_ACPI, the
struct acpi_device_id becomes unused:

  drivers/power/supply/goldfish_battery.c:269:36: warning:
    'goldfish_battery_acpi_match' defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/power/supply/goldfish_battery.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/power/supply/goldfish_battery.c b/drivers/power/supply/goldfish_battery.c
index c2644a9fe80f..bf1754355c9f 100644
--- a/drivers/power/supply/goldfish_battery.c
+++ b/drivers/power/supply/goldfish_battery.c
@@ -266,11 +266,13 @@ static const struct of_device_id goldfish_battery_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, goldfish_battery_of_match);
 
+#ifdef CONFIG_ACPI
 static const struct acpi_device_id goldfish_battery_acpi_match[] = {
 	{ "GFSH0001", 0 },
 	{ },
 };
 MODULE_DEVICE_TABLE(acpi, goldfish_battery_acpi_match);
+#endif
 
 static struct platform_driver goldfish_battery_device = {
 	.probe		= goldfish_battery_probe,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 5/7] power: supply: rt9455: skip 'struct acpi_device_id' when !CONFIG_ACPI
  2020-09-11 16:27 [PATCH 1/7] power: supply: bq24257: skip 'struct acpi_device_id' when !CONFIG_ACPI Krzysztof Kozlowski
                   ` (2 preceding siblings ...)
  2020-09-11 16:27 ` [PATCH 4/7] power: supply: goldfish: " Krzysztof Kozlowski
@ 2020-09-11 16:27 ` Krzysztof Kozlowski
  2020-09-11 16:27 ` [PATCH 6/7] power: supply: charger-manager: drop unused charger assignment Krzysztof Kozlowski
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-11 16:27 UTC (permalink / raw)
  To: Sebastian Reichel, Jonathan Bakker, linux-pm, linux-kernel
  Cc: Krzysztof Kozlowski

Since ACPI_PTR() is used to NULLify the value when !CONFIG_ACPI, the
struct acpi_device_id becomes unused:

  drivers/power/supply/rt9455_charger.c:1734:36: warning:
    'rt9455_i2c_acpi_match' defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/power/supply/rt9455_charger.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/power/supply/rt9455_charger.c b/drivers/power/supply/rt9455_charger.c
index 29161ae90245..594bb3b8a4d1 100644
--- a/drivers/power/supply/rt9455_charger.c
+++ b/drivers/power/supply/rt9455_charger.c
@@ -1731,11 +1731,13 @@ static const struct of_device_id rt9455_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, rt9455_of_match);
 
+#ifdef CONFIG_ACPI
 static const struct acpi_device_id rt9455_i2c_acpi_match[] = {
 	{ "RT945500", 0 },
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, rt9455_i2c_acpi_match);
+#endif
 
 static struct i2c_driver rt9455_driver = {
 	.probe		= rt9455_probe,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 6/7] power: supply: charger-manager: drop unused charger assignment
  2020-09-11 16:27 [PATCH 1/7] power: supply: bq24257: skip 'struct acpi_device_id' when !CONFIG_ACPI Krzysztof Kozlowski
                   ` (3 preceding siblings ...)
  2020-09-11 16:27 ` [PATCH 5/7] power: supply: rt9455: " Krzysztof Kozlowski
@ 2020-09-11 16:27 ` Krzysztof Kozlowski
  2020-09-11 16:27 ` [PATCH 7/7] power: supply: pm2301: drop duplicated i2c_device_id Krzysztof Kozlowski
  2020-10-03 20:29 ` [PATCH 1/7] power: supply: bq24257: skip 'struct acpi_device_id' when !CONFIG_ACPI Sebastian Reichel
  6 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-11 16:27 UTC (permalink / raw)
  To: Sebastian Reichel, Jonathan Bakker, linux-pm, linux-kernel
  Cc: Krzysztof Kozlowski

The 'charger' variable in error path is assigned but never used:

  drivers/power/supply/charger-manager.c: In function 'charger_manager_probe':
  drivers/power/supply/charger-manager.c:1626:29: warning: variable 'charger' set but not used [-Wunused-but-set-variable]

Fixes: c1f73028f75d ("power: supply: charger-manager: Update extcon functions")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/power/supply/charger-manager.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/power/supply/charger-manager.c b/drivers/power/supply/charger-manager.c
index 07992821e252..b2ca79173f95 100644
--- a/drivers/power/supply/charger-manager.c
+++ b/drivers/power/supply/charger-manager.c
@@ -1622,13 +1622,8 @@ static int charger_manager_probe(struct platform_device *pdev)
 	return 0;
 
 err_reg_extcon:
-	for (i = 0; i < desc->num_charger_regulators; i++) {
-		struct charger_regulator *charger;
-
-		charger = &desc->charger_regulators[i];
-
+	for (i = 0; i < desc->num_charger_regulators; i++)
 		regulator_put(desc->charger_regulators[i].consumer);
-	}
 
 	power_supply_unregister(cm->charger_psy);
 
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 7/7] power: supply: pm2301: drop duplicated i2c_device_id
  2020-09-11 16:27 [PATCH 1/7] power: supply: bq24257: skip 'struct acpi_device_id' when !CONFIG_ACPI Krzysztof Kozlowski
                   ` (4 preceding siblings ...)
  2020-09-11 16:27 ` [PATCH 6/7] power: supply: charger-manager: drop unused charger assignment Krzysztof Kozlowski
@ 2020-09-11 16:27 ` Krzysztof Kozlowski
  2020-10-03 20:29 ` [PATCH 1/7] power: supply: bq24257: skip 'struct acpi_device_id' when !CONFIG_ACPI Sebastian Reichel
  6 siblings, 0 replies; 8+ messages in thread
From: Krzysztof Kozlowski @ 2020-09-11 16:27 UTC (permalink / raw)
  To: Sebastian Reichel, Jonathan Bakker, linux-pm, linux-kernel
  Cc: Krzysztof Kozlowski

The driver defines two of 'struct i2c_device_id' but uses only one:

  drivers/power/supply/pm2301_charger.c:107:35: warning:
    'pm2xxx_ident' defined but not used [-Wunused-const-variable=]

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
---
 drivers/power/supply/pm2301_charger.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/power/supply/pm2301_charger.c b/drivers/power/supply/pm2301_charger.c
index 787867805944..2df6a2459d1f 100644
--- a/drivers/power/supply/pm2301_charger.c
+++ b/drivers/power/supply/pm2301_charger.c
@@ -104,11 +104,6 @@ static int pm2xxx_charger_current_map[] = {
 	3000,
 };
 
-static const struct i2c_device_id pm2xxx_ident[] = {
-	{ "pm2301", 0 },
-	{ }
-};
-
 static void set_lpn_pin(struct pm2xxx_charger *pm2)
 {
 	if (!pm2->ac.charger_connected && gpio_is_valid(pm2->lpn_pin)) {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/7] power: supply: bq24257: skip 'struct acpi_device_id' when !CONFIG_ACPI
  2020-09-11 16:27 [PATCH 1/7] power: supply: bq24257: skip 'struct acpi_device_id' when !CONFIG_ACPI Krzysztof Kozlowski
                   ` (5 preceding siblings ...)
  2020-09-11 16:27 ` [PATCH 7/7] power: supply: pm2301: drop duplicated i2c_device_id Krzysztof Kozlowski
@ 2020-10-03 20:29 ` Sebastian Reichel
  6 siblings, 0 replies; 8+ messages in thread
From: Sebastian Reichel @ 2020-10-03 20:29 UTC (permalink / raw)
  To: Krzysztof Kozlowski; +Cc: Jonathan Bakker, linux-pm, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1311 bytes --]

Hi,

Thanks for the cleanup, I queued all 7 patches.

-- Sebastian

On Fri, Sep 11, 2020 at 06:27:23PM +0200, Krzysztof Kozlowski wrote:
> Since ACPI_PTR() is used to NULLify the value when !CONFIG_ACPI, the
> struct acpi_device_id becomes unused:
> 
>   drivers/power/supply/bq24257_charger.c:1155:36: warning:
>     'bq24257_acpi_match' defined but not used [-Wunused-const-variable=]
> 
> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
> ---
>  drivers/power/supply/bq24257_charger.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/power/supply/bq24257_charger.c b/drivers/power/supply/bq24257_charger.c
> index 8e60cb0f3c3f..96cb3290bcaa 100644
> --- a/drivers/power/supply/bq24257_charger.c
> +++ b/drivers/power/supply/bq24257_charger.c
> @@ -1152,6 +1152,7 @@ static const struct of_device_id bq24257_of_match[] = {
>  };
>  MODULE_DEVICE_TABLE(of, bq24257_of_match);
>  
> +#ifdef CONFIG_ACPI
>  static const struct acpi_device_id bq24257_acpi_match[] = {
>  	{ "BQ242500", BQ24250 },
>  	{ "BQ242510", BQ24251 },
> @@ -1159,6 +1160,7 @@ static const struct acpi_device_id bq24257_acpi_match[] = {
>  	{},
>  };
>  MODULE_DEVICE_TABLE(acpi, bq24257_acpi_match);
> +#endif
>  
>  static struct i2c_driver bq24257_driver = {
>  	.driver = {

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-10-03 20:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-11 16:27 [PATCH 1/7] power: supply: bq24257: skip 'struct acpi_device_id' when !CONFIG_ACPI Krzysztof Kozlowski
2020-09-11 16:27 ` [PATCH 2/7] power: supply: bq2515x: fix kerneldoc Krzysztof Kozlowski
2020-09-11 16:27 ` [PATCH 3/7] power: supply: bq25890: skip 'struct acpi_device_id' when !CONFIG_ACPI Krzysztof Kozlowski
2020-09-11 16:27 ` [PATCH 4/7] power: supply: goldfish: " Krzysztof Kozlowski
2020-09-11 16:27 ` [PATCH 5/7] power: supply: rt9455: " Krzysztof Kozlowski
2020-09-11 16:27 ` [PATCH 6/7] power: supply: charger-manager: drop unused charger assignment Krzysztof Kozlowski
2020-09-11 16:27 ` [PATCH 7/7] power: supply: pm2301: drop duplicated i2c_device_id Krzysztof Kozlowski
2020-10-03 20:29 ` [PATCH 1/7] power: supply: bq24257: skip 'struct acpi_device_id' when !CONFIG_ACPI Sebastian Reichel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).