From patchwork Wed Jun 12 10:43:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13694783 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 46363C27C53 for ; Wed, 12 Jun 2024 10:43:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=en5v3zZb3SYUynuEEvB5KY7fvjCtjNs2C99/5XHt5sQ=; b=g/oqwxv8PJ7xMY59lLUxKC+PX9 0/mGwpnrsDcxIKwNLJY74qegec9v9/13U5/0IB3q43qFJugjvTW5oGDlt216HpaVgtB0Pu1qYmEvA HijPCOsnTyo0iMjex66gahpJIihsi10VkZ0S/exqGbgKE1KU30G4zKlEbFbvkoqUvudCQilOK55WU xSDF+zO76t2HdAxWaPxv3+d5Y+U9mYxezi4saUs28+M0MDVRYQiq2xFGZ+6If2sYDd03WdOOI9E2H FDpIO2NtOs8hTA0OPgETHUJrrspGVnLm67oRN4cNVeSQ3WKmRt0IIBF1CecYNcKJ+6t2mlL4mNDWW MtcW2F1A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHLSC-0000000CIHz-1TsV; Wed, 12 Jun 2024 10:43:44 +0000 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHLS9-0000000CIFo-2keN for linux-arm-kernel@lists.infradead.org; Wed, 12 Jun 2024 10:43:43 +0000 Received: by mail-lj1-x231.google.com with SMTP id 38308e7fff4ca-2ead2c6b50bso71782271fa.0 for ; Wed, 12 Jun 2024 03:43:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718189017; x=1718793817; darn=lists.infradead.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=en5v3zZb3SYUynuEEvB5KY7fvjCtjNs2C99/5XHt5sQ=; b=s6iqBxUW6nxZXCA1WyfTcRYiQ28aZ4al5Ll2dL/F6cs+ajsfw9L83LCn4GJeaAARnw lNZmg37g46SVNNusnR4jqmnEo8NdZ9InIsic80JOnI70qj99Sb7RqimNRhrvd8ZH0PVR 1TT8Ce4ImCbPpTD7VDzGAsn/++w6JdqcmtKV3YYqsN2aykkeVf23uKZxXdF1kPEUJyTc S2g2yMd3pT+aEqPQEw+mNvSUOSJrJQZaoZmbpSExyoNg5q+628go5OxKkJC8ty+TB45y Rgrxip8nCBozdhw7RPEYoltpOkHx9RTwP/bECCXNiEoAA6W7oBU3aAN3dyQ5tx4+X1Wn WWOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718189017; x=1718793817; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=en5v3zZb3SYUynuEEvB5KY7fvjCtjNs2C99/5XHt5sQ=; b=c0zjDaHKNHPmc3iUCXiullYeiQjSAN0v6rndtJIQzLqRgN853KVxHLU2deIOARFDOf n+cjXpWzWYaptA17ETJFRCfR7K6c3+n0QyThl2sBldOi5ADULTNt9VVCgbk8kA0oK8E5 IMMNa3LanKlzIN5l7dpjs83dxhOnTfjwkGNF1Ab+kJvRLrE5jr6rKoLsaInQ3pXBmHIk J9QuDW0ZDjiDeGsGhq53TM5YP638h5TgFEs5G8ktX2YpkRd6M0qnX/vYSYEKlu6sYk+z FK7AB4vfTlw4Z+OlCEh+AkeQLxkAxWieQa4wedaleXGRiChhZEECQ0SHC6UCuBgPrfFr zUEA== X-Forwarded-Encrypted: i=1; AJvYcCUH4UBl2I38qTqLSRIZMt73CaHGSzC9Ob5TVQ0d8cG92w1sqhq6ZPvkjZgR9G1fGUm3YjBK2OugARH4VsPzdKN65EGJqybBTlXK+FlIZc5F2h5yMOc= X-Gm-Message-State: AOJu0YwX9DTHv1heromNF88L2ry8eH5iV9Fd31s20WCnLQO7GytDSiac UiC/Hp/pk7R7lZsSIimtvGMbNXM+/d/EJduVKkJMYKOs5KRjLTo7t6FZ8UqiNfg= X-Google-Smtp-Source: AGHT+IGAjGH7WuBg4zqQ4D62wvnr79c+GSlh8tV4aOGiyUMLTUamEwviTONC6JOitXK9+WCXuDW5Ng== X-Received: by 2002:a2e:a796:0:b0:2eb:fda7:e35f with SMTP id 38308e7fff4ca-2ebfda7e40bmr8240381fa.5.1718189017181; Wed, 12 Jun 2024 03:43:37 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-422874de62fsm21843715e9.38.2024.06.12.03.43.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 03:43:36 -0700 (PDT) Date: Wed, 12 Jun 2024 13:43:33 +0300 From: Dan Carpenter To: Jacky Huang Cc: Shan-Chun Hung , Linus Walleij , linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] pinctrl: nuvoton: ma35d1: Fix an IS_ERR() vs NULL check Message-ID: <840152f9-d3bb-410e-8164-4c5043e1983e@moroto.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240612_034341_736682_56A4DE65 X-CRM114-Status: GOOD ( 13.27 ) 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 The fwnode_iomap() function doesn't return error pointers, it returns NULL. It's the same as of_iomap() in that way. Update the check accordingly. Fixes: ecc5bf868673 ("pinctrl: nuvoton: Add ma35d1 pinctrl and GPIO driver") Signed-off-by: Dan Carpenter --- drivers/pinctrl/nuvoton/pinctrl-ma35.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/nuvoton/pinctrl-ma35.c b/drivers/pinctrl/nuvoton/pinctrl-ma35.c index fb933cddde91..1fa00a23534a 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-ma35.c +++ b/drivers/pinctrl/nuvoton/pinctrl-ma35.c @@ -571,8 +571,8 @@ static int ma35_gpiolib_register(struct platform_device *pdev, struct ma35_pinct static int ma35_get_bank_data(struct ma35_pin_bank *bank) { bank->reg_base = fwnode_iomap(bank->fwnode, 0); - if (IS_ERR(bank->reg_base)) - return PTR_ERR(bank->reg_base); + if (!bank->reg_base) + return -ENOMEM; bank->irq = fwnode_irq_get(bank->fwnode, 0);