From patchwork Tue Aug 16 09:49:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Beniamino Galvani X-Patchwork-Id: 9283155 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D206C6086A for ; Tue, 16 Aug 2016 09:56:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C1C4128F1B for ; Tue, 16 Aug 2016 09:56:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B621D28F26; Tue, 16 Aug 2016 09:56:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7826D28F22 for ; Tue, 16 Aug 2016 09:56:22 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bZb6V-0006EA-H4; Tue, 16 Aug 2016 09:56:15 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bZb2Z-0001hG-Nz for linux-amlogic@lists.infradead.org; Tue, 16 Aug 2016 09:52:20 +0000 Received: by mail-wm0-x244.google.com with SMTP id i5so15470544wmg.2 for ; Tue, 16 Aug 2016 02:51:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tiLsBIDLGVRYIoet78xjuM4pixG0AOKAAZpXuEi8Cfs=; b=ebxyvtmkI/dVNMyC1nvhFpVau/VCNcXzdyks0RLJt7TB+FNxNanDqXQA914ZDl2O/q 6jBIwCQ/QD6DD1Iii3KwJ3CYkKTlPxjbS4zLjC0GQ3CGRjW7Q7zi5x39s1b5aTqaQV0X D7CuxAVDyawuQcRz4T/sDhb4msZlfxlswnB2djaYk6INCMQxEQBAcyrG79rNiQs7JvCI T60nN/nQB7JEYfth1zMxLgpkKdRgnoh34B3fImWmBbxeqgkMD+aXGvKiT4CYOurVgByB 38f0USifSv5SIqqnjL77/iWLbptRQ1BJlo1qC7CcI0o/BaBi3QoyJRCXIAtO+GfZFbUL JqVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tiLsBIDLGVRYIoet78xjuM4pixG0AOKAAZpXuEi8Cfs=; b=BgfQeRc9zdSmHCUnKI2qmDF5V5SF8BvpF97/qYDe5aZR3WF7v5VtctcSucDd5R9MNu kl6bJpTnZSEi5QLSyBuy3RsCX29WUv0nwPqH5uKctMKe82Gn+/nnlWfY1d2JX6eogTUK eD0uA0cFUetax+3+cqR94o0SRvqphFYHW8WxZSJTzcpA0rsGiB8qG4IhEpAEuEWpZxRZ KoqlIZlX/DDbRWGiNq2j+Gi/wGLzDGyIbqnZvAMsZ0PIlxMKSrsYVVc/jgLYUtd22WRp uRHs6zqhDTPczv9eKsj1jbWv1U6ONGzzncqFNiUYmPWo82B4168X/8q8H/cnMaEOxqed AGUw== X-Gm-Message-State: AEkoousAzquzZG+H6bt35KHV0xnGa+f9RuI+DfXvCIU4wiAdUJ1YBncdPB110F3A03CIWw== X-Received: by 10.194.238.42 with SMTP id vh10mr36849939wjc.111.1471341109574; Tue, 16 Aug 2016 02:51:49 -0700 (PDT) Received: from sark.fritz.box (host26-103-dynamic.31-79-r.retail.telecomitalia.it. [79.31.103.26]) by smtp.gmail.com with ESMTPSA id a2sm25812796wjg.46.2016.08.16.02.51.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Aug 2016 02:51:48 -0700 (PDT) From: Beniamino Galvani To: u-boot@lists.denx.de Subject: [PATCH 1/4] pinctrl: generic: scan for "pins" and "groups" properties in sub-nodes Date: Tue, 16 Aug 2016 11:49:47 +0200 Message-Id: <1471340990-16247-2-git-send-email-b.galvani@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1471340990-16247-1-git-send-email-b.galvani@gmail.com> References: <1471340990-16247-1-git-send-email-b.galvani@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160816_025212_422281_2524D226 X-CRM114-Status: GOOD ( 11.17 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Rini , Albert Aribaud , Masahiro Yamada , Simon Glass , Alexander Graf , Beniamino Galvani , Joe Hershberger , linux-amlogic@lists.infradead.org MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP In cases where the pins and groups definitions are in a sub-node, as: uart_a { mux { groups = "uart_tx_a", "uart_rx_a"; function = "uart_a"; }; }; pinctrl_generic_set_state_subnode() returns an error for the top-level node and pinctrl_generic_set_state() fails. Instead, return success so that the child nodes are tried. Signed-off-by: Beniamino Galvani Reviewed-by: Simon Glass Reviewed-by: Masahiro Yamada --- drivers/pinctrl/pinctrl-generic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/pinctrl/pinctrl-generic.c b/drivers/pinctrl/pinctrl-generic.c index e86b72a..baff40f 100644 --- a/drivers/pinctrl/pinctrl-generic.c +++ b/drivers/pinctrl/pinctrl-generic.c @@ -312,8 +312,10 @@ static int pinctrl_generic_set_state_subnode(struct udevice *dev, is_group = true; strings_count = fdt_count_strings(fdt, node, subnode_target_type); - if (strings_count < 0) - return -EINVAL; + if (strings_count < 0) { + /* skip this node; may contain config child nodes */ + return 0; + } } for (i = 0; i < strings_count; i++) {