Thread (39 messages) 39 messages, 5 authors, 2024-10-04

Re: [PATCH 01/14] Input: samsung-keypad - switch to using devm_clk_get_prepared()

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2024-08-19 14:46:20
Also in: linux-arm-kernel, linux-devicetree, linux-samsung-soc, lkml

On Mon, Aug 19, 2024 at 02:51:09PM +0200, Krzysztof Kozlowski wrote:
On Sun, Aug 18, 2024 at 09:57:58PM -0700, Dmitry Torokhov wrote:
quoted
Switch to using devm_clk_get_prepared() instead of combining
devm_clk_get() with clk_prepare(), which simplifies the code and
ensures that the clock is unprepared at the right time relative to
releasing other managed resources.
...
quoted
 	device_init_wakeup(&pdev->dev, pdata->wakeup);
@@ -439,20 +433,12 @@ static int samsung_keypad_probe(struct platform_device *pdev)
 
 err_disable_runtime_pm:
 	pm_runtime_disable(&pdev->dev);
-err_unprepare_clk:
-	clk_unprepare(keypad->clk);
 	return error;
 }
 
 static void samsung_keypad_remove(struct platform_device *pdev)
 {
-	struct samsung_keypad *keypad = platform_get_drvdata(pdev);
-
 	pm_runtime_disable(&pdev->dev);
-
-	input_unregister_device(keypad->input_dev);
This looks unrelated.
It actually is related: with clk moved to devm we no longer need to
unregister input device by hand to keep the right ordering and we can
rely on devm to clean the input device as well (it already is being
allocated with devm_input_allocate_device()).

Thanks.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help