* [PATCH] HID: alps: Simplify the .remove function
@ 2022-10-02 14:38 Christophe JAILLET
2022-10-03 15:40 ` Marcus Folkesson
0 siblings, 1 reply; 3+ messages in thread
From: Christophe JAILLET @ 2022-10-02 14:38 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-input
If the .remove function of a 'hid_driver' is NULL, the default behavior is
to call hid_hw_stop().
So alps_remove() can be removed here, it is just hand-writing what
already exists.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/hid/hid-alps.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/hid/hid-alps.c b/drivers/hid/hid-alps.c
index db146d0f7937..669d769ea1dc 100644
--- a/drivers/hid/hid-alps.c
+++ b/drivers/hid/hid-alps.c
@@ -820,11 +820,6 @@ static int alps_probe(struct hid_device *hdev, const struct hid_device_id *id)
return 0;
}
-static void alps_remove(struct hid_device *hdev)
-{
- hid_hw_stop(hdev);
-}
-
static const struct hid_device_id alps_id[] = {
{ HID_DEVICE(HID_BUS_ANY, HID_GROUP_ANY,
USB_VENDOR_ID_ALPS_JP, HID_DEVICE_ID_ALPS_U1_DUAL) },
@@ -842,7 +837,6 @@ static struct hid_driver alps_driver = {
.name = "hid-alps",
.id_table = alps_id,
.probe = alps_probe,
- .remove = alps_remove,
.raw_event = alps_raw_event,
.input_mapping = alps_input_mapping,
.input_configured = alps_input_configured,
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] HID: alps: Simplify the .remove function
2022-10-02 14:38 [PATCH] HID: alps: Simplify the .remove function Christophe JAILLET
@ 2022-10-03 15:40 ` Marcus Folkesson
2022-10-03 19:16 ` Christophe JAILLET
0 siblings, 1 reply; 3+ messages in thread
From: Marcus Folkesson @ 2022-10-03 15:40 UTC (permalink / raw)
To: Christophe JAILLET
Cc: Jiri Kosina, Benjamin Tissoires, linux-kernel, kernel-janitors,
linux-input
[-- Attachment #1: Type: text/plain, Size: 526 bytes --]
Hi Christophe!
On Sun, Oct 02, 2022 at 04:38:26PM +0200, Christophe JAILLET wrote:
> If the .remove function of a 'hid_driver' is NULL, the default behavior is
> to call hid_hw_stop().
>
> So alps_remove() can be removed here, it is just hand-writing what
> already exists.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
There is already a patch out there :-)
https://lore.kernel.org/all/20220915123438.520775-1-marcus.folkesson@gmail.com/
Best regards,
Marcus Folkesson
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] HID: alps: Simplify the .remove function
2022-10-03 15:40 ` Marcus Folkesson
@ 2022-10-03 19:16 ` Christophe JAILLET
0 siblings, 0 replies; 3+ messages in thread
From: Christophe JAILLET @ 2022-10-03 19:16 UTC (permalink / raw)
To: Marcus Folkesson
Cc: Jiri Kosina, Benjamin Tissoires, linux-kernel, kernel-janitors,
linux-input
Le 03/10/2022 à 17:40, Marcus Folkesson a écrit :
> Hi Christophe!
>
> On Sun, Oct 02, 2022 at 04:38:26PM +0200, Christophe JAILLET wrote:
>> If the .remove function of a 'hid_driver' is NULL, the default behavior is
>> to call hid_hw_stop().
>>
>> So alps_remove() can be removed here, it is just hand-writing what
>> already exists.
>>
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>> ---
>
>
> There is already a patch out there :-)
Great,
But I always find it funny when something that is there since many years
(819d64e51d62 - 2016-06-23) is fixed twice in a row from unrelated work!
CJ
>
> https://lore.kernel.org/all/20220915123438.520775-1-marcus.folkesson@gmail.com/
>
> Best regards,
> Marcus Folkesson
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-10-03 19:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-02 14:38 [PATCH] HID: alps: Simplify the .remove function Christophe JAILLET
2022-10-03 15:40 ` Marcus Folkesson
2022-10-03 19:16 ` Christophe JAILLET
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).