From patchwork Thu Oct 14 12:33:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Gorski X-Patchwork-Id: 12558403 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A49CBC433EF for ; Thu, 14 Oct 2021 12:35:59 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 67DF5610EA for ; Thu, 14 Oct 2021 12:35:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 67DF5610EA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=ZHUsnCMu5DB8YQEmzX4bE4IMS/PTys0HYiTXjImZAMM=; b=kBN8YLDE4kH5Ob UNTKpF9P8ElpM2MM+qNlC4vcTzMKrei3LMNa71sy1eZbqwKvupFmxuQ0aHlLHOU0az0M8+Cji2+s2 IjK8xWk8tJVhtQZ/ZhKtqOHZpPqFrPZ/mTjbbQdmzpLOO+tgoYEhnJ2TEIfotKiNszzwnCgsfazWF oVOw5UY+3FaI5qu4yV84uyqrMjqMyU1xaEvYWYVlyX+XXSqHYa24g+nOada/JBcp5L/GWDjr1YM0B WWDuOmMuaWtaY6wGkFyYk90nzTW4/DPDQn0e5CL2P4NUjzeI58DqQy6cMLHbpkCNdWuPT94w48jxA 83VJbpzuFY2z0/31FJ4w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mazvm-0035DF-NH; Thu, 14 Oct 2021 12:33:54 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mazvi-0035CB-JV for linux-arm-kernel@lists.infradead.org; Thu, 14 Oct 2021 12:33:51 +0000 Received: by mail-wr1-x431.google.com with SMTP id v17so18933542wrv.9 for ; Thu, 14 Oct 2021 05:33:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mOaq3Ei7m1maDGDV1twf5fWkAZyqziUgFKsdh7K//Hw=; b=jX4D3DsQgUJbmdRSmZPYtlO3R93q7prvnz7RjaEVAEWQL3Qci59edH834chrE0IIzA BTnz775MgynQSVght1Nyfv0n6mKoInRXMyg5FN3yVhFySIFUBxWHYIm5wg6o8s3yG8R6 RrAcxcYAOemSdEKCTj8ldhvYCq01ScBuR4udSHKw1feQeZpT2YeNt8kfFE4h06gEmJ3t uAHpQXX9dZRL3IFiNP6xi/FWSERx1dRYXZuqXueRFLSjr0Vm3NNg1vMQGguCpMVaLKwm E/3nrl1UI/dm4JFbfqyA2aqQAvF3Aee01kQI9kQiF7VVkqpHKhB417boKeIbHorR8Fdy Rzqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=mOaq3Ei7m1maDGDV1twf5fWkAZyqziUgFKsdh7K//Hw=; b=ww0VLCRF6G2rD98Ho422rcmmd+GpXaZF/5zu1pkiKf97o68TWj68xENrSRftjJ+BKR g2AwqhK/OaP/UoFjaZpYOL6ifMli2N+airThkL4YWaq/S4ivLZGmHEveAufDY1QdPX7D +2U9uF+xevzxj8Rw/wfMpScRtVPEA4D8pzfNgneJGgMsVIRzvXPplPWbh1pR1U6walJI jxsnqHay+VcGhARmjbjML26GjlwVREyfZjN5PE82vdmVUGWHCM47uWi//+D+zmobhmWj gDOZFxPJFyg0hCJCJU8eQuD4VsfK7yS9SdGSUnfhEHh75zJ2eEVN5dFQE5BV9xSc5EgV 9pVQ== X-Gm-Message-State: AOAM533/3B3sO3eRTCK66RDfEwto3DODhKnJ6EpOM73szm9rpZ5xWsi5 S9j/ywfM/85DipJjIzdqANE= X-Google-Smtp-Source: ABdhPJwiBDunlaHmUuKcNVnm07JL58n7v2d8i9kl3VZpPdrv4zS8KJWWji3YEFOh9MZBeLz7THTUsQ== X-Received: by 2002:a1c:7c02:: with SMTP id x2mr5534012wmc.165.1634214828063; Thu, 14 Oct 2021 05:33:48 -0700 (PDT) Received: from dummy-pc.bisdn.de (dslb-088-073-007-228.088.073.pools.vodafone-ip.de. [88.73.7.228]) by smtp.gmail.com with ESMTPSA id h22sm2492786wmq.42.2021.10.14.05.33.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 05:33:47 -0700 (PDT) From: Jonas Gorski To: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Linus Walleij , Bartosz Golaszewski , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Chris Packham Subject: [PATCH] gpio: xgs-iproc: fix parsing of ngpios property Date: Thu, 14 Oct 2021 14:33:42 +0200 Message-Id: <20211014123342.174711-1-jonas.gorski@gmail.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211014_053350_685309_2FD0A230 X-CRM114-Status: GOOD ( 15.35 ) 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 of_property_read_u32 returns 0 on success, not true, so we need to invert the check to actually take over the provided ngpio value. Fixes: 6a41b6c5fc20 ("gpio: Add xgs-iproc driver") Signed-off-by: Jonas Gorski Reviewed-by: Chris Packham Reviewed-by: Florian Fainelli Reviewed-by: Linus Walleij --- This is based on git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio.git, which is the tree for GPIO according to MAINTAINERS, but hasn't been updated since ~5.11 - is this still the correct tree? It doesn't matter much for this patch though, the driver is virtually untouched since then. drivers/gpio/gpio-xgs-iproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-xgs-iproc.c b/drivers/gpio/gpio-xgs-iproc.c index ad5489a65d54..dd40277b9d06 100644 --- a/drivers/gpio/gpio-xgs-iproc.c +++ b/drivers/gpio/gpio-xgs-iproc.c @@ -224,7 +224,7 @@ static int iproc_gpio_probe(struct platform_device *pdev) } chip->gc.label = dev_name(dev); - if (of_property_read_u32(dn, "ngpios", &num_gpios)) + if (!of_property_read_u32(dn, "ngpios", &num_gpios)) chip->gc.ngpio = num_gpios; irq = platform_get_irq(pdev, 0);