net: cavium: clean up return value check in cavium_ptp_probe
authorYueHaibing <yuehaibing@huawei.com>
Thu, 22 Nov 2018 13:27:19 +0000 (21:27 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 24 Nov 2018 01:26:07 +0000 (17:26 -0800)
ptp_clock_register never return NULL, so no need check this
in cavium_ptp_probe.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/common/cavium_ptp.c

index 6aeb1045c302ad4cb1dd4efab54e414eb2bc14b9..73632b84374985cffdba907ad605499a6d71d420 100644 (file)
@@ -277,10 +277,6 @@ static int cavium_ptp_probe(struct pci_dev *pdev,
        writeq(clock_comp, clock->reg_base + PTP_CLOCK_COMP);
 
        clock->ptp_clock = ptp_clock_register(&clock->ptp_info, dev);
-       if (!clock->ptp_clock) {
-               err = -ENODEV;
-               goto error_stop;
-       }
        if (IS_ERR(clock->ptp_clock)) {
                err = PTR_ERR(clock->ptp_clock);
                goto error_stop;