Re: [PATCH 36/46] ARM: pxa: move smemc register access from clk to platform

From: Robert Jarzmik
Date: Wed Oct 30 2019 - 16:57:19 EST


Arnd Bergmann <arnd@xxxxxxxx> writes:

> The get_sdram_rows() and get_memclkdiv() helpers need smemc
> register that are separate from the clk registers, move
> them out of the clk driver, and use an extern declaration
> instead.
>
> Cc: Michael Turquette <mturquette@xxxxxxxxxxxx>
> Cc: Stephen Boyd <sboyd@xxxxxxxxxx>
> Cc: linux-clk@xxxxxxxxxxxxxxx
> Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
This patch bothers me a bit.

The idea behind generic.c is that it's a file common to all pxa2xx, pxa3xx
platforms. Yet with this patch, someone without history will believe that
calling pxa_smemc_get_sdram_rows() on a pxa3xx platform is perfectly valid,
while it is not, because DRAC2 doesn't exist on pxa3xx (bits are not defined in
MDCNFG).

At least I'll rename the function to pxa2xx_smemc_get_sdram_rows() if you don't
have a better idea.

Cheers.

--
Robert