Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/imx/ipuv3/imx-tve: convert from round_rate() to determine_rate()

The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.

Signed-off-by: Brian Masney <bmasney@redhat.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/20250811-drm-clk-round-rate-v2-1-4a91ccf239cf@redhat.com
Signed-off-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>

authored by

Brian Masney and committed by
Raphael Gallais-Pou
6a197747 e5e0350d

+10 -7
+10 -7
drivers/gpu/drm/imx/ipuv3/imx-tve.c
··· 368 368 return 0; 369 369 } 370 370 371 - static long clk_tve_di_round_rate(struct clk_hw *hw, unsigned long rate, 372 - unsigned long *prate) 371 + static int clk_tve_di_determine_rate(struct clk_hw *hw, 372 + struct clk_rate_request *req) 373 373 { 374 374 unsigned long div; 375 375 376 - div = *prate / rate; 376 + div = req->best_parent_rate / req->rate; 377 377 if (div >= 4) 378 - return *prate / 4; 378 + req->rate = req->best_parent_rate / 4; 379 379 else if (div >= 2) 380 - return *prate / 2; 381 - return *prate; 380 + req->rate = req->best_parent_rate / 2; 381 + else 382 + req->rate = req->best_parent_rate; 383 + 384 + return 0; 382 385 } 383 386 384 387 static int clk_tve_di_set_rate(struct clk_hw *hw, unsigned long rate, ··· 412 409 } 413 410 414 411 static const struct clk_ops clk_tve_di_ops = { 415 - .round_rate = clk_tve_di_round_rate, 412 + .determine_rate = clk_tve_di_determine_rate, 416 413 .set_rate = clk_tve_di_set_rate, 417 414 .recalc_rate = clk_tve_di_recalc_rate, 418 415 };