linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maximilian Luz <luzmaximilian@gmail.com>
To: Sebastian Reichel <sebastian.reichel@collabora.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
	linux-pm@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] power: supply: Add battery driver for Surface Aggregator Module
Date: Tue, 6 Apr 2021 00:34:28 +0200	[thread overview]
Message-ID: <5e6692b9-d043-8a18-8d76-afb235caddbb@gmail.com> (raw)
In-Reply-To: <20210405213241.r6xhtbaf4qkzylz2@earth.universe>

Hi,

On 4/5/21 11:32 PM, Sebastian Reichel wrote:
> [...]
>>>> +static void spwr_battery_unregister(struct spwr_battery_device *bat)
>>>> +{
>>>> +	ssam_notifier_unregister(bat->sdev->ctrl, &bat->notif);
>>>> +	cancel_delayed_work_sync(&bat->update_work);
>>>> +	device_remove_file(&bat->psy->dev, &alarm_attr);
>>>> +	power_supply_unregister(bat->psy);
>>>
>>> power_supply_unregister being the last function call is a clear
>>> sign, that devm_power_supply_register can be used instead.
>>
>> Right, that works here. I normally try to not mix devm code with
>> non-devm code (apart from maybe allocations).
> 
> well allocations are usually done first and free'd last making
> them the first targets in the conversion and pretty much a no
> brainer.
> 
> Next merge window it's possible to easily go to full devm by
> using devm_delayed_work_autocancel(), which has been merged
> by Greg two weeks ago. Then last but not least do the ssam
> notifier unregister via devm_add_action_or_reset and its fully
> converted :)

Neat, I'll have a look at maybe adding some devm versions for the
SSAM notifiers. Should help in at least one other driver apart from
these two.

Thanks,
Max

  reply	other threads:[~2021-04-05 22:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-09  0:05 [PATCH 0/2] power: supply: Add battery and AC drivers for Surface devices Maximilian Luz
2021-03-09  0:05 ` [PATCH 1/2] power: supply: Add battery driver for Surface Aggregator Module Maximilian Luz
2021-04-05 15:37   ` Sebastian Reichel
2021-04-05 19:07     ` Maximilian Luz
2021-04-05 21:32       ` Sebastian Reichel
2021-04-05 22:34         ` Maximilian Luz [this message]
2021-03-09  0:05 ` [PATCH 2/2] power: supply: Add AC " Maximilian Luz
2021-04-05 15:47   ` Sebastian Reichel
2021-04-05 19:08     ` Maximilian Luz
2021-03-17 17:39 ` [PATCH 0/2] power: supply: Add battery and AC drivers for Surface devices Hans de Goede
2021-03-17 17:47   ` Maximilian Luz
2021-03-17 17:49     ` Hans de Goede
2021-03-27 20:49 ` Maximilian Luz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5e6692b9-d043-8a18-8d76-afb235caddbb@gmail.com \
    --to=luzmaximilian@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=sebastian.reichel@collabora.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).