mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] counter/ftm-quaddec: Use device-managed registration API
@ 2019-07-25  8:54 Chuhong Yuan
  2019-07-25 11:31 ` Patrick Havelange
  0 siblings, 1 reply; 2+ messages in thread
From: Chuhong Yuan @ 2019-07-25  8:54 UTC (permalink / raw)
  Cc: Patrick Havelange, William Breathitt Gray, linux-iio,
	linux-kernel, Chuhong Yuan

Make use of devm_counter_register.
Then we can remove redundant unregistration API
usage to make code simpler.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 drivers/counter/ftm-quaddec.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/counter/ftm-quaddec.c b/drivers/counter/ftm-quaddec.c
index 68a9b7393457..bccbca8681b6 100644
--- a/drivers/counter/ftm-quaddec.c
+++ b/drivers/counter/ftm-quaddec.c
@@ -317,7 +317,7 @@ static int ftm_quaddec_probe(struct platform_device *pdev)
 
 	ftm_quaddec_init(ftm);
 
-	ret = counter_register(&ftm->counter);
+	ret = devm_counter_register(&pdev->dev, &ftm->counter);
 	if (ret)
 		ftm_quaddec_disable(ftm);
 
@@ -328,8 +328,6 @@ static int ftm_quaddec_remove(struct platform_device *pdev)
 {
 	struct ftm_quaddec *ftm = platform_get_drvdata(pdev);
 
-	counter_unregister(&ftm->counter);
-
 	ftm_quaddec_disable(ftm);
 
 	return 0;
-- 
2.20.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-07-25 11:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-25  8:54 [PATCH] counter/ftm-quaddec: Use device-managed registration API Chuhong Yuan
2019-07-25 11:31 ` Patrick Havelange

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®