diff mbox series

[net-next,5/5] net: ethernet: renesas: rcar_gen4_ptp: Break out to module

Message ID 20231117164332.354443-6-niklas.soderlund+renesas@ragnatech.se (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show
Series net: ethernet: renesas: rcar_gen4_ptp: Add V4H support | expand

Commit Message

Niklas Söderlund Nov. 17, 2023, 4:43 p.m. UTC
The Gen3 gPTP support will be shared between the existing Renesas
Ethernet Switch driver and the upcoming Renesas Ethernet-TSN driver. In
preparation for this break out the gPTP support to its own module.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/net/ethernet/renesas/Kconfig         | 10 ++++++++++
 drivers/net/ethernet/renesas/Makefile        |  5 +++--
 drivers/net/ethernet/renesas/rcar_gen4_ptp.c |  5 +++++
 3 files changed, 18 insertions(+), 2 deletions(-)

Comments

Geert Uytterhoeven Nov. 18, 2023, 11:20 a.m. UTC | #1
Hi Niklas,

Thanks for your patch!

On Fri, Nov 17, 2023 at 5:45 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> The Gen3 gPTP support will be shared between the existing Renesas

Gen4

> Ethernet Switch driver and the upcoming Renesas Ethernet-TSN driver. In
> preparation for this break out the gPTP support to its own module.
>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

> --- a/drivers/net/ethernet/renesas/Kconfig
> +++ b/drivers/net/ethernet/renesas/Kconfig
> @@ -44,7 +44,17 @@ config RENESAS_ETHER_SWITCH
>         select CRC32
>         select MII
>         select PHYLINK
> +       select RENESAS_GEN4_PTP
>         help
>           Renesas Ethernet Switch device driver.
>
> +config RENESAS_GEN4_PTP
> +       tristate "Renesas R-Car Gen4 gPTP support"
> +       depends on ARCH_RENESAS || COMPILE_TEST

Perhaps

    tristate "Renesas R-Car Gen4 gPTP support" if COMPILE_TEST

?

The driver is already auto-selected when needed.

> +       select CRC32
> +       select MII
> +       select PHYLIB
> +       help
> +         Renesas R-Car Gen4 gPTP device driver.
> +
>  endif # NET_VENDOR_RENESAS

> --- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
> +++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c

> @@ -186,3 +188,6 @@ struct rcar_gen4_ptp_private *rcar_gen4_ptp_alloc(struct platform_device *pdev)
>
>         return ptp;
>  }
> +EXPORT_SYMBOL_GPL(rcar_gen4_ptp_alloc);
> +
> +MODULE_LICENSE("GPL");

Please add the other MODULE_*() definitions,too.

Gr{oetje,eeting}s,

                        Geert
Niklas Söderlund Nov. 18, 2023, 3:58 p.m. UTC | #2
Hi Geert,

Thanks for your review.

On 2023-11-18 12:20:41 +0100, Geert Uytterhoeven wrote:
> Hi Niklas,
> 
> Thanks for your patch!
> 
> On Fri, Nov 17, 2023 at 5:45 PM Niklas Söderlund
> <niklas.soderlund+renesas@ragnatech.se> wrote:
> > The Gen3 gPTP support will be shared between the existing Renesas
> 
> Gen4
> 
> > Ethernet Switch driver and the upcoming Renesas Ethernet-TSN driver. In
> > preparation for this break out the gPTP support to its own module.
> >
> > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> 
> > --- a/drivers/net/ethernet/renesas/Kconfig
> > +++ b/drivers/net/ethernet/renesas/Kconfig
> > @@ -44,7 +44,17 @@ config RENESAS_ETHER_SWITCH
> >         select CRC32
> >         select MII
> >         select PHYLINK
> > +       select RENESAS_GEN4_PTP
> >         help
> >           Renesas Ethernet Switch device driver.
> >
> > +config RENESAS_GEN4_PTP
> > +       tristate "Renesas R-Car Gen4 gPTP support"
> > +       depends on ARCH_RENESAS || COMPILE_TEST
> 
> Perhaps
> 
>     tristate "Renesas R-Car Gen4 gPTP support" if COMPILE_TEST
> 
> ?
> 
> The driver is already auto-selected when needed.

Good idea, will do for v2.

> 
> > +       select CRC32
> > +       select MII
> > +       select PHYLIB
> > +       help
> > +         Renesas R-Car Gen4 gPTP device driver.
> > +
> >  endif # NET_VENDOR_RENESAS
> 
> > --- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
> > +++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
> 
> > @@ -186,3 +188,6 @@ struct rcar_gen4_ptp_private *rcar_gen4_ptp_alloc(struct platform_device *pdev)
> >
> >         return ptp;
> >  }
> > +EXPORT_SYMBOL_GPL(rcar_gen4_ptp_alloc);
> > +
> > +MODULE_LICENSE("GPL");
> 
> Please add the other MODULE_*() definitions,too.

Wops, checkpatch only complained about MODULE_LICENSE, will fix for v2.

> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> -- 
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> 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
diff mbox series

Patch

diff --git a/drivers/net/ethernet/renesas/Kconfig b/drivers/net/ethernet/renesas/Kconfig
index 8ef5b0241e64..4e7d8546abe2 100644
--- a/drivers/net/ethernet/renesas/Kconfig
+++ b/drivers/net/ethernet/renesas/Kconfig
@@ -44,7 +44,17 @@  config RENESAS_ETHER_SWITCH
 	select CRC32
 	select MII
 	select PHYLINK
+	select RENESAS_GEN4_PTP
 	help
 	  Renesas Ethernet Switch device driver.
 
+config RENESAS_GEN4_PTP
+	tristate "Renesas R-Car Gen4 gPTP support"
+	depends on ARCH_RENESAS || COMPILE_TEST
+	select CRC32
+	select MII
+	select PHYLIB
+	help
+	  Renesas R-Car Gen4 gPTP device driver.
+
 endif # NET_VENDOR_RENESAS
diff --git a/drivers/net/ethernet/renesas/Makefile b/drivers/net/ethernet/renesas/Makefile
index e8fd85b5fe8f..9070acfd6aaf 100644
--- a/drivers/net/ethernet/renesas/Makefile
+++ b/drivers/net/ethernet/renesas/Makefile
@@ -8,5 +8,6 @@  obj-$(CONFIG_SH_ETH) += sh_eth.o
 ravb-objs := ravb_main.o ravb_ptp.o
 obj-$(CONFIG_RAVB) += ravb.o
 
-rswitch_drv-objs := rswitch.o rcar_gen4_ptp.o
-obj-$(CONFIG_RENESAS_ETHER_SWITCH) += rswitch_drv.o
+obj-$(CONFIG_RENESAS_ETHER_SWITCH) += rswitch.o
+
+obj-$(CONFIG_RENESAS_GEN4_PTP) += rcar_gen4_ptp.o
diff --git a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
index 59f6351e9ae9..22552a8f5430 100644
--- a/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
+++ b/drivers/net/ethernet/renesas/rcar_gen4_ptp.c
@@ -166,6 +166,7 @@  int rcar_gen4_ptp_register(struct rcar_gen4_ptp_private *ptp_priv,
 
 	return 0;
 }
+EXPORT_SYMBOL_GPL(rcar_gen4_ptp_register);
 
 int rcar_gen4_ptp_unregister(struct rcar_gen4_ptp_private *ptp_priv)
 {
@@ -173,6 +174,7 @@  int rcar_gen4_ptp_unregister(struct rcar_gen4_ptp_private *ptp_priv)
 
 	return ptp_clock_unregister(ptp_priv->clock);
 }
+EXPORT_SYMBOL_GPL(rcar_gen4_ptp_unregister);
 
 struct rcar_gen4_ptp_private *rcar_gen4_ptp_alloc(struct platform_device *pdev)
 {
@@ -186,3 +188,6 @@  struct rcar_gen4_ptp_private *rcar_gen4_ptp_alloc(struct platform_device *pdev)
 
 	return ptp;
 }
+EXPORT_SYMBOL_GPL(rcar_gen4_ptp_alloc);
+
+MODULE_LICENSE("GPL");