Skip to contentSkip to conversation

power: supply: bq24257: skip 'struct acpi_device_id' when !CONFIG_ACPI

PATCH In review Krzysztof Kozlowski 2 participants 8 messages Sep 11, 2020 – Oct 3, 2020 Power supply

lore
Share & tools
lore
#0 lore raw

PATCH 1/7 power: supply: bq24257: skip 'struct acpi_device_id' when !CONFIG_ACPI

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=]

---
 drivers/power/supply/bq24257_charger.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/power/supply/bq24257_charger.c +2 -0
index 8e60cb0f3c3f..96cb3290bcaa 100644
@@ -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 = {
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/7 power: supply: bq2515x: fix kerneldoc

Fix kerneldoc W=1 warning:

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

---
 drivers/power/supply/bq2515x_charger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/bq2515x_charger.c +1 -1
index 9dcb61ea4cf2..374b112f712a 100644
@@ -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;
Signature · 1 line
2.17.1
#2 lore raw

PATCH 3/7 power: supply: bq25890: skip 'struct acpi_device_id' when !CONFIG_ACPI

In reply to 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=]

---
 drivers/power/supply/bq25890_charger.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/power/supply/bq25890_charger.c +2 -0
index 77150667e36b..74b129ddc298 100644
@@ -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 = {
Signature · 1 line
2.17.1
#3 lore raw

PATCH 4/7 power: supply: goldfish: skip 'struct acpi_device_id' when !CONFIG_ACPI

In reply to 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=]

---
 drivers/power/supply/goldfish_battery.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/power/supply/goldfish_battery.c +2 -0
index c2644a9fe80f..bf1754355c9f 100644
@@ -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,
Signature · 1 line
2.17.1
#4 lore raw

PATCH 5/7 power: supply: rt9455: skip 'struct acpi_device_id' when !CONFIG_ACPI

In reply to 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=]

---
 drivers/power/supply/rt9455_charger.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/power/supply/rt9455_charger.c +2 -0
index 29161ae90245..594bb3b8a4d1 100644
@@ -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,
Signature · 1 line
2.17.1
#5 lore raw

PATCH 6/7 power: supply: charger-manager: drop unused charger assignment

In reply to 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")
---
 drivers/power/supply/charger-manager.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/power/supply/charger-manager.c +1 -6
index 07992821e252..b2ca79173f95 100644
@@ -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);
 
Signature · 1 line
2.17.1
#6 lore raw

PATCH 7/7 power: supply: pm2301: drop duplicated i2c_device_id

In reply to 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=]

---
 drivers/power/supply/pm2301_charger.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/power/supply/pm2301_charger.c +0 -5
index 787867805944..2df6a2459d1f 100644
@@ -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)) {
Signature · 1 line
2.17.1
#7 lore raw
In reply to Krzysztof Kozlowski

Hi,

Thanks for the cleanup, I queued all 7 patches.

-- Sebastian

Quoted 31 lines · 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=]

---
 drivers/power/supply/bq24257_charger.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/power/supply/bq24257_charger.c +2 -0
index 8e60cb0f3c3f..96cb3290bcaa 100644
@@ -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 = {