Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2827032pxb; Mon, 1 Nov 2021 02:38:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOw44Swva/SphK0d6VPlvg85zQI9hdK+eL+ZN10R4TXFw+4uj8/GMcYuzF9HJY6C4KqYsj X-Received: by 2002:a05:6e02:1a61:: with SMTP id w1mr20543102ilv.48.1635759515159; Mon, 01 Nov 2021 02:38:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635759515; cv=none; d=google.com; s=arc-20160816; b=pyuDmB1vg/Cvt2M5APuzB4FTQEHDcZ4zUGXSL13loddF4G7Ij7Ea5i0X2q3eZbxrPw BrR+bcZzftdnYLCt6uTDYK/U0ku8cr3rnw6uwuLcDNN4PhNgjzOi5AxS28yHvR5HphM4 OeW4xu+39M37ronXral/WJchd3H4xJ1CpbPUAuS735nS8b9bjkp57d/hvgq8UrWyKpo0 2kpantCHUSapML7n73OGEzzw9/gI+mcGpIAlMg1ja+cud7hocXws7Tz+xxNiETVwBchl jwwaKKW+rqaW4hpeYplUY6yGvfqEJHPr/IZa17ji5kYcvJCoQ+7ZzPxuxWhAg/pX+Jqj R9xA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/XK5ahqllXJLRkAfs4RRYj35r5DG5kgq+ivsspLIu9w=; b=XW/mRrUanFHzCM3ijCh4CpNSa61gRUd6PY02B78T30J3Obvd/ZQ8V48EIhKfbYeKIE 3p0/08sTeBbWHgUoJPcobQkRBvzJ0PSHlB4DSzwIhx1ESMdRWdapLqCJhv0dmP6QE8rk kbjV774zboS1fbL3OKfdMGiPtMOol5Ju6ZU0QiZWJU6CQBZcikhTr74wUjoqoYCSv0vk Ha7TO5YxLnJLP2f2RQlBxQwNyjIne42FFZxzN7DATf42f9HNb3OGCdHVOQ+xpomZAQ8B ny6nfi/gCnFpaScsDH8e6IzcarLcNXIhu9xzJVGBJx8WG4MCutFNsIqf2oQXWkdM14Sa x/Dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="z8eYl/ai"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l5si21680675ilh.0.2021.11.01.02.38.23; Mon, 01 Nov 2021 02:38:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="z8eYl/ai"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233990AbhKAJic (ORCPT + 99 others); Mon, 1 Nov 2021 05:38:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:43678 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233281AbhKAJf7 (ORCPT ); Mon, 1 Nov 2021 05:35:59 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AC8A9611C0; Mon, 1 Nov 2021 09:26:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1635758777; bh=JA/Hy1hpfPf7wnT5E4+pX4LGsaySt6Qf6WS3/GHh638=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z8eYl/ai/rZQPwr71Xe2BN2ffl/jDLn8AIXJGlkOrmw4iMxcF7jTtaj9oAGMU1D/8 dwH/v0bKBQEutGLDnWTHzdjzv3YqSJHByTvumkLVNm1oTKTM/y/3whkuTVIcCpVfNh /DyAPnGonucCgrrlI04GTtjArH+bKAmqcG8GkNpM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jonas Gorski , Chris Packham , Florian Fainelli , Linus Walleij , Bartosz Golaszewski Subject: [PATCH 5.10 54/77] gpio: xgs-iproc: fix parsing of ngpios property Date: Mon, 1 Nov 2021 10:17:42 +0100 Message-Id: <20211101082523.035810837@linuxfoundation.org> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211101082511.254155853@linuxfoundation.org> References: <20211101082511.254155853@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonas Gorski commit 85fe6415c146d5d42ce300c12f1ecf4d4af47d40 upstream. 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 Signed-off-by: Bartosz Golaszewski Signed-off-by: Greg Kroah-Hartman --- drivers/gpio/gpio-xgs-iproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpio/gpio-xgs-iproc.c +++ b/drivers/gpio/gpio-xgs-iproc.c @@ -224,7 +224,7 @@ static int iproc_gpio_probe(struct platf } 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);