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: 13153194 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4F38C64ED8 for ; Mon, 27 Feb 2023 11:02:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229905AbjB0LCv (ORCPT ); Mon, 27 Feb 2023 06:02:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229955AbjB0LCg (ORCPT ); Mon, 27 Feb 2023 06:02:36 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9978B20D22; Mon, 27 Feb 2023 03:01:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1677495718; x=1709031718; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=DCAwh44v3dpEcmwP85zem/AILU4rZ+BTE1TOGKnxNQw=; b=m9hlkbOwn0bhcxRakY8duxyoOuOMcJqILhX/Jk5TixIAvD6QuuGENiBb yUUZaiEC4qcTrUcA46gyyBfiLHtkhcLLDPmkCnD1j9rbKwzjpu6o1mALl rk6EwR0mp6ZuB5oMtnyrDd7uyjs2MrbDNcxo6+OftqrB+cvimQFgAxhCT TOU8DSmiGZQGDNckz3qszzeVX7H+DDtblAixozbnXEXZKYqBuoiI/SjR8 FMMUNPY/xX7F2ChA373iUZn38uDS/ZldHWvWFC7Dm7zD6YAqnY8Qw1ie2 OFP7jAsZNu6bJwXv+yDXmDlAssn/sbnPV8WsMi6MoJkXJuPLh87ZWIBgB Q==; 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 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.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; }