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

From: Stephen Rothwell <[email-masked]>
Date: Fri, 20 Mar 2015 15:11:10 +1100

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-masked]>
Date: Fri, 20 Mar 2015 14:59:36 +1100
Subject: [PATCH] HID: wacom: merge fix for "Change ownership from driver to core"

Signed-off-by: Stephen Rothwell <[email-masked]>
---
 drivers/hid/wacom_wac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 5588ba80ede9..57ee0d807af1 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -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);
 	}
 }
 
-- 
2.1.4

and this:

From: Stephen Rothwell <[email-masked]>
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-masked]>
---
 drivers/hid/wacom_sys.c | 4 ++--
 drivers/hid/wacom_wac.c | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 97940d7401d8..7dad9ea31490 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -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);
 	}
 }
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 57ee0d807af1..1a3ce3767415 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -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);
-- 
2.1.4

There may be more required, of course.

-- 
Cheers,
Stephen Rothwell                    [email-masked]

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;
  	}
  }