From patchwork Mon Feb 27 10:59:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudiu Beznea X-Patchwork-Id: 13153192 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9292AC64ED8 for ; Mon, 27 Feb 2023 11:00:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=cgEMCvtE24tzDPKYT00gN0uEGBeo6AxJrPyQZQo+9ug=; b=sYQeFRbLThu159 +Xa97bWXdKLzKTMmCaCYQQHHlVoon2oXHUCSQp9/1EBSw6OUOhQ2sxYpSrcTajyakkjFoMfKY9DQL DbXyMwtHQxTGvB5nN/NjDk0diZ+vDQVDwz7kz/VlVaIVb+IqlOengX9PWNre4/zd1qanXFD+ShBUJ 62z7aiDCxuzaary4cjGfFwWDbpZnTQLHNjcbdRuR1llO+RVAAGk815ABZJi2RlaUiFnBEELX+pT+2 QrQXPVnbBeLsYfBkyJCX25cKpexW2J0eqpbR7iJpJkW1alFq7wBjrdlfJxJuZO6f2VQowqXxLx22q Oov/bbs0Y0sKhwLjVTyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pWbET-009J8h-6l; Mon, 27 Feb 2023 10:59:49 +0000 Received: from esa.microchip.iphmx.com ([68.232.153.233]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pWbEO-009J7N-6H for linux-arm-kernel@lists.infradead.org; Mon, 27 Feb 2023 10:59:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1677495585; x=1709031585; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=DCAwh44v3dpEcmwP85zem/AILU4rZ+BTE1TOGKnxNQw=; b=qu+g8/EdhRsJWj6p4uXG7pNrSznY4JNykyoZCQeBhLqMBUhI7k9+Nmi0 8WGWigRlcscmZJbCT0GeoyFbvtiW5pklzQxrg/+DDxx2esVS1lRTepayR siOhGhl3dSiGyydNpulrEwG4fP8KbdjU3wcb39eSchym0eDhE1IKqEWGz 6NkN350o6fNAvaJ/Hy3l6rnqe1aPZ+0vegIa7AFAQ1tENrt5QAqOZD3Cn ZOH+VdF6fJXOhyIlAmx9e4JODVKKWKwM1T6w3Rqul5sFcBPt0nSxmKsYr nqe1SptttvX00qN57w9/waQTZ2P+ey2EctJIGa56lwKFu8Z1IgwdZVbo9 w==; X-IronPort-AV: E=Sophos;i="5.97,331,1669100400"; d="scan'208";a="202692672" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 27 Feb 2023 03:59:43 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.87.72) by chn-vm-ex02.mchp-main.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Mon, 27 Feb 2023 03:59:40 -0700 Received: from m18063-ThinkPad-T460p.mchp-main.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Mon, 27 Feb 2023 03:59:38 -0700 From: Claudiu Beznea To: , , , CC: , , , Claudiu Beznea , Dan Carpenter Subject: [PATCH] clk: at91: clk-sam9x60-pll: fix return value check Date: Mon, 27 Feb 2023 12:59:31 +0200 Message-ID: <20230227105931.2812412-1-claudiu.beznea@microchip.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230227_025945_525318_2E77A6F9 X-CRM114-Status: UNSURE ( 9.23 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org sam9x60_frac_pll_compute_mul_frac() can't return zero. Remove the check against zero to reflect this. Fixes: 43b1bb4a9b3e ("clk: at91: clk-sam9x60-pll: re-factor to support plls with multiple outputs") Reported-by: Dan Carpenter Signed-off-by: Claudiu Beznea --- drivers/clk/at91/clk-sam9x60-pll.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/clk/at91/clk-sam9x60-pll.c b/drivers/clk/at91/clk-sam9x60-pll.c index d757003004cb..0882ed01d5c2 100644 --- a/drivers/clk/at91/clk-sam9x60-pll.c +++ b/drivers/clk/at91/clk-sam9x60-pll.c @@ -668,7 +668,7 @@ sam9x60_clk_register_frac_pll(struct regmap *regmap, spinlock_t *lock, ret = sam9x60_frac_pll_compute_mul_frac(&frac->core, FCORE_MIN, parent_rate, true); - if (ret <= 0) { + if (ret < 0) { hw = ERR_PTR(ret); goto free; }