[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <55bea6244a6d41e3d7d38d6cb6d379e9.sboyd@kernel.org>
Date: Wed, 22 Mar 2023 08:16:13 -0700
From: Stephen Boyd <sboyd@...nel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Michael Turquette <mturquette@...libre.com>,
Rob Herring <robh+dt@...nel.org>, devicetree@...r.kernel.org,
linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org,
zhuyinbo <zhuyinbo@...ngson.cn>
Cc: Jianmin Lv <lvjianmin@...ngson.cn>, wanghongliang@...ngson.cn,
Liu Peibao <liupeibao@...ngson.cn>,
loongson-kernel@...ts.loongnix.cn, zhuyinbo@...ngson.cn
Subject: Re: [PATCH v15 2/2] clk: clk-loongson2: add clock controller driver support
Quoting zhuyinbo (2023-03-21 19:07:26)
>
> 在 2023/3/22 上午7:42, Stephen Boyd 写道:
> > Quoting Yinbo Zhu (2023-03-21 06:07:10)
> >> diff --git a/drivers/clk/clk-loongson2.c b/drivers/clk/clk-loongson2.c
> >> new file mode 100644
> >> index 000000000000..090810655511
> >> --- /dev/null
> >> +++ b/drivers/clk/clk-loongson2.c
> >> @@ -0,0 +1,344 @@
[....]
> >> +
> >> +static void __iomem *loongson2_pll_base;
> > Why is this a global?
>
> Normally, this should be an element in the structure, but since there is
> only one
>
> element, It is directly defined as a global variable for use by other
> function.
>
Ok. Globals are frowned upon but it's just a single pointers so I guess
it's Ok.
> >
> >> + return PTR_ERR(loongson2_pll_base);
> >> +
> >> + loongson2_clocks_init(dev);
> > Please inline this function here.
>
> The loongson2_clocks_init had inline in this version, or do you mean something else ? Need to inline the probe?
I mean get rid of the function loongson2_clocks_init() and move the code
in that function into this probe function. With this patch the probe is
split to two functions when it should be one function.
Powered by blists - more mailing lists