Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3628293pxb; Mon, 24 Jan 2022 13:54:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJyqRH8Qs/BW0Mp1wrfpo6iH9VRbC0uZCJzK7iXaEpNYRwwkOLw+sDnbLiDJM/sfEYJ4u+WX X-Received: by 2002:a63:6f87:: with SMTP id k129mr13255928pgc.248.1643061245543; Mon, 24 Jan 2022 13:54:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643061245; cv=none; d=google.com; s=arc-20160816; b=L7FJf4XjGvzxin1TsT2aW9FyYwjOWVBOaCnZu9r8Drl+4SNLM8Sd3AaqnhRk6pC+zd f/+Ro/NxuhHyUYvoSx0OqV2bVcHtQ8xqcF/z2/nAPhbrHEzP68FG9D1GkXB6UXs8qA1m XeEZCwAeYqbYZ7wECZLRDoiSe8CoW9b2osXkF3OUKn7Ycl/NFwXDLf1ftHQuxUybOpw3 9nqB0Qh3a33asNkuoVj1N7eOCI73ImNl4sArLvgMDG4TS21TlUymBT9/NrbZ+85RK5S4 1lziHXzhiA7jhAWJljKgKuMmddPWHBXbeC1cf4wGTr7sWNdgVpTYYWeaU0xu8+lUqIkE wuvA== 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=h03UxFBMKKv3tBDp/STy+jvgMV/iIauiUpD1+7/7JRg=; b=lMDlrCbSWdS62x/nG+kk+mIAusv/lVIyvFZ8vu06jQ68zn9wPzlSgj35iIijdNCK5w BYtH7uyD3zyjecOShWnREPvqCufGy/vvOIAYro01tk4Xbw/MrhutolJ9L1hsDazp3YHX xnynSmW53NeaPJZi7z2uAb+zq7NxAVGeZNX2KRO5jom0Z/lVxkB9QgUoaRcYSne0670f w/PTUyY7PGW43GA8PgBdLQmjnfEDHEpsokQ1qbfwNb5XWmTCQ46Mo+onUrCPiqamJwad dJdbRaSjJxOLLTqqKI1q9Y7XZ4S0fksc4RzRV0oNMKfIsWzTdTIX/aaZXc73MeGPXSX3 neng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="KJzaLQ/F"; 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 q6si1690917plr.359.2022.01.24.13.53.53; Mon, 24 Jan 2022 13:54:05 -0800 (PST) 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="KJzaLQ/F"; 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 S1377981AbiAXVib (ORCPT + 99 others); Mon, 24 Jan 2022 16:38:31 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:55642 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444812AbiAXVBg (ORCPT ); Mon, 24 Jan 2022 16:01:36 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8DA38B81243; Mon, 24 Jan 2022 21:01:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BDB2C340E7; Mon, 24 Jan 2022 21:01:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058094; bh=OwpKNv0ksLy2DW7Xq4ObVUnGJwW2RSKgFNXj5Tn8mh0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KJzaLQ/FVc6ljE/dX+tqxjfau6yDcEpx2cLfeHHBwm1U/T7RUksFh0dtlxG8AcTjO nXBvU6MONvlAMQ1HbhWKFzKDP9JIHGyINfyXNq7sZOHuhfTD5O/hjLW5SjdZ2g7jyg zm6Vf4dnEhfhUQCxLGS3XFreWXPlQgT46fvq0gJQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Joey Gouly , Andy Shevchenko , Linus Walleij , Sasha Levin Subject: [PATCH 5.16 0179/1039] pinctrl: apple: return an error if pinmux is missing in the DT Date: Mon, 24 Jan 2022 19:32:48 +0100 Message-Id: <20220124184131.296510925@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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: Joey Gouly [ Upstream commit 839930ca1bd0c79cdf370d11462ef4a81b664e44 ] If of_property_count_u32_elems returned 0, return -EINVAL to indicate a failure. Previously this would return 0. Fixes: a0f160ffcb83 ("pinctrl: add pinctrl/GPIO driver for Apple SoCs") Signed-off-by: Joey Gouly Suggested-by: Andy Shevchenko Link: https://lore.kernel.org/r/20211121165642.27883-12-joey.gouly@arm.com Signed-off-by: Linus Walleij Signed-off-by: Sasha Levin --- drivers/pinctrl/pinctrl-apple-gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-apple-gpio.c b/drivers/pinctrl/pinctrl-apple-gpio.c index a7861079a6502..c772e31d21223 100644 --- a/drivers/pinctrl/pinctrl-apple-gpio.c +++ b/drivers/pinctrl/pinctrl-apple-gpio.c @@ -114,7 +114,7 @@ static int apple_gpio_dt_node_to_map(struct pinctrl_dev *pctldev, dev_err(pctl->dev, "missing or empty pinmux property in node %pOFn.\n", node); - return ret; + return ret ? ret : -EINVAL; } num_pins = ret; -- 2.34.1