From patchwork Mon Nov 23 16:23:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 330989 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A1DEAC63697 for ; Mon, 23 Nov 2020 16:24:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A62B20888 for ; Mon, 23 Nov 2020 16:24:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="rEjeQOyW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732685AbgKWQYC (ORCPT ); Mon, 23 Nov 2020 11:24:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:54478 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729881AbgKWQYB (ORCPT ); Mon, 23 Nov 2020 11:24:01 -0500 Received: from localhost.localdomain (adsl-84-226-167-205.adslplus.ch [84.226.167.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BBD0A2080A; Mon, 23 Nov 2020 16:23:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606148641; bh=aDhRfbKOcmjeCqkKU3WanABMbxUDMyrYDDPRQkOYe88=; h=From:To:Cc:Subject:Date:From; b=rEjeQOyWLOdgvVAFF7pqvYB/6aNvOawoAS6BA4nTe+900f7znL4NibKAjG+j1t2Bm hwc+2eYGAQazY9aDVpbi4oI+3HqVQiqAlEbxiyg+Bi/94tzBnQHA/e6SmVtVIoCTsp eSmL6cPECtaDW9To2sMBJUEhOpGyQuwDJSDRvetY= From: Krzysztof Kozlowski To: "David S. Miller" , Jakub Kicinski , Bongsu Jeon , Krzysztof Kozlowski , Krzysztof Opasiak , linux-nfc@lists.01.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: stable@vger.kernel.org Subject: [PATCH] nfc: s3fwrn5: use signed integer for parsing GPIO numbers Date: Mon, 23 Nov 2020 17:23:51 +0100 Message-Id: <20201123162351.209100-1-krzk@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org GPIOs - as returned by of_get_named_gpio() and used by the gpiolib - are signed integers, where negative number indicates error. The return value of of_get_named_gpio() should not be assigned to an unsigned int because in case of !CONFIG_GPIOLIB such number would be a valid GPIO. Fixes: c04c674fadeb ("nfc: s3fwrn5: Add driver for Samsung S3FWRN5 NFC Chip") Cc: Signed-off-by: Krzysztof Kozlowski --- drivers/nfc/s3fwrn5/i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/nfc/s3fwrn5/i2c.c b/drivers/nfc/s3fwrn5/i2c.c index 0ffa389066a0..ae26594c7302 100644 --- a/drivers/nfc/s3fwrn5/i2c.c +++ b/drivers/nfc/s3fwrn5/i2c.c @@ -25,8 +25,8 @@ struct s3fwrn5_i2c_phy { struct i2c_client *i2c_dev; struct nci_dev *ndev; - unsigned int gpio_en; - unsigned int gpio_fw_wake; + int gpio_en; + int gpio_fw_wake; struct mutex mutex;