diff mbox series

[v2,06/12] power/supply: surface_battery: Use client device wrappers for notifier registration

Message ID 20220527023447.2460025-7-luzmaximilian@gmail.com (mailing list archive)
State Mainlined
Commit b49ba26bec452d3065e09327fbda79d7120a9f9d
Headers show
Series platform/surface: aggregator: Add support for client hot-removal | expand

Commit Message

Maximilian Luz May 27, 2022, 2:34 a.m. UTC
Use newly introduced client device wrapper functions for notifier
registration and unregistration.

Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
---

Changes in v2:
  - none

---
 drivers/power/supply/surface_battery.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Sebastian Reichel June 9, 2022, 6:01 p.m. UTC | #1
Hi,

On Fri, May 27, 2022 at 04:34:41AM +0200, Maximilian Luz wrote:
> Use newly introduced client device wrapper functions for notifier
> registration and unregistration.
> 
> Signed-off-by: Maximilian Luz <luzmaximilian@gmail.com>
> ---

Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com>

-- Sebastian

> 
> Changes in v2:
>   - none
> 
> ---
>  drivers/power/supply/surface_battery.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/power/supply/surface_battery.c b/drivers/power/supply/surface_battery.c
> index 5ec2e6bb2465..540707882bb0 100644
> --- a/drivers/power/supply/surface_battery.c
> +++ b/drivers/power/supply/surface_battery.c
> @@ -802,7 +802,7 @@ static int spwr_battery_register(struct spwr_battery_device *bat)
>  	if (IS_ERR(bat->psy))
>  		return PTR_ERR(bat->psy);
>  
> -	return ssam_notifier_register(bat->sdev->ctrl, &bat->notif);
> +	return ssam_device_notifier_register(bat->sdev, &bat->notif);
>  }
>  
>  
> @@ -837,7 +837,7 @@ static void surface_battery_remove(struct ssam_device *sdev)
>  {
>  	struct spwr_battery_device *bat = ssam_device_get_drvdata(sdev);
>  
> -	ssam_notifier_unregister(sdev->ctrl, &bat->notif);
> +	ssam_device_notifier_unregister(sdev, &bat->notif);
>  	cancel_delayed_work_sync(&bat->update_work);
>  }
>  
> -- 
> 2.36.1
>
diff mbox series

Patch

diff --git a/drivers/power/supply/surface_battery.c b/drivers/power/supply/surface_battery.c
index 5ec2e6bb2465..540707882bb0 100644
--- a/drivers/power/supply/surface_battery.c
+++ b/drivers/power/supply/surface_battery.c
@@ -802,7 +802,7 @@  static int spwr_battery_register(struct spwr_battery_device *bat)
 	if (IS_ERR(bat->psy))
 		return PTR_ERR(bat->psy);
 
-	return ssam_notifier_register(bat->sdev->ctrl, &bat->notif);
+	return ssam_device_notifier_register(bat->sdev, &bat->notif);
 }
 
 
@@ -837,7 +837,7 @@  static void surface_battery_remove(struct ssam_device *sdev)
 {
 	struct spwr_battery_device *bat = ssam_device_get_drvdata(sdev);
 
-	ssam_notifier_unregister(sdev->ctrl, &bat->notif);
+	ssam_device_notifier_unregister(sdev, &bat->notif);
 	cancel_delayed_work_sync(&bat->update_work);
 }