From c4f8b11bacd562f38c85f4f81a0a4426b267df70 Mon Sep 17 00:00:00 2001 From: Christophe JAILLET Date: Sun, 7 Sep 2025 15:32:26 +0200 Subject: platform/x86: quickstart: Use devm_mutex_init() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Link: https://lore.kernel.org/r/530b930c981c436c172c0308b348d4ae4ef72800.1757251867.git.christophe.jaillet@wanadoo.fr Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen --- drivers/platform/x86/quickstart.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'drivers/platform/x86/quickstart.c') 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; -- cgit