Re: [PATCH v3 11/15] media: qcom: camss: Functionally decompose CSIPHY clock lookups
From: Konrad Dybcio
Date: Sat Aug 26 2023 - 08:12:24 EST
On 26.08.2023 14:07, Bryan O'Donoghue wrote:
> On 26/08/2023 11:12, Konrad Dybcio wrote:
>>> - csiphy->rate_set[i] = true;
>>> + for (k = 0; k < camss->res->csiphy_num; k++) {
>>> + csiphy->rate_set[i] = csiphy_match_clock_name(clock->name,
>>> + "csiphy%d_timer", k);
>> This entire functions is like.. soooo over-engineered
>
> I'm going to accept your compliment there.
>
>
>> adding something like csiphy_timer_clks and cisphy_clks and stuff
>> would make this string comparison mess unnecessary
>
> I don't understand your comment.
>
> Having a litany of static comparisons is definitely inferior to a generic helper function.
portray this
struct camss_whatever_it_was_called {
struct clk_bulk_data *csiphy_clks;
struct clk_bulk_data *csiphy_timer_clks;
[...]
}
and then
clk_bulk_prepare_enable(csiphy_clks)
etc
instead of weird looping and matching
Konrad