[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <530b930c981c436c172c0308b348d4ae4ef72800.1757251867.git.christophe.jaillet@wanadoo.fr>
Date: Sun, 7 Sep 2025 15:32:26 +0200
From: Christophe JAILLET <christophe.jaillet@...adoo.fr>
To: Armin Wolf <W_Armin@....de>,
Hans de Goede <hansg@...nel.org>,
Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
Cc: linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org,
Christophe JAILLET <christophe.jaillet@...adoo.fr>,
platform-driver-x86@...r.kernel.org
Subject: [PATCH] platform/x86: quickstart: Use devm_mutex_init()
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@...adoo.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
Powered by blists - more mailing lists