ptp: ocp: Parameterize the TOD information display.
authorJonathan Lemon <jonathan.lemon@gmail.com>
Wed, 15 Sep 2021 02:16:20 +0000 (19:16 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Sep 2021 10:10:00 +0000 (11:10 +0100)
Only display the TOD information if there is a corresponding
TOD resource.

Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/ptp/ptp_ocp.c

index d37eac6..2a6cc76 100644 (file)
@@ -743,7 +743,8 @@ ptp_ocp_info(struct ptp_ocp *bp)
                 ptp_ocp_clock_name_from_val(select >> 16),
                 ptp_clock_index(bp->ptp));
 
-       ptp_ocp_tod_info(bp);
+       if (bp->tod)
+               ptp_ocp_tod_info(bp);
 }
 
 static struct device *