From patchwork Sun Dec 13 16:17:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 343714 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 C6345C433FE for ; Sun, 13 Dec 2020 16:18:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9A1CF23380 for ; Sun, 13 Dec 2020 16:18:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391457AbgLMQSL (ORCPT ); Sun, 13 Dec 2020 11:18:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729762AbgLMQSH (ORCPT ); Sun, 13 Dec 2020 11:18:07 -0500 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8779CC0613D3; Sun, 13 Dec 2020 08:17:26 -0800 (PST) Received: by mail-wm1-x341.google.com with SMTP id w206so7602904wma.0; Sun, 13 Dec 2020 08:17:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CeBzPvaH2BmMiS1XJWfNJWyku+o1XcRpDrN+C7/T/zw=; b=VAWweM3+ov0cPIIXWg4XQzEshPzG+LF65DgTY+5tiTgb6aI7RRJDBoGtJd7m+SX1f5 YpbL8O2EhZ/o3FFobdfXZrxfo7Op/b1xHfFb88QWLAjT14SbqPyYDQOqXGLqcCYCmTjy 0+tjSSSqXDH1P1A/5bCCccJPy3O3neWfUWqFZA4QDncGbNKN4UvzHVqb6fkPb6vkRHy7 fjL/n/m9UXkS9lFTR/29Xg1R5snt3CwzHf8dXxzNdZ14WtiHDIhutCfUqtaNGg11kzPe QuUOxslf/b2sFHIDklWCrcNt7SMFIp7UWT4k98I+d4lAvWvyfHQohEMw5hZ8Sr1PMS67 Rmmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CeBzPvaH2BmMiS1XJWfNJWyku+o1XcRpDrN+C7/T/zw=; b=PDL804MiIt1iLhRaVjyQH+XoCQoHtbzCV1ozNjqBjngi3VarGKIA0xPgrVNghLS/kw wq/CDB4GJ0Uomar1BzByjSUw5YPDfBuswRZ37PvTaa13TKgmHCi7ED2UUNCR+JSA19z9 Vv7p456Q347XDB48nEExeEWVkgiel12dYNovFMAHUcze24xJZib7n0G+3ySbRJ9SUxNV hk4IUBlbuXw2qhWufwray3xH+RdXcjsXYC4idEqGX4i0aX9Ek/CkimT7YPFy+ZSThbHY FtEm8pGG1uGDBc195bt2aODGBJkyHhQlRMgmWvb/shBvW9UTuvqPNQkyS1psxhp1YAYs Gw5g== X-Gm-Message-State: AOAM532weugr1D3E1T0n/M2YtL4/NKnCNeRO6IZsAUZjvjuii2H/iXG1 Y6ZPzmWjXS2kGP29qxVFUeQ= X-Google-Smtp-Source: ABdhPJwCwhl2HdjA+r2aIj1VSzrGG67fSP+EeVqErQC4WLHJA2pMWwd/PpL1GDJybr0L+ekxtWaTTw== X-Received: by 2002:a1c:8016:: with SMTP id b22mr23591015wmd.135.1607876245340; Sun, 13 Dec 2020 08:17:25 -0800 (PST) Received: from localhost.localdomain (188.red-81-44-87.dynamicip.rima-tde.net. [81.44.87.188]) by smtp.gmail.com with ESMTPSA id 64sm27102073wmd.12.2020.12.13.08.17.24 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Dec 2020 08:17:24 -0800 (PST) From: Sergio Paracuellos To: linus.walleij@linaro.org Cc: robh+dt@kernel.org, gregkh@linuxfoundation.org, yanaijie@huawei.com, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, devel@driverdev.osuosl.org Subject: [PATCH 1/8] dt-bindings: pinctrl: rt2880: properly redo bindings Date: Sun, 13 Dec 2020 17:17:14 +0100 Message-Id: <20201213161721.6514-2-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201213161721.6514-1-sergio.paracuellos@gmail.com> References: <20201213161721.6514-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org When this bindings where applied there weren't already reviewed and some old hacks was being used to properly pass the schemas checks. This commits fix them up: - Instead of using 'if-then' clause use '-pins$'. - 'groups' and 'function' are included inside a new '^(.*-)?pinmux$' node. - compatible string is not an 'enum' but a 'const'. - 'pinctrl-0' and 'pinctrl-names' removed since they are used in consumer nodes. Signed-off-by: Sergio Paracuellos Reviewed-by: Rob Herring --- .../pinctrl/ralink,rt2880-pinmux.yaml | 62 +++++++++---------- 1 file changed, 28 insertions(+), 34 deletions(-) diff --git a/Documentation/devicetree/bindings/pinctrl/ralink,rt2880-pinmux.yaml b/Documentation/devicetree/bindings/pinctrl/ralink,rt2880-pinmux.yaml index 7dea3e26d99e..b32f2676cab5 100644 --- a/Documentation/devicetree/bindings/pinctrl/ralink,rt2880-pinmux.yaml +++ b/Documentation/devicetree/bindings/pinctrl/ralink,rt2880-pinmux.yaml @@ -15,39 +15,38 @@ description: properties: compatible: - enum: - - ralink,rt2880-pinmux + const: ralink,rt2880-pinmux - pinctrl-0: - description: - A phandle to the node containing the subnodes containing default - configurations. This is for pinctrl hogs. +patternProperties: + '-pins$': + type: object + patternProperties: + '^(.*-)?pinmux$': + type: object + description: node for pinctrl. + $ref: pinmux-node.yaml# + + properties: + groups: + description: Name of the pin group to use for the functions. + enum: [i2c, spi, uart1, uart2, uart3, rgmii1, rgmii2, mdio, + pcie, sdhci] + function: + description: The mux function to select + enum: [gpio, i2c, spi, uart1, uart2, uart3, rgmii1, rgmii2, + mdio, nand1, nand2, sdhci] + + required: + - groups + - function + + additionalProperties: false - pinctrl-names: - description: - A pinctrl state named "default" can be defined. - const: default + additionalProperties: false required: - compatible -patternProperties: - '[a-z0-9_-]+': - if: - type: object - description: node for pinctrl. - $ref: "pinmux-node.yaml" - then: - properties: - groups: - description: Name of the pin group to use for the functions. - enum: [i2c, spi, uart1, uart2, uart3, rgmii1, rgmii2, mdio, - pcie, sdhci] - function: - description: The mux function to select - enum: [gpio, i2c, spi, uart1, uart2, uart3, rgmii1, rgmii2, - mdio, nand1, nand2, sdhci] - additionalProperties: false examples: @@ -55,14 +54,9 @@ examples: - | pinctrl { compatible = "ralink,rt2880-pinmux"; - pinctrl-names = "default"; - pinctrl-0 = <&state_default>; - - state_default: pinctrl0 { - }; - i2c_pins: i2c0 { - i2c0 { + i2c_pins: i2c0-pins { + pinmux { groups = "i2c"; function = "i2c"; }; From patchwork Sun Dec 13 16:17:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 343376 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 ED4BCC4167B for ; Sun, 13 Dec 2020 16:18:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC77623380 for ; Sun, 13 Dec 2020 16:18:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2395443AbgLMQSL (ORCPT ); Sun, 13 Dec 2020 11:18:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389237AbgLMQSI (ORCPT ); Sun, 13 Dec 2020 11:18:08 -0500 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA32DC0613D6; Sun, 13 Dec 2020 08:17:27 -0800 (PST) Received: by mail-wr1-x442.google.com with SMTP id c5so10352167wrp.6; Sun, 13 Dec 2020 08:17:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4FZ3cP1OuTxfK0gwz1Y/PUWxvlvZu7xp+4Ek4N5jpDQ=; b=WMlym3iS2H3oTcuHjFDLF3LoK1fESINRLhLoCueruLA3MTGES9p1UuprnXuoa3aqCf zgrAfrYESj5m/bSI5idH7XeazTPaWQG+/hNq63BG0zYyOYmm03m1P5a/G8aSwG1wS9Gv r7LSqmpVREu5vVRbrq8NqABd6b7dNMtnTu9OHDnbs6N4t566G8mJ/ppaOlLlb/4KQ1e7 nywJy0lPIctVGUch1+0EFrApiRLCtBHgVjup/EHVna10mbGHTgXJV8wYJ/AI0FFaE3wI G0uTmULKxVdlUq5EYzV99jnwuI6PyJLiYNlZYlYwb+kvLMG+LpXvbCTqbRgcWswBCNWC a+1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4FZ3cP1OuTxfK0gwz1Y/PUWxvlvZu7xp+4Ek4N5jpDQ=; b=rGodeef+e8c1drLgtMcihXyQFsE4mL5YjxLs0nFzFxkDlO2g34UQWcY/MRNd0+JGAG nKT6ijcZCzNg63QQSLHQmbi9cl+ngktaf1aFzvup46TIqbw0VE0AwHvop1b3c3R6LkoJ 2KFjYvb99gpX1LBiylh6dFRe1N50p1gVQFPZjUXA7gGsJ/xmPOgfqQcIp4nQwXtylckI eWMEvEXG/mphCxefeSCoPZH/bGJPnzFK+VDatRvfJdTMbPDkskv/gmBWpFjI/jzWLuHr 4b6hLhZipm6CC7e4lcIi9lYTiS93qM5NzzTqwVUUdmGN084xVnFJY45rsWtvS93/uJXk 4tmA== X-Gm-Message-State: AOAM531s1sqVrmG2bJ4bw59PreUdp8I7G5ycQjRKAX+pwvapgCKOsVn+ sQOnzmuuRkx0ZaF4bumUehs= X-Google-Smtp-Source: ABdhPJxtjsFp2GSspK6oOC9bf01KY9OFbN+m8KcBkj2GKuSkZQkFIpskgiaBW6McDgPFQQ4NVLybEg== X-Received: by 2002:adf:a745:: with SMTP id e5mr24596097wrd.366.1607876246435; Sun, 13 Dec 2020 08:17:26 -0800 (PST) Received: from localhost.localdomain (188.red-81-44-87.dynamicip.rima-tde.net. [81.44.87.188]) by smtp.gmail.com with ESMTPSA id 64sm27102073wmd.12.2020.12.13.08.17.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Dec 2020 08:17:25 -0800 (PST) From: Sergio Paracuellos To: linus.walleij@linaro.org Cc: robh+dt@kernel.org, gregkh@linuxfoundation.org, yanaijie@huawei.com, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, devel@driverdev.osuosl.org, Dan Carpenter Subject: [PATCH 2/8] pinctrl: ralink: rt2880: avoid double pointer to simplify code Date: Sun, 13 Dec 2020 17:17:15 +0100 Message-Id: <20201213161721.6514-3-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201213161721.6514-1-sergio.paracuellos@gmail.com> References: <20201213161721.6514-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Double pointer is being used and assigned in a bit dirty way to assign functions in pinctrl. Instead of doing this just avoid it and use directly 'p->func' instead. Reported-by: Dan Carpenter Signed-off-by: Sergio Paracuellos --- drivers/pinctrl/ralink/pinctrl-rt2880.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/pinctrl/ralink/pinctrl-rt2880.c b/drivers/pinctrl/ralink/pinctrl-rt2880.c index 42b1c6cecb57..c933e1a1d4fa 100644 --- a/drivers/pinctrl/ralink/pinctrl-rt2880.c +++ b/drivers/pinctrl/ralink/pinctrl-rt2880.c @@ -193,7 +193,6 @@ static struct rt2880_pmx_func gpio_func = { static int rt2880_pinmux_index(struct rt2880_priv *p) { - struct rt2880_pmx_func **f; struct rt2880_pmx_group *mux = p->groups; int i, j, c = 0; @@ -218,31 +217,29 @@ static int rt2880_pinmux_index(struct rt2880_priv *p) p->func_count++; /* allocate our function and group mapping index buffers */ - f = p->func = devm_kcalloc(p->dev, - p->func_count, - sizeof(*p->func), - GFP_KERNEL); + p->func = devm_kcalloc(p->dev, p->func_count, + sizeof(*p->func), GFP_KERNEL); gpio_func.groups = devm_kcalloc(p->dev, p->group_count, sizeof(int), GFP_KERNEL); - if (!f || !gpio_func.groups) - return -1; + if (!p->func || !gpio_func.groups) + return -ENOMEM; /* add a backpointer to the function so it knows its group */ gpio_func.group_count = p->group_count; for (i = 0; i < gpio_func.group_count; i++) gpio_func.groups[i] = i; - f[c] = &gpio_func; + p->func[c] = &gpio_func; c++; /* add remaining functions */ for (i = 0; i < p->group_count; i++) { for (j = 0; j < p->groups[i].func_count; j++) { - f[c] = &p->groups[i].func[j]; - f[c]->groups = devm_kzalloc(p->dev, sizeof(int), + p->func[c] = &p->groups[i].func[j]; + p->func[c]->groups = devm_kzalloc(p->dev, sizeof(int), GFP_KERNEL); - f[c]->groups[0] = i; - f[c]->group_count = 1; + p->func[c]->groups[0] = i; + p->func[c]->group_count = 1; c++; } } From patchwork Sun Dec 13 16:17:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 343375 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 F3D63C4361B for ; Sun, 13 Dec 2020 16:18:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C511823380 for ; Sun, 13 Dec 2020 16:18:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728063AbgLMQSL (ORCPT ); Sun, 13 Dec 2020 11:18:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390872AbgLMQSJ (ORCPT ); Sun, 13 Dec 2020 11:18:09 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C10EAC061793; Sun, 13 Dec 2020 08:17:28 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id a6so11611443wmc.2; Sun, 13 Dec 2020 08:17:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tBnar4EOBqUyAZ3eTgoIH+VVc0DkF/ERTYiHgxOAUMg=; b=vXlC2tVK0G+/3jO20C9qCbaoPVYJ0MvK1j4MBx3N4ODAPfbGuez+CtKGivf6iv8twt u2NErF0T+SwWSZn0ZFxak4Vy7+y3yzi23y/cy+WdOsr6tLUSCOY57lYFmIx1RutKUTCp ALjbGOJxorB+k97XV2a4uzfkGzyH0o04gEl5uQUUpRg695wy+VgxyCnplbjCkhdmrnMb tSMchwR0+c2/HYSSbLm3tkI4DWkjsazL8sd8w4bXIJpXzpcPc3LMQkIZ2zxcZKtNqXEA QX9Mw4iuJfmP9zNh0nkRUCPUReuZVkQaiC3TZZRBGoRlnrvZgyKILcecqMIW+0eRgAX9 grtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=tBnar4EOBqUyAZ3eTgoIH+VVc0DkF/ERTYiHgxOAUMg=; b=c8LhZ9WN8JGy4sPF1wlQ3j4VR7kFDQ0iKBPa3RX3eQRqXfQV8SQwc1AHIvsrqJ9Gl/ taBLCOFe2SMeFu3g3CftOJHcDV4vhudqRjKSU2Cd+BLzUWSWmpvw+Tdbg+jWni+h8tV7 VKUrmUO4AwVbJNWdxg/8K6+7kHLUyJ5kXtaQh+noaaNcY5AfSm5GfKOeimyjI2NqwG2w kHN5+whNpjPzG3Ugeq/B+oijEFzUfRxdd8GAFuPtdCGRsZm4/egdcHbrqY6mDGLJI4Bu mNPhi8iQaq5xj0YrpkO24S2GDVv1c3mZEejMYZL8+2YOymm4s03LE2a3FSswQhcM6pqF scrw== X-Gm-Message-State: AOAM531AoZBWyz1PsAsqD9gZ3GzerEebH09EQLZnHCZ2sHMofJ+bbfbw AMZ3Zs/PXY43OpYUDHS5fXo= X-Google-Smtp-Source: ABdhPJxhFTIYlZQiGHofApKmES4ojOpP9cIJyfrcT0+gwKkK8YImq+k0vM2L9reQYhpLSHyE8uj1jQ== X-Received: by 2002:a7b:c24d:: with SMTP id b13mr17034601wmj.151.1607876247525; Sun, 13 Dec 2020 08:17:27 -0800 (PST) Received: from localhost.localdomain (188.red-81-44-87.dynamicip.rima-tde.net. [81.44.87.188]) by smtp.gmail.com with ESMTPSA id 64sm27102073wmd.12.2020.12.13.08.17.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Dec 2020 08:17:27 -0800 (PST) From: Sergio Paracuellos To: linus.walleij@linaro.org Cc: robh+dt@kernel.org, gregkh@linuxfoundation.org, yanaijie@huawei.com, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, devel@driverdev.osuosl.org, Dan Carpenter Subject: [PATCH 3/8] pinctrl: ralink: rt2880: return proper error code Date: Sun, 13 Dec 2020 17:17:16 +0100 Message-Id: <20201213161721.6514-4-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201213161721.6514-1-sergio.paracuellos@gmail.com> References: <20201213161721.6514-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Check for NULL shall return '-ENOMEM' instead of '-1'. Reported-by: Dan Carpenter Signed-off-by: Sergio Paracuellos --- drivers/pinctrl/ralink/pinctrl-rt2880.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pinctrl/ralink/pinctrl-rt2880.c b/drivers/pinctrl/ralink/pinctrl-rt2880.c index c933e1a1d4fa..6e0bf7c4837b 100644 --- a/drivers/pinctrl/ralink/pinctrl-rt2880.c +++ b/drivers/pinctrl/ralink/pinctrl-rt2880.c @@ -206,7 +206,7 @@ static int rt2880_pinmux_index(struct rt2880_priv *p) p->group_names = devm_kcalloc(p->dev, p->group_count, sizeof(char *), GFP_KERNEL); if (!p->group_names) - return -1; + return -ENOMEM; for (i = 0; i < p->group_count; i++) { p->group_names[i] = p->groups[i].name; From patchwork Sun Dec 13 16:17:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 343712 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 DD30AC4361B for ; Sun, 13 Dec 2020 16:18:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B4246233A0 for ; Sun, 13 Dec 2020 16:18:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404349AbgLMQSS (ORCPT ); Sun, 13 Dec 2020 11:18:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391144AbgLMQSK (ORCPT ); Sun, 13 Dec 2020 11:18:10 -0500 Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D71DBC061794; Sun, 13 Dec 2020 08:17:29 -0800 (PST) Received: by mail-wm1-x341.google.com with SMTP id g25so7607646wmh.1; Sun, 13 Dec 2020 08:17:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=14/39lqjLWy5D8ojS/4hZl9Olsf4TSz2SKrvUayrnRw=; b=AY6LlAAKxuWWJVitg9V9x8itqgp5ue823Dr3j6+y6801cBoiqE8xXbiyTxem2M/6RD 6HPqa90EPqElJfBkOzuPA6HRrohRfxBDSiQ3zN3R9bnsOmIK+3jex3R1L0iop9U/9MwJ m4L3iokWQfvkLkEmrqEU6n5Lr6e/WZMXAqoR9Q1Zxi1eoMlbV3woSiNKw0M7awpkvseS PCE/MJAIoMkbmAlTawzBzbCaeVmIOmBg+AwWvAYCnPF+1evIntGxOvQZuvrfNOpTXMZR I5MlZjA7gMKAs0IwCC1UFJtYKWJEHyrdioENnzQXY09Vj7jodjJU08jmUYzdizO53UxH DodA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=14/39lqjLWy5D8ojS/4hZl9Olsf4TSz2SKrvUayrnRw=; b=WqPczBOM83glvieua2a7/geSwNYaKWLcv6ughoTXY9pzutVV79IFVpuN0xKAhOQ0MX MZ5BVjaHZ6Jr5DUGXCS5sVt/bbOD01O3rH2fNmGDGWO4n7qsp/n4df7NgEsycyXqmRXd Y4BMCZATHDPn6eOK8g9uhuVnXfEqbO97bY9TH9AgXP8Gns4UuFvPZmEGhD07woI634me JU47eBKfD2107cojN0EM8x4TxStW3449iAShCBXc2+QKyYw50pQwK3emuF2ch1T3dtuJ hd72f5tLpRE+SxftYoa++zfzqHBDMoP6wsBO902obneN6E6+jtLEm9204xsm5OJPxsMV B/NA== X-Gm-Message-State: AOAM530XhMjeRIyPxxMi6YmrlJVAMrg4bOhFGOwRNP/2juBoB70TcgN/ 5nYMr1N0p6mU3VhIiZInU9c= X-Google-Smtp-Source: ABdhPJw7+qwxllgPeP+/Eke6WG9i5PxiacrgprRiq8iwFKUKEM60eIukF4H8XeXddBHTPQGc/okAEQ== X-Received: by 2002:a7b:cc90:: with SMTP id p16mr22712332wma.105.1607876248657; Sun, 13 Dec 2020 08:17:28 -0800 (PST) Received: from localhost.localdomain (188.red-81-44-87.dynamicip.rima-tde.net. [81.44.87.188]) by smtp.gmail.com with ESMTPSA id 64sm27102073wmd.12.2020.12.13.08.17.27 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Dec 2020 08:17:28 -0800 (PST) From: Sergio Paracuellos To: linus.walleij@linaro.org Cc: robh+dt@kernel.org, gregkh@linuxfoundation.org, yanaijie@huawei.com, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, devel@driverdev.osuosl.org, Dan Carpenter Subject: [PATCH 4/8] pinctrl: ralink: rt2880: add missing NULL check Date: Sun, 13 Dec 2020 17:17:17 +0100 Message-Id: <20201213161721.6514-5-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201213161721.6514-1-sergio.paracuellos@gmail.com> References: <20201213161721.6514-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Memory is being requested to the kernel but there is a missing check for NULL. Hence, add it. Reported-by: Dan Carpenter Signed-off-by: Sergio Paracuellos --- drivers/pinctrl/ralink/pinctrl-rt2880.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pinctrl/ralink/pinctrl-rt2880.c b/drivers/pinctrl/ralink/pinctrl-rt2880.c index 6e0bf7c4837b..3c3336b724ca 100644 --- a/drivers/pinctrl/ralink/pinctrl-rt2880.c +++ b/drivers/pinctrl/ralink/pinctrl-rt2880.c @@ -238,6 +238,8 @@ static int rt2880_pinmux_index(struct rt2880_priv *p) p->func[c] = &p->groups[i].func[j]; p->func[c]->groups = devm_kzalloc(p->dev, sizeof(int), GFP_KERNEL); + if (!p->func[c]->groups) + return -ENOMEM; p->func[c]->groups[0] = i; p->func[c]->group_count = 1; c++; From patchwork Sun Dec 13 16:17:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 343711 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 B1B12C1B0E3 for ; Sun, 13 Dec 2020 16:18:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9006C204EF for ; Sun, 13 Dec 2020 16:18:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404566AbgLMQSv (ORCPT ); Sun, 13 Dec 2020 11:18:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404401AbgLMQSt (ORCPT ); Sun, 13 Dec 2020 11:18:49 -0500 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01177C06179C; Sun, 13 Dec 2020 08:17:31 -0800 (PST) Received: by mail-wr1-x442.google.com with SMTP id w5so10250831wrm.11; Sun, 13 Dec 2020 08:17:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=d+qBYzhMTB1Wzp8xi32BRlc6s23LYHlnQSW4DIZrTQE=; b=ZEIbaQwK4Eg+4j8a01m4Enb6LHDVS2HC/cI7yynOS9U2GqeZfdNYe26GdbmYgDa8EN UYBnO937i/xRSXVo8WGE9qZMn7eKdwRLB/qPLQ4v6oI8K1mXrkcGE+hSnZ4dzd7u+8qN r7CdiNX2SF+gL/ztuE4+I7qYctMD7XYEUYa0yZksUDG9sZnaEIx0rcZnENezTCfgvXnJ RUIIMds0Hx1wbzkrtcNW0q2Nc2IKH+H4ab9t0uHKSVbPMXMGlEkEVPRQXFOrRDZvHGbw yGeEuBgw3wAZw3A/qLzSfrTbBONIDs+2tZiu5zy5rHH7t7Ouv6G3AjgCNr58XJd39PdB 2ejQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=d+qBYzhMTB1Wzp8xi32BRlc6s23LYHlnQSW4DIZrTQE=; b=kVgdry4pIVfpx4JzUU3/NsT4u8ohskDY82vMYOywal8YwUVqgac53XipI0f7EMhxo7 z6XKQHjgGSuPpEYa1QtSjwgxHQ3EUxc2ORziY4lrFm5AZYYIJD90jNyYLFhpiPvWwulQ KZRUxR8DSBrXIRHnoDwnqwKei74yuEupuMB0qmfhLPROkJj77ygWtsjR8vMtWrVTI6Cm GU5eOVpU9IgaaviFsjivf1NzgHaNbyNPFUKOdoWFQ9/sheOm8nIlOylKXGHUv3ULGo0j zXabXooUuI0bPDM04E2s10ghuKwqu+JLlpUiOpBfvpjFq0+McDwosmHMkLh4eUtxfE/q POEQ== X-Gm-Message-State: AOAM531T4riAYGsApVl/Fsf2Fv6XtTMklgGe/lYXd2aAHKVSD6Zu//Ad XsPhBm/+lqhfx+NdnyFq+bI= X-Google-Smtp-Source: ABdhPJyvY3ww7ODL0QierPoakFmNPsYRid6N4+4QjmL2PI8Bb4wlecxAnlQjp8AZ11Ms1rSaPEKjRw== X-Received: by 2002:adf:a3ca:: with SMTP id m10mr24759846wrb.228.1607876249739; Sun, 13 Dec 2020 08:17:29 -0800 (PST) Received: from localhost.localdomain (188.red-81-44-87.dynamicip.rima-tde.net. [81.44.87.188]) by smtp.gmail.com with ESMTPSA id 64sm27102073wmd.12.2020.12.13.08.17.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Dec 2020 08:17:29 -0800 (PST) From: Sergio Paracuellos To: linus.walleij@linaro.org Cc: robh+dt@kernel.org, gregkh@linuxfoundation.org, yanaijie@huawei.com, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, devel@driverdev.osuosl.org, Dan Carpenter Subject: [PATCH 5/8] pinctrl: ralink: rt2880: delete not needed error message Date: Sun, 13 Dec 2020 17:17:18 +0100 Message-Id: <20201213161721.6514-6-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201213161721.6514-1-sergio.paracuellos@gmail.com> References: <20201213161721.6514-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org When '-ENOMEM' is returned there is not need at all to add custom error messages. Hence delete it. Reported-by: Dan Carpenter Signed-off-by: Sergio Paracuellos --- drivers/pinctrl/ralink/pinctrl-rt2880.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pinctrl/ralink/pinctrl-rt2880.c b/drivers/pinctrl/ralink/pinctrl-rt2880.c index 3c3336b724ca..4725aa34328a 100644 --- a/drivers/pinctrl/ralink/pinctrl-rt2880.c +++ b/drivers/pinctrl/ralink/pinctrl-rt2880.c @@ -279,10 +279,8 @@ static int rt2880_pinmux_pins(struct rt2880_priv *p) /* the pads needed to tell pinctrl about our pins */ p->pads = devm_kcalloc(p->dev, p->max_pins, sizeof(struct pinctrl_pin_desc), GFP_KERNEL); - if (!p->pads || !p->gpio) { - dev_err(p->dev, "Failed to allocate gpio data\n"); + if (!p->pads || !p->gpio) return -ENOMEM; - } memset(p->gpio, 1, sizeof(u8) * p->max_pins); for (i = 0; i < p->func_count; i++) { From patchwork Sun Dec 13 16:17:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 343710 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 0ACE9C2BBCA for ; Sun, 13 Dec 2020 16:18:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CFC85233F6 for ; Sun, 13 Dec 2020 16:18:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404701AbgLMQSv (ORCPT ); Sun, 13 Dec 2020 11:18:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404226AbgLMQSt (ORCPT ); Sun, 13 Dec 2020 11:18:49 -0500 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3107C0617A6; Sun, 13 Dec 2020 08:17:31 -0800 (PST) Received: by mail-wm1-x344.google.com with SMTP id k10so11614291wmi.3; Sun, 13 Dec 2020 08:17:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=w9VFIJdHj+SJxF4z+WgbqJ8x7eNPsM9DBQcH2wJnArM=; b=DgvvQc0NAh1OKOf+xsxZRjBpmVYIChLVpTygScao4JsyKQZOXnJ995flh2Z2WHhXjS VU/iMisOaB4SSkMVJ64YnxbYHFcBhhgHnBSWQ0qBOqmg64ucF0sTz89qTDee+v3/FwiT WuoMfkWSGEz8J5H4wSIBSk9rnCtdBM/yH3U/TLLWJHV7PNnYKhWyd+qcr1s/l9zmK/sg RI7aD+YPTWWVZPrHNVa/GakA3b798KuLaSScKfbCCCB45BhFr/yBSMg7YcnX7MfUEvXd r6j/lDdOzcOf267FQjO2UJwx17Mp6zPsKm9bIvIeaozT50bW+fA4B/FbivMZQOQTaw/F UBIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=w9VFIJdHj+SJxF4z+WgbqJ8x7eNPsM9DBQcH2wJnArM=; b=JGMPzO/lsSDTtpRu6k+4Ss5v1bQ19dqoWhczrrUtiZvopTH8nTpa+q+z+5mYOHIT20 9AC6T7k+aGQNnH2OudkvLW4VxivEP+fq8ixeakxQDiHpHfWmETPtAYYLoknhZAYyzMqa +e80TUIWaJCp2uXgFhPPIrFe82d6kPwsOu7wnR+23oZl/yuKBFLs+7XgyDZwi9oeA8J4 QSg9MScyAnXc5dGoIxC6hpvvVZC1edzjMLPB3ZuP5e+TAUYmFkxFicEZU56w2OX1/2qj GiRri9r2yR/DI1AKie6znDTgbel2UsppE3aO3GYcau1WeQCuygqc7cDftuFm7WrvGmdN WhVQ== X-Gm-Message-State: AOAM530FP02qTKp2FgtbXGzbHXduie7ORmp3XmrUel1B+30sn2e9dJnf zuTIyfMHTYO5/Bs4+d2NwxU= X-Google-Smtp-Source: ABdhPJyTeWtycO/1IXRhvCbaw1614hdJtEa+J6vkyRpI4RbtVAsHskSG3As8u1WNf7N78Tpig7KSGw== X-Received: by 2002:a7b:c751:: with SMTP id w17mr23205450wmk.121.1607876250816; Sun, 13 Dec 2020 08:17:30 -0800 (PST) Received: from localhost.localdomain (188.red-81-44-87.dynamicip.rima-tde.net. [81.44.87.188]) by smtp.gmail.com with ESMTPSA id 64sm27102073wmd.12.2020.12.13.08.17.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Dec 2020 08:17:30 -0800 (PST) From: Sergio Paracuellos To: linus.walleij@linaro.org Cc: robh+dt@kernel.org, gregkh@linuxfoundation.org, yanaijie@huawei.com, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, devel@driverdev.osuosl.org, Dan Carpenter Subject: [PATCH 6/8] pinctrl: ralink: rt2880: preserve error codes Date: Sun, 13 Dec 2020 17:17:19 +0100 Message-Id: <20201213161721.6514-7-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201213161721.6514-1-sergio.paracuellos@gmail.com> References: <20201213161721.6514-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Some paths in probe function are returning '-EINVAL' instead of preserve original code from called functions. Change them to preserve all of them. Reported-by: Dan Carpenter Signed-off-by: Sergio Paracuellos --- drivers/pinctrl/ralink/pinctrl-rt2880.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/ralink/pinctrl-rt2880.c b/drivers/pinctrl/ralink/pinctrl-rt2880.c index 4725aa34328a..5af1c8a20322 100644 --- a/drivers/pinctrl/ralink/pinctrl-rt2880.c +++ b/drivers/pinctrl/ralink/pinctrl-rt2880.c @@ -315,6 +315,7 @@ static int rt2880_pinmux_probe(struct platform_device *pdev) { struct rt2880_priv *p; struct pinctrl_dev *dev; + int err; if (!rt2880_pinmux_data) return -ENOTSUPP; @@ -330,13 +331,16 @@ static int rt2880_pinmux_probe(struct platform_device *pdev) platform_set_drvdata(pdev, p); /* init the device */ - if (rt2880_pinmux_index(p)) { + err = rt2880_pinmux_index(p); + if (err) { dev_err(&pdev->dev, "failed to load index\n"); - return -EINVAL; + return err; } - if (rt2880_pinmux_pins(p)) { + + err = rt2880_pinmux_pins(p); + if (err) { dev_err(&pdev->dev, "failed to load pins\n"); - return -EINVAL; + return err; } dev = pinctrl_register(p->desc, &pdev->dev, p); if (IS_ERR(dev)) From patchwork Sun Dec 13 16:17:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 343374 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 2F278C433FE for ; Sun, 13 Dec 2020 16:18:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0A5D8233A0 for ; Sun, 13 Dec 2020 16:18:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404865AbgLMQSu (ORCPT ); Sun, 13 Dec 2020 11:18:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404566AbgLMQSt (ORCPT ); Sun, 13 Dec 2020 11:18:49 -0500 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B879C0617A7; Sun, 13 Dec 2020 08:17:33 -0800 (PST) Received: by mail-wr1-x441.google.com with SMTP id t16so13985333wra.3; Sun, 13 Dec 2020 08:17:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3TZb1oXr2CFfySaD0gQhDI23CCFyEFYHoaiVTmK47IU=; b=fSjuQqegVO2OnTO2KpRl8gXR23wJ0b9x5sI6nLyKMWm8wQqWJLwpm7J/o3N0PsF9gM P0IrEgBGIDUcfsA77w4gQb11yL79yeQ0v3Cabf3yppxl4PwirG+7w6P5l+bB4fzV/iiP 1glOboCcOUkGs4sNKEzP//eow5rkiD19sstzJQyDTnmELy66XPsKQoAjIw+IBODrFOLI O9B5U79RG8xNSojjteJKU8+WRVfISCOu1EWZdlv3hsvAvAO2LmmNJdsfQ00sBB1x0gBx opwmUNYrbFelHliABo8W0QM9/3hZaHmMyodW4KJ9RTAdrlwPaN+DJakFJXLU9s8+xGIf RJmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3TZb1oXr2CFfySaD0gQhDI23CCFyEFYHoaiVTmK47IU=; b=PUirzcViZxXvaUGmlfs9y4Unpthfnwp2abVKlu3mEx/LGAx0HYQvzI7C4Sl8WhCkTR I60ppiJ5RK0ocoX/4FWneaHHS/Cs4rxO8OveN4SbrykOOElNu+La59iH9ca/PcqHdyOh 1SOsXog9E6Aiek/AmNnXz9GBRqqYExf9lPC6ftOIpAMoNlZPtmzWsHM2dHIlZ0P8nrjI 7ZJHOTV5gA0Se/g0TNaqG7I4FJOhpW3JOoE3nRc5/m156QTu/F9PvGztZNMWM8+7DCVd Aj5c1dg8wEGSF8rCJ72DydNs0mgUYGVBpL3aKjkhBkxeKawh25G4ve6Cmak76pIOzaoT Pxpg== X-Gm-Message-State: AOAM533l5DOWZ+tUDpyWaR4UIQe5/K7tRFDLx/KhquqsD+M2Qc3g2Y/S hQZnPzgDknUsQyxOa2UR2NI0sVOa7L8= X-Google-Smtp-Source: ABdhPJz9L0Im5swqMG5cHeuSZzXmHd5yDHRImptEViZ08Hl/+enm94hZujAc0lmCHqupqDdviczkbw== X-Received: by 2002:adf:ef06:: with SMTP id e6mr17984953wro.231.1607876251826; Sun, 13 Dec 2020 08:17:31 -0800 (PST) Received: from localhost.localdomain (188.red-81-44-87.dynamicip.rima-tde.net. [81.44.87.188]) by smtp.gmail.com with ESMTPSA id 64sm27102073wmd.12.2020.12.13.08.17.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Dec 2020 08:17:31 -0800 (PST) From: Sergio Paracuellos To: linus.walleij@linaro.org Cc: robh+dt@kernel.org, gregkh@linuxfoundation.org, yanaijie@huawei.com, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, devel@driverdev.osuosl.org Subject: [PATCH 7/8] pinctrl: ralink: rt2880: use 'PTR_ERR_OR_ZERO' Date: Sun, 13 Dec 2020 17:17:20 +0100 Message-Id: <20201213161721.6514-8-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201213161721.6514-1-sergio.paracuellos@gmail.com> References: <20201213161721.6514-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Avoid some boilerplate code using 'PTR_ERR_OR_ZERO' in probe function. Signed-off-by: Sergio Paracuellos --- drivers/pinctrl/ralink/pinctrl-rt2880.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/pinctrl/ralink/pinctrl-rt2880.c b/drivers/pinctrl/ralink/pinctrl-rt2880.c index 5af1c8a20322..983da62ff3be 100644 --- a/drivers/pinctrl/ralink/pinctrl-rt2880.c +++ b/drivers/pinctrl/ralink/pinctrl-rt2880.c @@ -343,10 +343,8 @@ static int rt2880_pinmux_probe(struct platform_device *pdev) return err; } dev = pinctrl_register(p->desc, &pdev->dev, p); - if (IS_ERR(dev)) - return PTR_ERR(dev); - return 0; + return PTR_ERR_OR_ZERO(dev); } static const struct of_device_id rt2880_pinmux_match[] = { From patchwork Sun Dec 13 16:17:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergio Paracuellos X-Patchwork-Id: 343373 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 7963DC4167B for ; Sun, 13 Dec 2020 16:18:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 523ED23380 for ; Sun, 13 Dec 2020 16:18:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388730AbgLMQSu (ORCPT ); Sun, 13 Dec 2020 11:18:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404701AbgLMQSt (ORCPT ); Sun, 13 Dec 2020 11:18:49 -0500 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E1FDC0617B0; Sun, 13 Dec 2020 08:17:34 -0800 (PST) Received: by mail-wr1-x444.google.com with SMTP id w5so10250900wrm.11; Sun, 13 Dec 2020 08:17:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=X/SjzDMsmOBxksRB2/nR67BPPBDrp7yLu8jvVQSPdRA=; b=RA9YPVDPP+Hlea2+CoCov3pCGvBJPPAI//vWwsri9yIDoXMxCPFwqlm6aDUA2tO5C2 bbs/pBFtoOssukMSlk+7pNsbfJJEnm8M2sC0hWQs3hFZGgb5GTq3rlSIvtcp/dg+oo1G lchDa25ZOzl5UcvMKgN6pSH4FkRYFQER+22/5YbSv/PtsN4qAHnezkQHLWsEaOO8McL/ CEHY0YkOqBdy9bBZMNVBFK6VthIvIC8paW39UGvpmOJVE1WOrgKrE8ZGuqdZTwFeyfXN um/36355ECTDo1cnex8yxgAPttwXkzCmXrLAHG7xZoIg8PBNJ0W7AP+rJkinQO5Nl7kh 5iMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=X/SjzDMsmOBxksRB2/nR67BPPBDrp7yLu8jvVQSPdRA=; b=WpWTUaKG1JIakM7NfNe70IrHIXyA8EsVnytfHIimjpyZEXW8OUmfafMVI7KHqqaqen nT6BK8M6YT/2nWA0+3eXqBoks2qfDzVH3WHBP70RvH1o8quKojQiSwZpSCGD18yBLbk9 itxHi8mnYpuHqKGDMYXwfqbS08eAeriyHZmC8/NjB+UtDuTYVekU/ML9YTC2LOZddxeo BNZGFCUZRW3f8IUOkVBon6sKPbzfg6JjnLQ9NQxrlklqm0OdagANDwfrIs8MrfiYS4cS WnUGMp2ej1BnPWnno5NS90UnC39/4k1zO73TeNwe/Bwqjk/yl8DcSGOOqDqdzLTjsOI8 PcIA== X-Gm-Message-State: AOAM532fiNqI1JuMUlQqhe/fsmMLwxeqBaG831UXOLPWOKeZacEZlQEQ Kwf3XZzYDe3pbLN71YGXsD8= X-Google-Smtp-Source: ABdhPJyJqmj0HNzc2fwOmoYbmupN0wZjJVWhHfjcFkpjkCTKKiJrRTgN6MXYcDkwVAPecugXOEcpeg== X-Received: by 2002:a5d:5704:: with SMTP id a4mr13108334wrv.37.1607876252873; Sun, 13 Dec 2020 08:17:32 -0800 (PST) Received: from localhost.localdomain (188.red-81-44-87.dynamicip.rima-tde.net. [81.44.87.188]) by smtp.gmail.com with ESMTPSA id 64sm27102073wmd.12.2020.12.13.08.17.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 13 Dec 2020 08:17:32 -0800 (PST) From: Sergio Paracuellos To: linus.walleij@linaro.org Cc: robh+dt@kernel.org, gregkh@linuxfoundation.org, yanaijie@huawei.com, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, devel@driverdev.osuosl.org Subject: [PATCH 8/8] staging: mt7621-dts: properly name pinctrl related nodes Date: Sun, 13 Dec 2020 17:17:21 +0100 Message-Id: <20201213161721.6514-9-sergio.paracuellos@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201213161721.6514-1-sergio.paracuellos@gmail.com> References: <20201213161721.6514-1-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org According to the binding documentation pinctrl related nodes must use '-pins$' and ''^(.*-)?pinmux$'' as names. Change all of them to properly match them. Signed-off-by: Sergio Paracuellos --- drivers/staging/mt7621-dts/mt7621.dtsi | 46 +++++++++++++------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/drivers/staging/mt7621-dts/mt7621.dtsi b/drivers/staging/mt7621-dts/mt7621.dtsi index 5b9d3bf82cb1..f05b7dec703b 100644 --- a/drivers/staging/mt7621-dts/mt7621.dtsi +++ b/drivers/staging/mt7621-dts/mt7621.dtsi @@ -228,83 +228,83 @@ pinctrl: pinctrl { state_default: pinctrl0 { }; - i2c_pins: i2c0 { - i2c0 { + i2c_pins: i2c0-pins { + pinmux { groups = "i2c"; function = "i2c"; }; }; - spi_pins: spi0 { - spi0 { + spi_pins: spi0-pins { + pinmux { groups = "spi"; function = "spi"; }; }; - uart1_pins: uart1 { - uart1 { + uart1_pins: uart1-pins { + pinmux { groups = "uart1"; function = "uart1"; }; }; - uart2_pins: uart2 { - uart2 { + uart2_pins: uart2-pins { + pinmux { groups = "uart2"; function = "uart2"; }; }; - uart3_pins: uart3 { - uart3 { + uart3_pins: uart3-pins { + pinmux { groups = "uart3"; function = "uart3"; }; }; - rgmii1_pins: rgmii1 { - rgmii1 { + rgmii1_pins: rgmii1-pins { + pinmux { groups = "rgmii1"; function = "rgmii1"; }; }; - rgmii2_pins: rgmii2 { - rgmii2 { + rgmii2_pins: rgmii2-pins { + pinmux { groups = "rgmii2"; function = "rgmii2"; }; }; - mdio_pins: mdio0 { - mdio0 { + mdio_pins: mdio0-pins { + pinmux { groups = "mdio"; function = "mdio"; }; }; - pcie_pins: pcie0 { - pcie0 { + pcie_pins: pcie0-pins { + pinmux { groups = "pcie"; function = "gpio"; }; }; - nand_pins: nand0 { - spi-nand { + nand_pins: nand0-pins { + spi-pinmux { groups = "spi"; function = "nand1"; }; - sdhci-nand { + sdhci-pinmux { groups = "sdhci"; function = "nand2"; }; }; - sdhci_pins: sdhci0 { - sdhci0 { + sdhci_pins: sdhci0-pins { + pinmux { groups = "sdhci"; function = "sdhci"; };