* [PATCH] platform/x86: quickstart: Use devm_mutex_init()
@ 2025-09-07 13:32 Christophe JAILLET
2025-09-08 10:20 ` Ilpo Järvinen
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2025-09-07 13:32 UTC (permalink / raw)
To: Armin Wolf, Hans de Goede, Ilpo Järvinen
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, platform-driver-x86
Use devm_mutex_init() instead of hand-writing it.
This saves some LoC, improves readability and saves some space in the
generated .o file.
Before:
======
text data bss dec hex filename
7607 2616 64 10287 282f drivers/platform/x86/quickstart.o
After:
=====
text data bss dec hex filename
7301 2544 64 9909 26b5 drivers/platform/x86/quickstart.o
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/platform/x86/quickstart.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/drivers/platform/x86/quickstart.c b/drivers/platform/x86/quickstart.c
index c332c7cdaff5..acb58518be37 100644
--- a/drivers/platform/x86/quickstart.c
+++ b/drivers/platform/x86/quickstart.c
@@ -154,13 +154,6 @@ static void quickstart_notify_remove(void *context)
acpi_remove_notify_handler(handle, ACPI_DEVICE_NOTIFY, quickstart_notify);
}
-static void quickstart_mutex_destroy(void *data)
-{
- struct mutex *lock = data;
-
- mutex_destroy(lock);
-}
-
static int quickstart_probe(struct platform_device *pdev)
{
struct quickstart_data *data;
@@ -179,8 +172,7 @@ static int quickstart_probe(struct platform_device *pdev)
data->dev = &pdev->dev;
dev_set_drvdata(&pdev->dev, data);
- mutex_init(&data->input_lock);
- ret = devm_add_action_or_reset(&pdev->dev, quickstart_mutex_destroy, &data->input_lock);
+ ret = devm_mutex_init(&pdev->dev, &data->input_lock);
if (ret < 0)
return ret;
--
2.51.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] platform/x86: quickstart: Use devm_mutex_init()
2025-09-07 13:32 [PATCH] platform/x86: quickstart: Use devm_mutex_init() Christophe JAILLET
@ 2025-09-08 10:20 ` Ilpo Järvinen
0 siblings, 0 replies; 2+ messages in thread
From: Ilpo Järvinen @ 2025-09-08 10:20 UTC (permalink / raw)
To: Armin Wolf, Hans de Goede, Christophe JAILLET
Cc: linux-kernel, kernel-janitors, platform-driver-x86
On Sun, 07 Sep 2025 15:32:26 +0200, Christophe JAILLET wrote:
> Use devm_mutex_init() instead of hand-writing it.
>
> This saves some LoC, improves readability and saves some space in the
> generated .o file.
>
> Before:
> ======
> text data bss dec hex filename
> 7607 2616 64 10287 282f drivers/platform/x86/quickstart.o
>
> [...]
Thank you for your contribution, it has been applied to my local
review-ilpo-next branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-next branch only once I've pushed my
local branch there, which might take a while.
The list of commits applied:
[1/1] platform/x86: quickstart: Use devm_mutex_init()
commit: c4f8b11bacd562f38c85f4f81a0a4426b267df70
--
i.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-09-08 10:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-07 13:32 [PATCH] platform/x86: quickstart: Use devm_mutex_init() Christophe JAILLET
2025-09-08 10:20 ` Ilpo Järvinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®