From: Heiner Kallweit <hkallweit1@gmail.com>
To: Jiri Kosina <jikos@kernel.org>
Cc: linux-input@vger.kernel.org
Subject: Re: [PATCH] hid: core: add managed version of hid_hw_start
Date: Sun, 10 Jan 2016 15:33:34 +0100 [thread overview]
Message-ID: <56926BBE.1020003@gmail.com> (raw)
In-Reply-To: <alpine.LNX.2.00.1601081050520.3402@cbobk.fhfr.pm>
Am 08.01.2016 um 10:51 schrieb Jiri Kosina:
> On Wed, 6 Jan 2016, Heiner Kallweit wrote:
>
>> Most calls to hid_hw_stop are boilerplate code. The function comment
>> states: "This is usually called from remove function or from probe
>> when something failed and hid_hw_start was called already."
>>
>> A managed version of hid_hw_start allows to avoid this boilerplate
>> code in most cases (similar to the other devm_ functions).
>> hid_hw_stop is called automatically before the device is deleted.
>>
>> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
>
> Generally I agree with the idea, but I'll be merging this only together
> with patches that are converting drivers to actually use this API.
>
OK. When working on it I saw that hid_hw_stop is called by the core if
the driver doesn't define a remove callback.
This means if we use devm_hid_hw_start in a driver with a probe but no
remove callback then hid_hw_stop will be called twice.
To prevent this I'd switch all drivers with probe but no remove to the
new call and remove the fallback call to hid_hw_stop in the core.
At the same time I'd switch the fallback call to hid_hw_start in the core
(in case the driver doesn't define a probe callback) to the new call.
This way the change is transparent to drivers which define neither probe
nor remove.
Fine with you?
> Thanks,
>
Regards, Heiner
prev parent reply other threads:[~2016-01-10 14:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-06 14:37 [PATCH] hid: core: add managed version of hid_hw_start Heiner Kallweit
2016-01-08 9:51 ` Jiri Kosina
2016-01-10 14:33 ` Heiner Kallweit [this message]
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=56926BBE.1020003@gmail.com \
--to=hkallweit1@gmail.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.