Skip to contentSkip to conversation

linux-next: manual merge of the battery tree with the hid tree

PATCH Stephen Rothwell 2 participants 3 messages Mar 20, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi Sebastian,

Today's linux-next merge of the battery tree got conflicts in drivers/hid/wacom.h and drivers/hid/wacom_sys.c between commit 953f2c5f7163 ("HID: wacom: Centralize updating of wacom_wac battery status") and fce9957d8f61 ("HID: wacom: Allow dynamic battery creation/destruction") from the hid tree and commit 297d716f6260 ("power_supply: Change ownership from driver to core") from the battery tree.

I fixed it up (see below) and can carry the fix as necessary (no action is required). I also applied the following merge fixup patch.

From: Stephen Rothwell <[email protected]>
Date: Fri, 20 Mar 2015 14:59:36 +1100
Subject: [PATCH] HID: wacom: merge fix for "Change ownership from driver to core"

---
 drivers/hid/wacom_wac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/wacom_wac.c +1 -1
index 5588ba80ede9..57ee0d807af1 100644
@@ -62,7 +62,7 @@ static void wacom_notify_battery(struct wacom_wac *wacom_wac,
 		wacom_wac->ps_connected = ps_connected;
 
 		if (wacom->battery.dev)
-			power_supply_changed(&wacom->battery);
+			power_supply_changed(wacom->battery);
 	}
 }
 
Signature · 13 lines
2.1.4

and this:

From: Stephen Rothwell <[email protected]>
Date: Fri, 20 Mar 2015 15:08:06 +1100
Subject: [PATCH] HID: wacom: merge fix 2 for "Change ownership from driver to core"

Signed-off-by: Stephen Rothwell <[email protected]>
---
 drivers/hid/wacom_sys.c | 4 ++--
 drivers/hid/wacom_wac.c | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/hid/wacom_sys.c +2 -2
index 97940d7401d8..7dad9ea31490 100644
@@ -1343,11 +1343,11 @@ void wacom_battery_work(struct work_struct *work)
 	struct wacom *wacom = container_of(work, struct wacom, work);
 
 	if ((wacom->wacom_wac.features.quirks & WACOM_QUIRK_BATTERY) &&
-	     !wacom->battery.dev) {
+	     !wacom->battery) {
 		wacom_initialize_battery(wacom);
 	}
 	else if (!(wacom->wacom_wac.features.quirks & WACOM_QUIRK_BATTERY) &&
-		 wacom->battery.dev) {
+		 wacom->battery) {
 		wacom_destroy_battery(wacom);
 	}
 }
drivers/hid/wacom_wac.c +3 -3
index 57ee0d807af1..1a3ce3767415 100644
@@ -61,7 +61,7 @@ static void wacom_notify_battery(struct wacom_wac *wacom_wac,
 		wacom_wac->bat_connected = bat_connected;
 		wacom_wac->ps_connected = ps_connected;
 
-		if (wacom->battery.dev)
+		if (wacom->battery)
 			power_supply_changed(wacom->battery);
 	}
 }
@@ -2012,7 +2012,7 @@ static int wacom_status_irq(struct wacom_wac *wacom_wac, size_t len)
 		wacom_notify_battery(wacom_wac, battery, charging,
 				     battery || charging, 1);
 
-		if (!wacom->battery.dev &&
+		if (!wacom->battery &&
 		    !(features->quirks & WACOM_QUIRK_BATTERY)) {
 			features->quirks |= WACOM_QUIRK_BATTERY;
 			INIT_WORK(&wacom->work, wacom_battery_work);
@@ -2020,7 +2020,7 @@ static int wacom_status_irq(struct wacom_wac *wacom_wac, size_t len)
 		}
 	}
 	else if ((features->quirks & WACOM_QUIRK_BATTERY) &&
-		 wacom->battery.dev) {
+		 wacom->battery) {
 		features->quirks &= ~WACOM_QUIRK_BATTERY;
 		INIT_WORK(&wacom->work, wacom_battery_work);
 		wacom_schedule_work(wacom_wac);
Signature · 34 lines
2.1.4

There may be more required, of course.

-- 
Cheers,
Stephen Rothwell                    [email protected]

diff --cc drivers/hid/wacom.h
index ad7318db1dfe,0d0d0dd89d17..000000000000
--- a/drivers/hid/wacom.h
+++ b/drivers/hid/wacom.h
diff --cc drivers/hid/wacom_sys.c
index 353fe476be26,ba9af470bea0..000000000000
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@@ -1063,11 -1045,12 +1067,11 @@@ static int wacom_initialize_battery(str
  
  static void wacom_destroy_battery(struct wacom *wacom)
  {
- 	if (wacom->battery.dev) {
- 		power_supply_unregister(&wacom->battery);
- 		wacom->battery.dev = NULL;
- 		power_supply_unregister(&wacom->ac);
- 		wacom->ac.dev = NULL;
 -	if ((wacom->wacom_wac.features.quirks & WACOM_QUIRK_BATTERY) &&
 -	     wacom->battery) {
++	if (wacom->battery) {
+ 		power_supply_unregister(wacom->battery);
+ 		wacom->battery = NULL;
+ 		power_supply_unregister(wacom->ac);
+ 		wacom->ac = NULL;
  	}
  }
#1 lore raw

2015-03-20 5:11 GMT+01:00 Stephen Rothwell <[email protected]>:

Quoted 27 lines

Hi Sebastian,

Today's linux-next merge of the battery tree got conflicts in drivers/hid/wacom.h and drivers/hid/wacom_sys.c between commit 953f2c5f7163 ("HID: wacom: Centralize updating of wacom_wac battery status") and fce9957d8f61 ("HID: wacom: Allow dynamic battery creation/destruction") from the hid tree and commit 297d716f6260 ("power_supply: Change ownership from driver to core") from the battery tree.

I fixed it up (see below) and can carry the fix as necessary (no action is required). I also applied the following merge fixup patch.

From: Stephen Rothwell <[email protected]>
Date: Fri, 20 Mar 2015 14:59:36 +1100
Subject: [PATCH] HID: wacom: merge fix for "Change ownership from driver to core"

---
 drivers/hid/wacom_wac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/wacom_wac.c +0 -0
index 5588ba80ede9..57ee0d807af1 100644

drivers/hid/wacom_wac.c static void wacom_notify_battery(struct wacom_wac *wacom_wac, · line 64

Quoted 3 lines
drivers/hid/wacom_wac.c +0 -0
@@ -62,7 +62,7 @@ static void wacom_notify_battery(struct wacom_wac *wacom_wac,
                wacom_wac->ps_connected = ps_connected;
 
                if (wacom->battery.dev)

Should be:
if (wacom->battery)

Rest of patch looks fine but indeed some more changes are required.

How about preparing an immutable branch from HID or battery tree so we could resolve these conflicts easily?

Best regards,
Krzysztof

#2 lore raw
Quoted 30 lines · Krzysztof Kozlowski

2015-03-20 5:11 GMT+01:00 Stephen Rothwell <[email protected]>:

Quoted 29 lines

Hi Sebastian,

Today's linux-next merge of the battery tree got conflicts in drivers/hid/wacom.h and drivers/hid/wacom_sys.c between commit 953f2c5f7163 ("HID: wacom: Centralize updating of wacom_wac battery status") and fce9957d8f61 ("HID: wacom: Allow dynamic battery creation/destruction") from the hid tree and commit 297d716f6260 ("power_supply: Change ownership from driver to core") from the battery tree.

I fixed it up (see below) and can carry the fix as necessary (no action is required). I also applied the following merge fixup patch.

From: Stephen Rothwell <[email protected]>
Date: Fri, 20 Mar 2015 14:59:36 +1100
Subject: [PATCH] HID: wacom: merge fix for "Change ownership from driver to core"

---
 drivers/hid/wacom_wac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/wacom_wac.c +0 -0
index 5588ba80ede9..57ee0d807af1 100644
@@ -62,7 +62,7 @@ static void wacom_notify_battery(struct wacom_wac *wacom_wac,
                wacom_wac->ps_connected = ps_connected;
 
Quoted 6 lines

drivers/hid/wacom_wac.c static void wacom_notify_battery(struct wacom_wac *wacom_wac, · line 64

Quoted 1 line
drivers/hid/wacom_wac.c +0 -0
                if (wacom->battery.dev)

Should be:
if (wacom->battery)

Rest of patch looks fine but indeed some more changes are required.

Actually after looking at current next this Stephen's merge resolution is sufficient for HID. I did not find any more issues. After that s/battery.dev/battery/ change:

Thanks Stephen for fixing!

Best regards,
Krzysztof