Message ID | 20230320163823.886-1-clin@suse.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1331145wrt; Mon, 20 Mar 2023 10:11:35 -0700 (PDT) X-Google-Smtp-Source: AK7set8fXzLXXbNF3i1QKMuJeVg22roVk6gXfmm1YN6iJUGKKmSX43nWW7iWWF6ync4+5uG3XZ+C X-Received: by 2002:aa7:9afa:0:b0:625:ff85:21ec with SMTP id y26-20020aa79afa000000b00625ff8521ecmr14719075pfp.26.1679332295034; Mon, 20 Mar 2023 10:11:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1679332295; cv=pass; d=google.com; s=arc-20160816; b=DAQLgciFq5ftcKaUpxZmbM7i+F8czChUbwh38h2K2npa8EL4ctINXs6yn2SEASg0+S PkkutSOxDv/3Dd5x5ppMiwykGuZjbhJuKaNesSrxWtSJbi2mTg69uQHqza6A393m5/GO ZNa1exUWb4p2HDjBiy8BEbOD0gp0bTS97hcnrYij/j/+K9L4i1IY56Eo+GvkyhY0I7yM 5w3lx1YkJrMRJt+QvwBRZm63JnNf8bSCXX+B33b+ne0ECVtGyf+ZC2b7ZBIglrqczvs8 +NM2nPeC3MI3GeFHSS9LKKsddtdQR2MAlPY9fENEhhtYyRTlO8gCND6RpZkge3dSBJ89 10ww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=L1/lYKx6XJlKCa/VMlUTkuQqNZkUu7AuS0U48aEisBI=; b=FxuyKlwEy5EL/p660Yc6fRZH+Rwr9v9ywGNmS0vpOCI8OQRy8kLwWJxoHKLaPWfuo+ 9pJZ0h/HBJ9JBwacegeuy7ajixtNTt4X+MK+wd0TDp2ORIYPj9XT5+noTrNRECOUoQ6R FT1hKa+sN0Gl7VXVYseoqI8B8Pu5+V1KVCcejOfv6e6jEi1V3OjRs3Fiwy7EH9KfIRYj JSRftIAi1/6J6RyX4+fDRtnSMW6mF9533zqXr9enMSfxmAq9Q4JWVXz3Y4dI8Egce5jP TQyGIfmcN3BdoAOxv0bFNTC6fugOkqya+FTl/mAUEuIIZJ8FL9obLW0a+tQk5bHZIdFm TkWA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b=grA8k6Vc; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k10-20020a63ff0a000000b0050be5c0b5e9si10696523pgi.514.2023.03.20.10.11.22; Mon, 20 Mar 2023 10:11:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=selector1 header.b=grA8k6Vc; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232411AbjCTQqF (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Mon, 20 Mar 2023 12:46:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232565AbjCTQot (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 20 Mar 2023 12:44:49 -0400 Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2086.outbound.protection.outlook.com [40.107.21.86]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0080529435; Mon, 20 Mar 2023 09:39:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RapuTTW+Hhi64S2uTqoksFuy685cbgvdBbKfVerV0iG/d9gLmPsXhIrz6gyd1+aoEA3rHVG2YDAIoCaS2kuK1Zhf37dfI3u1B5WKnedfY6DCJHMrgMBsO3oZD2G4nKbjW/cMK+bC7jDsnttACx/KpkVwogiueVlIGflKZbEGlSyB93rjYkldmVH+jqePlJY/OF9H/Py1pXyXYIXzFTxsYxjhGEaYhEyZszitSYci478403rhgcKn/JYNc0U64zu6hdwgN+gis6BYPJGHiv/5Ju+IPe4w4UWv/X2wO0Ihqy4Oxrt+MfCnlN31Epbr+TFrp7vIOlKkGVveiOxXZj93ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=L1/lYKx6XJlKCa/VMlUTkuQqNZkUu7AuS0U48aEisBI=; b=J0s6XU1iAUEBPnlW6yCPA0k1caCuE5k347STV+wGIbhN8cZCSOUknZhgZzLS2qQtMEpWVggTljsGv4REYLDNi6I4fKqdHfvqA/giuPQRR0FtpfdeDMDIFI2s+XSGfLnXn5OgLKmWTTo3psQojBLoQeb2jIjG7foJCK95NYgiQsqnVTJjKE1JJ2T4RMXnqBbiLiuqm2BEK4WOqspq/tpbwaAcIePEx5demuWiCGSgahmNgfZu5TIEMKlGP+ONT8qFLHjtNKakvrSPZ4ceurGIkrh43PqZTcfEDRLwIy88rWop9dAdHT66mp9QNyG4f9R+MPJGnLEZskOvFVqaslYYfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=L1/lYKx6XJlKCa/VMlUTkuQqNZkUu7AuS0U48aEisBI=; b=grA8k6Vc2DQREEu2WWlf6tczYZT4fbjXFvGneQWpHvLOBab+LOGC6bAp6ICY5xsbrUj3vWSHssf3IagKoowUaO8v2yH7zG2+luqIJShsVD4FHdyUz8+cM0HdcYa/GjeFhcZ0wkySe5rFaRFlT3HlsSrOlYsBGmTrnJGcNnNvOeD5cIiAHhMYrQ4FldZJUodPEgYrVKjDeqsy9LViu6xXUDs+aDcNw5Q88TVwbzqPv9KED0JKRwNOvVHqHELrD9kx869QHfwQGZVo3dk0MAofCrjLh6CWdQxdKowFmjAznlddd75LnZzMx+ihba+Rlb0T62+MdnY6vXgcnKDlWquv7Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Received: from VI1PR0402MB3439.eurprd04.prod.outlook.com (2603:10a6:803:4::13) by DU0PR04MB9274.eurprd04.prod.outlook.com (2603:10a6:10:355::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.37; Mon, 20 Mar 2023 16:38:53 +0000 Received: from VI1PR0402MB3439.eurprd04.prod.outlook.com ([fe80::6802:b2c3:5f12:8f9f]) by VI1PR0402MB3439.eurprd04.prod.outlook.com ([fe80::6802:b2c3:5f12:8f9f%2]) with mapi id 15.20.6178.037; Mon, 20 Mar 2023 16:38:53 +0000 From: Chester Lin <clin@suse.com> To: Linus Walleij <linus.walleij@linaro.org>, Andy Shevchenko <andy.shevchenko@gmail.com> Cc: Chester Lin <clin@suse.com>, NXP S32 Linux Team <s32@nxp.com>, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ghennadi Procopciuc <Ghennadi.Procopciuc@oss.nxp.com>, Andrei Stefanescu <andrei.stefanescu@nxp.com>, Radu Pirea <radu-nicolae.pirea@nxp.com>, =?utf-8?q?Andreas_F=C3=A4rber?= <afaerber@suse.de>, Matthias Brugger <mbrugger@suse.com> Subject: [PATCH v2 0/4] pinctrl: s32: driver improvements and generic struct use Date: Tue, 21 Mar 2023 00:38:19 +0800 Message-Id: <20230320163823.886-1-clin@suse.com> X-Mailer: git-send-email 2.37.3 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: TYCPR01CA0088.jpnprd01.prod.outlook.com (2603:1096:405:3::28) To VI1PR0402MB3439.eurprd04.prod.outlook.com (2603:10a6:803:4::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR0402MB3439:EE_|DU0PR04MB9274:EE_ X-MS-Office365-Filtering-Correlation-Id: 1c9ab4c1-0ac6-4b31-7743-08db2961973e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EEBxv9LQBZS5aVm9pw0H6w6/LM4KjGwm758xA3bqzrCU00fwA422UVRTdEH8dFBoGpt19fGoimWhYg43lQKo+FLA63VDId1LojrU/smRkN5l9i+Yi/xoqDp8cKJhnLKheLhncLAvsshuz5/rFacZC9dZaQUFIUszynoP7Ksyp4iSOlbTcCc0oKsHdpugciTTfw0SnUawyisavNVxoLxDmaJJAySTfBZRgo1jQ9LHOfJvE0HqBoZ7qd+vEJQEM/lkFRQkycbfX2FXysRHYm1AaYoMYCK9lhi7rf13roGC4seY9dQl0aPD8AMMsu3jbUBSmfW3rGjQHgO7PdwQlMTrP8Uu76QULx9Xk8vL66pIIcrVFCWhUMPf9YKVXKilRVtTkFpwRBKZWVqttGdjdnFT+HFgOspZQ/hwWtb9mSGrVJRV5BCoLkoR29NAI8tdWCFzhSgTo2d5Fvy4NSsTLw9EUW/om9irDH4tDxBN7+Rv9BP1+o6LgmxrHA6l1BFEQGHRbsnJVRZqiT8b731J34PC5yH2RBQE0vBLvEB13Y4AKqz5RCFl+0nyD94INWty4xLgpNxCgJ15ttd7a3idmvuX+6miNeJjmRawhFrrBmxGXHY5xEsUi0TyV85pNvK4X6K8wPLL+9xmK2MJQ29HqLYUNoRB+5HP+RwiN8pslb/+4Dam/vyZv5XkDQZnQqlFFi5/ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR0402MB3439.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(366004)(396003)(136003)(346002)(39860400002)(376002)(451199018)(8936002)(5660300002)(7416002)(86362001)(38100700002)(2906002)(36756003)(4326008)(966005)(6486002)(83380400001)(478600001)(6666004)(107886003)(41300700001)(2616005)(186003)(1076003)(6512007)(26005)(6506007)(54906003)(110136005)(316002)(8676002)(66556008)(66476007)(66946007)(41533002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 0/JkugyoDtCHCy0Q3oNlK6KztS6jI7RHuEi+t8phK9NplEneLQeEmYKEPIj3scXVzkn+JeNvMp1vqK7L1GgKxKb64bhWAd1vUsmMYDZ5wNeyfxWqI4JzlWA7PIYoe8P/ljCVPJ6d4CM/Ytk4kzLSlZ7ys5yi+dYKaQxLmc2XB/rTL6PxpAOaERccH3ozSne4boPhEIxTAB9p0xNueWJ1T9iqO/jmZHurv3ptSVPoqozd1XZ/67IeQe717sYlmazQVhGLER+cuI3ZJRaHPB68NC9nbAQZ65kgutQrBCCfCmvha5ZIzx+e4TICF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Pe/0hlqPX5PDispNZNWtyE7W72kA1gPK5Ly9llNufcrq0kUcR0U91/4ufxmyBKD1cmjIbo++C4pNJq89eoGoLMIjGKERXqZz2DPfbk/sF0aYZMhp65tib2nlXLuadzNpPe5pdXu7poYfTn98FQ3y9KydzOPo2PFPl/eBS6oQtWVF2OnQ= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1c9ab4c1-0ac6-4b31-7743-08db2961973e X-MS-Exchange-CrossTenant-AuthSource: VI1PR0402MB3439.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Mar 2023 16:38:53.1892 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: N9V+sOZbR/xz2HXgnM/AAu0jFlMrUb8UebwC8jvODEFvmWbBhCldAlrLXRFD0fGR X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR04MB9274 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760907540267132873?= X-GMAIL-MSGID: =?utf-8?q?1760907540267132873?= |
Series |
pinctrl: s32: driver improvements and generic struct use
|
|
Message
Chester Lin
March 20, 2023, 4:38 p.m. UTC
Hello, This patch series contains some improvements for s32 pinctrl drivers suggested by upstream[1], such as - Fix error shadowings and improve return value handlings. - Fix print format. - Remove unnecessary blanks. - Use proper macros and helpers to simplify codes. - Refactor config param parsing and remove config arguments that are never used. - Use generic struct pingroup and struct pinfunction to describe pin data. Regards, Chester [1] https://lore.kernel.org/all/20230220023320.3499-1-clin@suse.com/ Changes in v2: - Use of_device_get_match_data() to get matched of_device_id data. - Enhance sizeof() arguments. - Fix blanks and remove unnecessary parentheses. - Drop unnecessary marcos and s32_pin_config() implemented in v1 and set/clear mask/config values transparently. - Put pull-function related cases together in s32_pin_set_pull(). - Simply use generic 'struct pinfunction' rather than having extra 'struct s32_pmx_func'. Chester Lin (4): pinctrl: s32: use of_device_get_match_data() to get device data pinctrl: s32: refine error/return/config checks and simplify driver codes pinctrl: s32cc: refactor pin config parsing pinctrl: s32cc: embed generic struct pingroup and pinfunction drivers/pinctrl/nxp/pinctrl-s32.h | 26 +-- drivers/pinctrl/nxp/pinctrl-s32cc.c | 261 +++++++++++++++------------- drivers/pinctrl/nxp/pinctrl-s32g2.c | 14 +- 3 files changed, 152 insertions(+), 149 deletions(-)
Comments
On Tue, Mar 21, 2023 at 7:09 AM Chester Lin <clin@suse.com> wrote: > On Mon, Mar 20, 2023 at 07:10:40PM +0200, Andy Shevchenko wrote: > > On Mon, Mar 20, 2023 at 6:39 PM Chester Lin <clin@suse.com> wrote: ... > > > for_each_child_of_node(np, child) { > > > - func->groups[i] = child->name; > > > + groups[i] = (char *)child->name; Here is also questionable casting. ... > > > + func->groups = (const char **)groups; > > > > Hmm... Why is casting needed? > > It's used for fulfilling the type checking done by kbuild otherwise an error will occur: > > drivers/pinctrl/nxp/pinctrl-s32cc.c:815:22: error: assignment to 'const char * const*' from incompatible pointer type 'char **' [-Werror=incompatible-pointer-types] > > In 'struct pinfunction', the member 'groups' is declared as (const char * const *). So, please decouple `struct pingroup` change to a separate patch and hence `struct pinfunction` on its own. After, consider changing types elsewhere that are following the types in that data structures.