public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] ptp: ocp: add irig and dcf NULL-check in __handle_signal functions
@ 2025-04-09  9:24 Sagi Maimon
  2025-04-09 10:09 ` Vadim Fedorenko
  2025-04-10 10:23 ` Paolo Abeni
  0 siblings, 2 replies; 4+ messages in thread
From: Sagi Maimon @ 2025-04-09  9:24 UTC (permalink / raw)
  To: jonathan.lemon, vadim.fedorenko, richardcochran, andrew+netdev,
	davem, edumazet, kuba, pabeni
  Cc: linux-kernel, netdev, Sagi Maimon

In __handle_signal_outputs and __handle_signal_inputs add
irig and dcf NULL-check

Signed-off-by: Sagi Maimon <maimon.sagi@gmail.com>
---
 drivers/ptp/ptp_ocp.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index 7945c6be1f7c..4e4a6f465b01 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -2434,15 +2434,19 @@ ptp_ocp_dcf_in(struct ptp_ocp *bp, bool enable)
 static void
 __handle_signal_outputs(struct ptp_ocp *bp, u32 val)
 {
-	ptp_ocp_irig_out(bp, val & 0x00100010);
-	ptp_ocp_dcf_out(bp, val & 0x00200020);
+	if (bp->irig_out)
+		ptp_ocp_irig_out(bp, val & 0x00100010);
+	if (bp->dcf_out)
+		ptp_ocp_dcf_out(bp, val & 0x00200020);
 }
 
 static void
 __handle_signal_inputs(struct ptp_ocp *bp, u32 val)
 {
-	ptp_ocp_irig_in(bp, val & 0x00100010);
-	ptp_ocp_dcf_in(bp, val & 0x00200020);
+	if (bp->irig_out)
+		ptp_ocp_irig_in(bp, val & 0x00100010);
+	if (bp->dcf_out)
+		ptp_ocp_dcf_in(bp, val & 0x00200020);
 }
 
 static u32
-- 
2.45.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-04-13 13:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-09  9:24 [PATCH v1] ptp: ocp: add irig and dcf NULL-check in __handle_signal functions Sagi Maimon
2025-04-09 10:09 ` Vadim Fedorenko
2025-04-10 10:23 ` Paolo Abeni
2025-04-13 13:44   ` Sagi Maimon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox