From patchwork Thu Nov 12 16:45:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 324209 Delivered-To: patch@linaro.org Received: by 2002:a05:6e02:5ce:0:0:0:0 with SMTP id l14csp489733ils; Thu, 12 Nov 2020 08:45:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKZoL6SHB1LzBmLzxEUM6FpPNsK0SzC483HvieYDFoNzr3swEXARu9fkXYOhZQ5NhP1BC0 X-Received: by 2002:a17:906:1989:: with SMTP id g9mr178014ejd.62.1605199541787; Thu, 12 Nov 2020 08:45:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605199541; cv=none; d=google.com; s=arc-20160816; b=aBTAY/9amxteUAFRPkn/3hU6NC8Rsbd214QQBgJOMe3TeKL48APQk+Ru3F/Iec0aOZ ZuPUE5IU+pcgKzTxsKZXPPouShDdRdXbRvMdpQt6o/9hEN4RIXDpHisvqvWD9TEJZrsx WWARwtQ3SGnkr45z/n6rGWKM/wcAbcsrh5sXnJi41jvV4HG9x3WLnrfwjZXOLg3/3M3G 7P26j6Az742YR8qmabLysOcTeXxqpFWxLDrZ3ZNV54pZID2NtvmvLA9aTqp9y6axuPy0 suzKB3Pw8BAs3wvrs75aPfEuzEK5uYlWtb4y+nR5JbEyny4KYOBzZcK6PTc9LJ7Oqlon 703w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=nEeyGV/g8WhnDhmKwXjMR/xIRfMtEk/NvzJI7KH1IEg=; b=ip8KQJDug5OWOG+9PqR9F2N55TqG9zAlxisLFrG9sVgUFamWSQ29DpjJ0EPdPvB1Hm MjM/rmX3FcwN+YBgL0i4+Lxn/+JV4Q1l9HV84hdh1WP3Tya0oH3EAhinepn0C6XcB/W5 L9sV7E69gfBqbfcLTcMW3BroImnqO0uBCzYE42NNz9X5qmM75+75FdtTcauutGpt6Tl/ /CKlZ2NCm4QMX4/2B+/pGn7HJ6e28n49hqR4vfcsH5rbecooqP8JxQD7jzbOUc/pr6W5 4npL57G5e6K+qlJS0zEUCnr2YD+WuoLUXEWQaP/HO9SshuNzcRPM0F6+u5HfLbBqT3Sj 2dcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Npe45z1F; spf=pass (google.com: domain of linux-omap-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hr29si4646126ejc.464.2020.11.12.08.45.41; Thu, 12 Nov 2020 08:45:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-omap-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Npe45z1F; spf=pass (google.com: domain of linux-omap-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729039AbgKLQpi (ORCPT + 3 others); Thu, 12 Nov 2020 11:45:38 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:37566 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728977AbgKLQpi (ORCPT ); Thu, 12 Nov 2020 11:45:38 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 0ACGjWVr030274; Thu, 12 Nov 2020 10:45:32 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1605199532; bh=nEeyGV/g8WhnDhmKwXjMR/xIRfMtEk/NvzJI7KH1IEg=; h=From:To:CC:Subject:Date; b=Npe45z1FSa8F+JxCBhh/LjOhcnJYvBvCpbZYribufbxj3kQd8+7B76xAs2QYK1Si9 0mTWvBX28fRfouowO7kkIYUbLJBMJse2FXSL6LOYjiLiAl3Ypdbk76TExVHGESigk9 S/S3kzeu5/wzB2fr0GI7Rx2gDB32DwPv/HOAe6AA= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0ACGjWYP057547 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 12 Nov 2020 10:45:32 -0600 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Thu, 12 Nov 2020 10:45:31 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Thu, 12 Nov 2020 10:45:31 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 0ACGjVJ1098180; Thu, 12 Nov 2020 10:45:31 -0600 From: Grygorii Strashko To: "David S. Miller" , , Richard Cochran , Jakub Kicinski , Wang Qing CC: Sekhar Nori , , , Arnd Bergmann , Grygorii Strashko Subject: [PATCH v5] net: ethernet: ti: am65-cpts: update ret when ptp_clock is ERROR Date: Thu, 12 Nov 2020 18:45:41 +0200 Message-ID: <20201112164541.3223-1-grygorii.strashko@ti.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org From: Wang Qing We always have to update the value of ret, otherwise the error value may be the previous one. Fixes: f6bd59526ca5 ("net: ethernet: ti: introduce am654 common platform time sync driver") Signed-off-by: Wang Qing [grygorii.strashko@ti.com: fix build warn, subj add fixes tag] Signed-off-by: Grygorii Strashko Acked-by: Richard Cochran --- Hi I've update patch as requested and added Acked-by from Richard from v1. v4: https://lore.kernel.org/patchwork/patch/1336771/ v3: https://lore.kernel.org/patchwork/patch/1334871/ v2: https://lore.kernel.org/patchwork/patch/1334549/ v1: https://lore.kernel.org/patchwork/patch/1334067/ drivers/net/ethernet/ti/am65-cpts.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.17.1 diff --git a/drivers/net/ethernet/ti/am65-cpts.c b/drivers/net/ethernet/ti/am65-cpts.c index 75056c14b161..5dc60ecabe56 100644 --- a/drivers/net/ethernet/ti/am65-cpts.c +++ b/drivers/net/ethernet/ti/am65-cpts.c @@ -1001,8 +1001,7 @@ struct am65_cpts *am65_cpts_create(struct device *dev, void __iomem *regs, if (IS_ERR_OR_NULL(cpts->ptp_clock)) { dev_err(dev, "Failed to register ptp clk %ld\n", PTR_ERR(cpts->ptp_clock)); - if (!cpts->ptp_clock) - ret = -ENODEV; + ret = cpts->ptp_clock ? PTR_ERR(cpts->ptp_clock) : -ENODEV; goto refclk_disable; } cpts->phc_index = ptp_clock_index(cpts->ptp_clock);