mbox series

[0/3] Legacy clock drivers: Normalize clk API

Message ID 1528706663-20670-1-git-send-email-geert@linux-m68k.org
Headers show
Series Legacy clock drivers: Normalize clk API | expand

Message

Geert Uytterhoeven June 11, 2018, 8:44 a.m. UTC
Hi all,

When seeing commit bde4975310eb1982 ("net: stmmac: fix build failure due
to missing COMMON_CLK dependency"), I wondered why this dependency is
needed, as all implementations of the clock API should implement all
required functionality, or provide dummies.

It turns out there were still two implementations that lacked the
clk_set_rate() function: Coldfire and AR7.

This series contains three patches:
  - The first two patches add dummies for clk_set_rate(),
    clk_set_rate(), clk_set_parent(), and clk_get_parent() to the
    Coldfire and AR7, like Arnd has done for other legacy clock
    implementations a while ago.
  - The second patch removes the COMMON_CLK dependency from the stmmac
    network drivers again, as it is no longer needed.
    Obviously this patch has a hard dependency on the first two patches.

Thanks!

Geert Uytterhoeven (3):
  m68k: coldfire: Normalize clk API
  MIPS: AR7: Normalize clk API
  [RFC] Revert "net: stmmac: fix build failure due to missing COMMON_CLK
    dependency"

 arch/m68k/coldfire/clk.c                    | 29 +++++++++++++++++++++++++++++
 arch/mips/ar7/clock.c                       | 29 +++++++++++++++++++++++++++++
 drivers/net/ethernet/stmicro/stmmac/Kconfig | 10 +++++-----
 3 files changed, 63 insertions(+), 5 deletions(-)

Comments

Arnd Bergmann June 11, 2018, 9:02 a.m. UTC | #1
On Mon, Jun 11, 2018 at 10:44 AM, Geert Uytterhoeven
<geert@linux-m68k.org> wrote:
>         Hi all,
>
> When seeing commit bde4975310eb1982 ("net: stmmac: fix build failure due
> to missing COMMON_CLK dependency"), I wondered why this dependency is
> needed, as all implementations of the clock API should implement all
> required functionality, or provide dummies.
>
> It turns out there were still two implementations that lacked the
> clk_set_rate() function: Coldfire and AR7.
>
> This series contains three patches:
>   - The first two patches add dummies for clk_set_rate(),
>     clk_set_rate(), clk_set_parent(), and clk_get_parent() to the
>     Coldfire and AR7, like Arnd has done for other legacy clock
>     implementations a while ago.
>   - The second patch removes the COMMON_CLK dependency from the stmmac
>     network drivers again, as it is no longer needed.
>     Obviously this patch has a hard dependency on the first two patches.

Yes, good idea.

Acked-by: Arnd Bergmann <arnd@arnd.de>

One question: what happens on machines that don't support any CLK
interface, i.e.
that don't have any of COMMON_CLK/HAVE_CLK/CLKDEV_LOOKUP?

I guess those are already hopelessly broken for many drivers, right?

         Arnd
Geert Uytterhoeven June 11, 2018, 9:09 a.m. UTC | #2
Hi Arnd,

On Mon, Jun 11, 2018 at 11:02 AM Arnd Bergmann <arnd@arndb.de> wrote:
> On Mon, Jun 11, 2018 at 10:44 AM, Geert Uytterhoeven
> <geert@linux-m68k.org> wrote:
> > When seeing commit bde4975310eb1982 ("net: stmmac: fix build failure due
> > to missing COMMON_CLK dependency"), I wondered why this dependency is
> > needed, as all implementations of the clock API should implement all
> > required functionality, or provide dummies.
> >
> > It turns out there were still two implementations that lacked the
> > clk_set_rate() function: Coldfire and AR7.
> >
> > This series contains three patches:
> >   - The first two patches add dummies for clk_set_rate(),
> >     clk_set_rate(), clk_set_parent(), and clk_get_parent() to the
> >     Coldfire and AR7, like Arnd has done for other legacy clock
> >     implementations a while ago.
> >   - The second patch removes the COMMON_CLK dependency from the stmmac
> >     network drivers again, as it is no longer needed.
> >     Obviously this patch has a hard dependency on the first two patches.
>
> Yes, good idea.
>
> Acked-by: Arnd Bergmann <arnd@arnd.de>

Thanks!

> One question: what happens on machines that don't support any CLK
> interface, i.e.
> that don't have any of COMMON_CLK/HAVE_CLK/CLKDEV_LOOKUP?
>
> I guess those are already hopelessly broken for many drivers, right?

Nope, they (e.g. m68k allmodconfig) build fine, as they don't define
CONFIG_HAVE_CLK.

Gr{oetje,eeting}s,

                        Geert