Skip to content

Commit 67e41db

Browse files
ishikawa-yjrtbebarino
authored andcommitted
clk: visconti: Do not define number of clocks in bindings
Remove use of TMPV770X_NR_CLK. Instead, define number of clocks inside the driver directory. The same for TMPV770X_NR_RESET and TMPV770X_NR_PLL. Signed-off-by: Yuji Ishikawa <yuji2.ishikawa@toshiba.co.jp> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 3a86608 commit 67e41db

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

drivers/clk/visconti/clkc-tmpv770x.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
#include "clkc.h"
1818
#include "reset.h"
1919

20+
/* Must be equal to the last clock/reset ID increased by one */
21+
#define CLKS_NR (TMPV770X_CLK_BUSLCK + 1)
22+
#define RESETS_NR (TMPV770X_RESET_SBUSCLK + 1)
23+
2024
static DEFINE_SPINLOCK(tmpv770x_clk_lock);
2125
static DEFINE_SPINLOCK(tmpv770x_rst_lock);
2226

@@ -234,12 +238,12 @@ static int visconti_clk_probe(struct platform_device *pdev)
234238
if (IS_ERR(regmap))
235239
return PTR_ERR(regmap);
236240

237-
ctx = visconti_init_clk(dev, regmap, TMPV770X_NR_CLK);
241+
ctx = visconti_init_clk(dev, regmap, CLKS_NR);
238242
if (IS_ERR(ctx))
239243
return PTR_ERR(ctx);
240244

241245
ret = visconti_register_reset_controller(dev, regmap, clk_reset_data,
242-
TMPV770X_NR_RESET,
246+
RESETS_NR,
243247
&visconti_reset_ops,
244248
&tmpv770x_rst_lock);
245249
if (ret) {

drivers/clk/visconti/pll-tmpv770x.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616

1717
#include "pll.h"
1818

19+
/* Must be equal to the last pll ID increased by one */
20+
#define PLLS_NR (TMPV770X_PLL_PIIMGERPLL + 1)
21+
1922
static DEFINE_SPINLOCK(tmpv770x_pll_lock);
2023

2124
static const struct visconti_pll_rate_table pipll0_rates[] __initconst = {
@@ -66,7 +69,7 @@ static void __init tmpv770x_setup_plls(struct device_node *np)
6669
if (!reg_base)
6770
return;
6871

69-
ctx = visconti_init_pll(np, reg_base, TMPV770X_NR_PLL);
72+
ctx = visconti_init_pll(np, reg_base, PLLS_NR);
7073
if (IS_ERR(ctx)) {
7174
iounmap(reg_base);
7275
return;

0 commit comments

Comments
 (0)