diff mbox series

dt-bindings: clock: Use "CLK_ETHERNET" for the Ethernet clock

Message ID 1584879089-12123-1-git-send-email-amittomer25@gmail.com (mailing list archive)
State New, archived
Headers show
Series dt-bindings: clock: Use "CLK_ETHERNET" for the Ethernet clock | expand

Commit Message

Amit Tomer March 22, 2020, 12:11 p.m. UTC
Right now, dt clock binding for ethernet uses different names CLK_ETH_MAC for S900
and CLK_ETHERNET for S700, while dt clock binding for most of the other devices uses
same name(for instance, the UART clock binding that uses CLK_UARTx).

Let's use same name CLK_ETHERNET for both S700 and S900.

Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
---
Noticed it while working on U-BOOT Ethernet support for S700 where we have common clock driver used
by S700 and S900. Patch[1] was initially sent to U-BOOT list.

[1]: https://patchwork.ozlabs.org/patch/1229219/
---
 drivers/clk/actions/owl-s900.c               | 2 +-
 include/dt-bindings/clock/actions,s900-cmu.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Andreas Färber March 22, 2020, 5:43 p.m. UTC | #1
Hi Amit,

Am 22.03.20 um 13:11 schrieb Amit Singh Tomar:
> Right now, dt clock binding for ethernet uses different names CLK_ETH_MAC for S900
> and CLK_ETHERNET for S700, while dt clock binding for most of the other devices uses
> same name(for instance, the UART clock binding that uses CLK_UARTx).
> 
> Let's use same name CLK_ETHERNET for both S700 and S900.
> 
> Signed-off-by: Amit Singh Tomar <amittomer25@gmail.com>
> ---
> Noticed it while working on U-BOOT Ethernet support for S700 where we have common clock driver used
> by S700 and S900. Patch[1] was initially sent to U-BOOT list.
> 
> [1]: https://patchwork.ozlabs.org/patch/1229219/
> ---
>   drivers/clk/actions/owl-s900.c               | 2 +-
>   include/dt-bindings/clock/actions,s900-cmu.h | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)

Never mix changes to bindings and drivers. Separating them exposes the 
difficulty in the change your proposing:

> diff --git a/drivers/clk/actions/owl-s900.c b/drivers/clk/actions/owl-s900.c
> index 7908909..5293086 100644
> --- a/drivers/clk/actions/owl-s900.c
> +++ b/drivers/clk/actions/owl-s900.c
> @@ -648,7 +648,7 @@ static struct clk_hw_onecell_data s900_hw_clks = {
>   		[CLK_DE0]		= &de_clk.common.hw,
>   		[CLK_DMM]		= &dmm_clk.common.hw,
>   		[CLK_EDP]		= &edp_clk.common.hw,
> -		[CLK_ETH_MAC]		= &eth_mac_clk.common.hw,
> +		[CLK_ETHERNET]		= &eth_mac_clk.common.hw,
>   		[CLK_GPU_CORE]		= &gpu_core_clk.common.hw,
>   		[CLK_GPU_MEM]		= &gpu_mem_clk.common.hw,
>   		[CLK_GPU_SYS]		= &gpu_sys_clk.common.hw,
> diff --git a/include/dt-bindings/clock/actions,s900-cmu.h b/include/dt-bindings/clock/actions,s900-cmu.h
> index 7c12515..2247f1c 100644
> --- a/include/dt-bindings/clock/actions,s900-cmu.h
> +++ b/include/dt-bindings/clock/actions,s900-cmu.h
> @@ -121,7 +121,7 @@
>   #define CLK_DDR1			97
>   #define CLK_DMM				98
>   
> -#define CLK_ETH_MAC			99
> +#define CLK_ETHERNET			99

The bindings are not supposed to change in breaking ways. What you could 
consider instead is to define CLK_ETHERNET as alias, keeping CLK_ETH_MAC 
for backwards compatibility.

Regards,
Andreas

>   #define CLK_RMII_REF			100
>   
>   #define CLK_NR_CLKS			(CLK_RMII_REF + 1)
Amit Tomer March 24, 2020, 10:07 a.m. UTC | #2
Hi Andreas,

> Never mix changes to bindings and drivers. Separating them exposes the
> difficulty in the change your proposing:

Thanks for letting me know, wasn't aware about this rule.

> > diff --git a/drivers/clk/actions/owl-s900.c b/drivers/clk/actions/owl-s900.c
> > index 7908909..5293086 100644
> > --- a/drivers/clk/actions/owl-s900.c
> > +++ b/drivers/clk/actions/owl-s900.c
> > @@ -648,7 +648,7 @@ static struct clk_hw_onecell_data s900_hw_clks = {
> >               [CLK_DE0]               = &de_clk.common.hw,
> >               [CLK_DMM]               = &dmm_clk.common.hw,
> >               [CLK_EDP]               = &edp_clk.common.hw,
> > -             [CLK_ETH_MAC]           = &eth_mac_clk.common.hw,
> > +             [CLK_ETHERNET]          = &eth_mac_clk.common.hw,
> >               [CLK_GPU_CORE]          = &gpu_core_clk.common.hw,
> >               [CLK_GPU_MEM]           = &gpu_mem_clk.common.hw,
> >               [CLK_GPU_SYS]           = &gpu_sys_clk.common.hw,
> > diff --git a/include/dt-bindings/clock/actions,s900-cmu.h b/include/dt-bindings/clock/actions,s900-cmu.h
> > index 7c12515..2247f1c 100644
> > --- a/include/dt-bindings/clock/actions,s900-cmu.h
> > +++ b/include/dt-bindings/clock/actions,s900-cmu.h
> > @@ -121,7 +121,7 @@
> >   #define CLK_DDR1                    97
> >   #define CLK_DMM                             98
> >
> > -#define CLK_ETH_MAC                  99
> > +#define CLK_ETHERNET                 99
>
> The bindings are not supposed to change in breaking ways. What you could
> consider instead is to define CLK_ETHERNET as alias, keeping CLK_ETH_MAC
> for backwards compatibility.

Sure, I would try using CLK_ETHERNET as alias in U-BOOT and see how it goes.

Thanks,
-Amit
diff mbox series

Patch

diff --git a/drivers/clk/actions/owl-s900.c b/drivers/clk/actions/owl-s900.c
index 7908909..5293086 100644
--- a/drivers/clk/actions/owl-s900.c
+++ b/drivers/clk/actions/owl-s900.c
@@ -648,7 +648,7 @@  static struct clk_hw_onecell_data s900_hw_clks = {
 		[CLK_DE0]		= &de_clk.common.hw,
 		[CLK_DMM]		= &dmm_clk.common.hw,
 		[CLK_EDP]		= &edp_clk.common.hw,
-		[CLK_ETH_MAC]		= &eth_mac_clk.common.hw,
+		[CLK_ETHERNET]		= &eth_mac_clk.common.hw,
 		[CLK_GPU_CORE]		= &gpu_core_clk.common.hw,
 		[CLK_GPU_MEM]		= &gpu_mem_clk.common.hw,
 		[CLK_GPU_SYS]		= &gpu_sys_clk.common.hw,
diff --git a/include/dt-bindings/clock/actions,s900-cmu.h b/include/dt-bindings/clock/actions,s900-cmu.h
index 7c12515..2247f1c 100644
--- a/include/dt-bindings/clock/actions,s900-cmu.h
+++ b/include/dt-bindings/clock/actions,s900-cmu.h
@@ -121,7 +121,7 @@ 
 #define CLK_DDR1			97
 #define CLK_DMM				98
 
-#define CLK_ETH_MAC			99
+#define CLK_ETHERNET			99
 #define CLK_RMII_REF			100
 
 #define CLK_NR_CLKS			(CLK_RMII_REF + 1)