net: marvell: octeontx2: simplify the otx2_ptp_adjfine()
authorZheng Yongjun <zhengyongjun3@huawei.com>
Wed, 9 Dec 2020 09:27:26 +0000 (17:27 +0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Dec 2020 01:05:37 +0000 (17:05 -0800)
Simplify the return expression.

Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ptp.c

index 7bcf5246350f3e4295050a0a905966502fd9ddd0..56390a664517bf21afa02a13b0cfa9de2cb2c876 100644 (file)
@@ -12,7 +12,6 @@ static int otx2_ptp_adjfine(struct ptp_clock_info *ptp_info, long scaled_ppm)
        struct otx2_ptp *ptp = container_of(ptp_info, struct otx2_ptp,
                                            ptp_info);
        struct ptp_req *req;
-       int err;
 
        if (!ptp->nic)
                return -ENODEV;
@@ -24,11 +23,7 @@ static int otx2_ptp_adjfine(struct ptp_clock_info *ptp_info, long scaled_ppm)
        req->op = PTP_OP_ADJFINE;
        req->scaled_ppm = scaled_ppm;
 
-       err = otx2_sync_mbox_msg(&ptp->nic->mbox);
-       if (err)
-               return err;
-
-       return 0;
+       return otx2_sync_mbox_msg(&ptp->nic->mbox);
 }
 
 static u64 ptp_cc_read(const struct cyclecounter *cc)