mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] media: xilinx: vip: Make use of the devm_clk_get_enabled()
@ 2026-11-18 11:03 Michal Simek
  2026-11-18 11:32 ` Mehdi Djait
  0 siblings, 1 reply; 2+ messages in thread
From: Michal Simek @ 2026-11-18 11:03 UTC (permalink / raw)
  To: linux-kernel, monstr, michal.simek, git
  Cc: Laurent Pinchart, Mauro Carvalho Chehab,
	moderated list:ARM/ZYNQ ARCHITECTURE,
	open list:XILINX VIDEO IP CORES

There is missing return value check from clk_prepare_enable(). Fix it by
using devm_clk_get_enabled() macro.

Signed-off-by: Michal Simek <michal.simek@amd.com>
---

Changes in v2:
- s/devm_clk_get_enable/devm_clk_get_enabled

 drivers/media/platform/xilinx/xilinx-vip.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/media/platform/xilinx/xilinx-vip.c b/drivers/media/platform/xilinx/xilinx-vip.c
index f1574edd2b43..537702ace760 100644
--- a/drivers/media/platform/xilinx/xilinx-vip.c
+++ b/drivers/media/platform/xilinx/xilinx-vip.c
@@ -212,18 +212,16 @@ int xvip_init_resources(struct xvip_device *xvip)
 	if (IS_ERR(xvip->iomem))
 		return PTR_ERR(xvip->iomem);
 
-	xvip->clk = devm_clk_get(xvip->dev, NULL);
+	xvip->clk = devm_clk_get_enabled(xvip->dev, NULL);
 	if (IS_ERR(xvip->clk))
 		return PTR_ERR(xvip->clk);
 
-	clk_prepare_enable(xvip->clk);
 	return 0;
 }
 EXPORT_SYMBOL_GPL(xvip_init_resources);
 
 void xvip_cleanup_resources(struct xvip_device *xvip)
 {
-	clk_disable_unprepare(xvip->clk);
 }
 EXPORT_SYMBOL_GPL(xvip_cleanup_resources);
 
---
-- 
2.43.0


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

* Re: [PATCH v2] media: xilinx: vip: Make use of the devm_clk_get_enabled()
  2026-11-18 11:03 [PATCH v2] media: xilinx: vip: Make use of the devm_clk_get_enabled() Michal Simek
@ 2026-11-18 11:32 ` Mehdi Djait
  0 siblings, 0 replies; 2+ messages in thread
From: Mehdi Djait @ 2026-11-18 11:32 UTC (permalink / raw)
  To: Michal Simek
  Cc: linux-kernel, monstr, git, Laurent Pinchart,
	Mauro Carvalho Chehab, moderated list:ARM/ZYNQ ARCHITECTURE,
	open list:XILINX VIDEO IP CORES

Hi Michal,

On Wed, Nov 18, 2026 at 12:03:04PM +0100, Michal Simek wrote:
> There is missing return value check from clk_prepare_enable(). Fix it by
> using devm_clk_get_enabled() macro.
> 
> Signed-off-by: Michal Simek <michal.simek@amd.com>
> ---

[..]

>  void xvip_cleanup_resources(struct xvip_device *xvip)
>  {
> -	clk_disable_unprepare(xvip->clk);

so the xvip_cleanup_resources() is empty after removing the
clk_disable_unprepare() call.

It is also called in xilinx-tpg.c and xilinx-vtc.c

>  }
>  EXPORT_SYMBOL_GPL(xvip_cleanup_resources);

--
Kind Regards
Mehdi Djait

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

end of thread, other threads:[~2026-11-18 11:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18 11:03 [PATCH v2] media: xilinx: vip: Make use of the devm_clk_get_enabled() Michal Simek
2026-11-18 11:32 ` Mehdi Djait

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®