Re: [RFC PATCH v2 18/30] drivers/clocksource: sh_tmu clocks property support.
Geert Uytterhoeven <[email protected]>
| Newsgroups | gmane.linux.ports.sh.devel |
|---|---|
| Message-ID | <CAMuHMdV816qiWBDma-C6=Fpy71Pj=6j5a7cF9D3zeSA791KP5A@mail.gmail.com> |
Hi Sato-san, On Wed, Sep 13, 2023 at 11:29 AM Yoshinori Sato <[email protected]> wrote: > Signed-off-by: Yoshinori Sato <[email protected]> > --- a/drivers/clocksource/sh_tmu.c > +++ b/drivers/clocksource/sh_tmu.c > @@ -537,6 +537,9 @@ static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev) > > /* Get hold of clock. */ > tmu->clk = clk_get(&tmu->pdev->dev, "fck"); > + if (IS_ERR(tmu->clk) && IS_ENABLED(CONFIG_OF) && pdev->dev.of_node) > + /* use DeviceTree clocks property */ > + tmu->clk = devm_clk_get(&tmu->pdev->dev, NULL); This should not be needed. I guess this is a workaround for the missing clock-names = "fck"; in arch/sh/boot/dts/sh7751.dtsi? "make dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/timer/renesas,tmu.yaml" would have told you ;-) timer@ffd80008: 'clock-names' is a required property > if (IS_ERR(tmu->clk)) { > dev_err(&tmu->pdev->dev, "cannot get clock\n"); > return PTR_ERR(tmu->clk); Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds