]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: ethernet: renesas: rcar_gen4_ptp: Hide private data from users
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Sun, 1 Feb 2026 18:37:45 +0000 (19:37 +0100)
committerJakub Kicinski <kuba@kernel.org>
Wed, 4 Feb 2026 03:35:38 +0000 (19:35 -0800)
The Gen4 PTP helper module is already used by RTSN and RSWITCH to
support PTP clocks and will be used by RAVB too. Hide the Gen4 PTP
private data structure to make sure none of the users poke at it.

This will be more important for RAVB use-cases as more then one RAVB
device will need to cooperate using one PTP clock source.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Link: https://patch.msgid.link/20260201183745.1075399-5-niklas.soderlund+renesas@ragnatech.se
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/renesas/rcar_gen4_ptp.c
drivers/net/ethernet/renesas/rcar_gen4_ptp.h

index a14a16cf5fe6ef666332a54b9195dc5733b42bb3..27a6f04920978cfe4782397c6ec36f79c4d1d494 100644 (file)
@@ -9,6 +9,7 @@
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
+#include <linux/ptp_clock_kernel.h>
 #include <linux/slab.h>
 
 #include "rcar_gen4_ptp.h"
 #define PTPGPTPTM10_REG                0x0054
 #define PTPGPTPTM20_REG                0x0058
 
+struct rcar_gen4_ptp_private {
+       void __iomem *addr;
+       struct ptp_clock *clock;
+       struct ptp_clock_info info;
+       spinlock_t lock;        /* For multiple registers access */
+       s64 default_addend;
+       bool initialized;
+};
+
 #define ptp_to_priv(ptp)       container_of(ptp, struct rcar_gen4_ptp_private, info)
 
 static int rcar_gen4_ptp_adjfine(struct ptp_clock_info *ptp, long scaled_ppm)
index fffccda401f56271c61fca16533a35bd9341238f..6abaa7cc6b77caeaad132246e6ae0d37bd8586d2 100644 (file)
@@ -7,16 +7,7 @@
 #ifndef __RCAR_GEN4_PTP_H__
 #define __RCAR_GEN4_PTP_H__
 
-#include <linux/ptp_clock_kernel.h>
-
-struct rcar_gen4_ptp_private {
-       void __iomem *addr;
-       struct ptp_clock *clock;
-       struct ptp_clock_info info;
-       spinlock_t lock;        /* For multiple registers access */
-       s64 default_addend;
-       bool initialized;
-};
+struct rcar_gen4_ptp_private;
 
 int rcar_gen4_ptp_register(struct rcar_gen4_ptp_private *ptp_priv, u32 rate);
 int rcar_gen4_ptp_unregister(struct rcar_gen4_ptp_private *ptp_priv);