Re: [PATCH v2 1/3] clk: renesas: rzg2l: Add support for watchdog reset selection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Biju,

On Wed, Nov 17, 2021 at 9:21 AM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote:
> On the, next version I am planning to introduce the below code for
> Reset selection based on device availability, instead of selecting
> all the channels. Is it the right way to do ? please let me know.
>
> node = of_find_node_by_name (NULL, NULL, "watchdog@12800800");
> if (node && of_device_is_available(node) {
>         // set reset selection for that channel
>         of_node_put(node);
> }
>
> node = of_find_node_by_name (NULL, NULL, "watchdog@12800c00");
> if (node && of_device_is_available(node) {
>         // set reset selection for that channel
>         of_node_put(node);
> }
>
> node = of_find_node_by_name (NULL, NULL, "watchdog@12800400");
> if (node && of_device_is_available(node) {
>         // set reset selection for that channel
>         of_node_put(node);
> }

Matching on node names is very fragile.  And what if the watchdog
node is enabled in DT, but the watchdog driver is not available?
Moreover, this looks like it should not be controlled from the clock
driver, but from the watchdog driver instead.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

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



[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux