Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1760312rda; Tue, 24 Oct 2023 02:20:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFRmqxGx47c48m+3JE3BehoSLLpStmKYbpGW2YXedbWIGricvzDDoDb9Q0VLYD7x0LFiJ5A X-Received: by 2002:a05:6359:3093:b0:168:e701:3f8 with SMTP id rg19-20020a056359309300b00168e70103f8mr3845917rwb.19.1698139226503; Tue, 24 Oct 2023 02:20:26 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1698139226; cv=pass; d=google.com; s=arc-20160816; b=f5cTbaN2xBNvlbteuXaQJe+vRzP+NUjjZa7fYwduBQWderxolvlO/OcZMf8OvRdV6q cdiT4iKbSpXLi2gw5W9UCQnqJ3WTpjtUrTATKWstcmaHfA6SlPBuBWHsV2r9uyxkjmbO C0S/e7TDTyJuR3kS3Kh6GAZZdrzGToCi6KzVqP7NCZBre9/4zOBqDx33iQgttO0G5mNc 1Q+MyI9uYYcMTKQIh65Cus7UC/ttdc6Q1zQ9+952IS/QcMmMcEUmrUs3LwO6HC/TADKG xGIYbhsBWe7WavqabT7yzdUy0bVUSsI9xXTYhzH0UFFiFgNTMcLqZVdERtVmP9KYJvdL mi/w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=x7wtrfbsKc8bs4rkzklPVNLCZo+WJAaOa1RF7VzaRmk=; fh=xWGWjMyLPzqTB4kkjEgh9hmZmuW91n+4F68QNJzZiWA=; b=UBQWrf6zaAFXPVNRx+ev3ew60IzNHE2RZom0OTGV4JJEil7d7WMzQkWNqkwkYinLRK yqGawCI0B3qoaXMhCMxnaa3q9NQberPa0gd4rMKpJqoEXeYoAKHRu1d7A6WD7SM1FcnO 0e/lRhjf5IXPH9EGB9hH7CrBB+PjYHpO1PYbkmL2gnUXdW8W3EPBUVRkZ/VGMJENsSKX W0BjZ7f9wzeyHgkQGMZ2G3HC5N7lFqVOZWFv0EusffZf4BqTZaQs9TuqhsKqSPKy1TVl jVawq4fvv+hARrluX4sBTp5cRlws2mOXFqF7v40rx3g6PhW72GZmiwyGwvjQyS5oNAbF asMg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=DTuoXhF+; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id c15-20020a63da0f000000b005a0737404a7si8485290pgh.258.2023.10.24.02.20.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 02:20:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=DTuoXhF+; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 1B26980B5A26; Tue, 24 Oct 2023 02:20:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233969AbjJXJUD (ORCPT + 99 others); Tue, 24 Oct 2023 05:20:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229906AbjJXJT7 (ORCPT ); Tue, 24 Oct 2023 05:19:59 -0400 Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2040.outbound.protection.outlook.com [40.107.20.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B155C12C for ; Tue, 24 Oct 2023 02:19:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QeX0+Eq89ZLojoyLCp8sqOOyc/GT9+2S2WN8xcUZ+AKolbQ0jtGQtSBABiaSrc7rcjkX+0vmF9ujRnZy/AACQcW+AKeRjL/o/TxpepEtxnh/wbPZOtbMXf4ifsgZc2NV/Oug2DZlz4NqBTMH2Oz2UmSphkmIDyxczR4rT0251v24Maqd8M1qr+PKVGUu5TBO7j05oiFEogpKmvWMmKMens61KA0A9vAAcp6eQRVNe2f+dd6FO4xHMp/2svphUS4m8UfvHj9hPuPopI7vvTb057y3A6Wm9q6CZ9cD5aoJSycT05taOkw6dDCDRwX6lgdS15IpckQodkbv/oVXHCZWnQ== 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=x7wtrfbsKc8bs4rkzklPVNLCZo+WJAaOa1RF7VzaRmk=; b=SvMotMwVSrcOVppHdnNM0Yud6s5XaoB8RGerhmKHj3m/zZJ70dz1kyzQguMjbVBJymy9NxZFwgotDEfCwa7tU1phivuTiB7FqoLNOxWfsopZJiFxihkbKrz+1kxCgKD13RcnIqlBEvgRjr2qHWnWhmjrDclIp87+B5ZJHMmbYNaiZWHl2EhRdnUOh1r4hKiF4AmwjnJ84q/TdQRaKmZqM2t2uj/Mxov/8DjXAt7LIG6hImnIQwIuSjarvJ0uXLGY8qdJbhc8W8prB6ikP3mf0NNo8208OwEwGyoUuvcg2sWdF3G/tzWAMsmtO+m0Vw+MY7P7vGSrM/qpOO8AO77UzA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x7wtrfbsKc8bs4rkzklPVNLCZo+WJAaOa1RF7VzaRmk=; b=DTuoXhF+kXaWFyTRnoWxPa4OepNNWaVJ0G9D8UPJOdaUYg9AxKnp8MccnuTnZ9+IC0SeORrWdesMTQFgUvZKBgpjF/0tJQNpepsdZ/oAPZ3V/rSD9sh1gut92zowpdhcW0M+tLykmtA87YLC1lRu9z6D+12jPHl8BBCkXCE66nk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) by DB9PR04MB9554.eurprd04.prod.outlook.com (2603:10a6:10:302::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.10; Tue, 24 Oct 2023 09:19:54 +0000 Received: from AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::7bdc:2d79:d746:11d2]) by AM0PR04MB6452.eurprd04.prod.outlook.com ([fe80::7bdc:2d79:d746:11d2%2]) with mapi id 15.20.6933.011; Tue, 24 Oct 2023 09:19:53 +0000 Date: Tue, 24 Oct 2023 12:19:49 +0300 From: Vladimir Oltean To: Rob Herring Cc: Thomas Gleixner , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] irqchip/ls-scfg-msi: Use device_get_match_data() Message-ID: <20231024091949.jqtlrieo3otbpyvp@skbuf> References: <20231020130255.2954415-3-robh@kernel.org> <20231020130255.2954415-3-robh@kernel.org> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231020130255.2954415-3-robh@kernel.org> <20231020130255.2954415-3-robh@kernel.org> X-ClientProxiedBy: FR0P281CA0076.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1e::6) To AM0PR04MB6452.eurprd04.prod.outlook.com (2603:10a6:208:16d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM0PR04MB6452:EE_|DB9PR04MB9554:EE_ X-MS-Office365-Filtering-Correlation-Id: 91c74f18-3e59-4be7-bca3-08dbd47261c1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bKWdkTbaQDenOZw6vypOJdkCHYY7XxTHp/BdLU9QyQHGSV9fcDxwbTVwLYldEgCuLhg6IOMOTdu3Rb298NaSYfpAZRlsfHeqjKnpnuIR52YNKqHsXA20URDH8JvM8nCA3uRKMflSLJS3txbwonel4WYazxFf/HcCBMnMSRY/MWAGb1F63YGCrIrY5sCRnfP49hc7e/sk5bdEEBFFfAL50HZHL70O7oGbgi4ERkgbjPB6D1XuWFAQBsZRE4UcQdI6lHldmStOZ9dsJFBWj0NXEbYIUacaHT4FCyu0A3ibbi3kbiwP/vxkTuyXiPQ4GVf/oW31x4KeWDzT11y4OreLeonnSLADJlTv8bI1AE1HyZkicCZpwRf+fFAsNidSRwycBa3TiCSaVMIzkvEXynhQPl5juUkMZGiU50E1WZFV85LfIcZ/K0G2CDGWwHcBPED+pDMWEPsIpdNyKXxCDIae3iqttWQrEb1tWcUYCBEifSeP2BahWxIwiC8ll7bvPeisjq5dSSEI40R469Sr0wj5WXWPW9svJh5E0rsSwD/ld5gGHYUyUhOwWt62A0D2qr+6 X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR04MB6452.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(7916004)(376002)(39860400002)(366004)(136003)(396003)(346002)(230922051799003)(64100799003)(451199024)(1800799009)(186009)(26005)(86362001)(1076003)(83380400001)(44832011)(9686003)(41300700001)(38100700002)(2906002)(6506007)(33716001)(6666004)(5660300002)(6486002)(478600001)(8676002)(8936002)(6512007)(66946007)(4326008)(66556008)(66476007)(6916009)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?17YRBpntPyb3LZRXPa1nGBNZxpHeLp6IMRLmK4hey0Z9kGI+wsMS0x7OOn6K?= =?us-ascii?Q?DQvNQLaz7wB6f36AvFTRXWVAYFvEKZ5SADETW57N2IMsT2uEWcSnb/4IQev3?= =?us-ascii?Q?bzoLt2f0gl0XmrYdvt7k9+cYsmvUPha5wq8dsr+xGMuUVvg8PmnnLRRVJS6a?= =?us-ascii?Q?hmYsAwmZDydXY2WNum4Sw+AG88ka/OkfwOFPhjWmnolQM/tbNWgGQ/AQlnYV?= =?us-ascii?Q?e7ApWxqBY1UxOn+LIwnFIepODri42vYAP3EpFcyT6TYWspp6sRcGwpyzsq/y?= =?us-ascii?Q?0Je9mwFkjpsZN4P4U9lbyOGkOCEAigSHwgJow8WuGWUDBTgt6VgzTj/ed4ac?= =?us-ascii?Q?x4Ou99UCZ/EKB1QcL6W3hmij/EZnHn9S2WmVV0ySQFNMQLtmRog4aVJaa78X?= =?us-ascii?Q?P3HCSBb7qPK3GbnRl+Qcv1jgpfT6XmdytOqD2ea0R73gWTlqoR7DHE9CEKoN?= =?us-ascii?Q?jawlIvV0OKZsJZC00V0oXPRfL4f8CmmNjhWwk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VCcqZ2T92PSr/GmkrDERM+IphCXlBf7ihZwGad7dINDHCCi?= =?us-ascii?Q?4ReXT3aKTKzs1oPwyXaU3FXUey6We2SWbAfn2VdzT+45jn0XnuOHqhUrWPdb?= =?us-ascii?Q?C2/eskDTCXTYxJHTq815amzYDPUcvD+Yo9dbUKx5pe798T+CbDTn3pyksW/u?= =?us-ascii?Q?b/L9vkrKyyM02/ByZwd82V4UTBPLsPPM63zPHZVmD7fH5jzCGMo7XD5h1XtC?= =?us-ascii?Q?uQ=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91c74f18-3e59-4be7-bca3-08dbd47261c1 X-MS-Exchange-CrossTenant-AuthSource: AM0PR04MB6452.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Oct 2023 09:19:53.9015 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: dZIIgqPGzuWvcEjyFvVb/8BTzPPrPaycQ6FTtMrHIbdlQGCD7FTx1WkSDAhWLhGtA4SjEKKJR5e+PexrF70Mmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB9554 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 24 Oct 2023 02:20:24 -0700 (PDT) On Fri, Oct 20, 2023 at 08:02:56AM -0500, Rob Herring wrote: > Use preferred device_get_match_data() instead of of_match_device() to > get the driver match data in a single step without the unnecessary > intermediate match pointer. With this, adjust the includes to > explicitly include the correct headers. That also serves as > preparation to remove implicit includes within the DT headers. > of_platform.h currently includes platform_device.h among others. > > Signed-off-by: Rob Herring > --- Reviewed-by: Vladimir Oltean Tested-by: Vladimir Oltean > v2: > - Expand commit message > --- > drivers/irqchip/irq-ls-scfg-msi.c | 12 +++++------- > 1 file changed, 5 insertions(+), 7 deletions(-) > > diff --git a/drivers/irqchip/irq-ls-scfg-msi.c b/drivers/irqchip/irq-ls-scfg-msi.c > index f31a262fe438..15cf80b46322 100644 > --- a/drivers/irqchip/irq-ls-scfg-msi.c > +++ b/drivers/irqchip/irq-ls-scfg-msi.c > @@ -17,7 +17,8 @@ > #include > #include > #include > -#include > +#include > +#include > #include > > #define MSI_IRQS_PER_MSIR 32 > @@ -334,20 +335,17 @@ MODULE_DEVICE_TABLE(of, ls_scfg_msi_id); > > static int ls_scfg_msi_probe(struct platform_device *pdev) > { > - const struct of_device_id *match; > struct ls_scfg_msi *msi_data; > struct resource *res; > int i, ret; > > - match = of_match_device(ls_scfg_msi_id, &pdev->dev); > - if (!match) > - return -ENODEV; > - > msi_data = devm_kzalloc(&pdev->dev, sizeof(*msi_data), GFP_KERNEL); > if (!msi_data) > return -ENOMEM; > > - msi_data->cfg = (struct ls_scfg_msi_cfg *) match->data; > + msi_data->cfg = (struct ls_scfg_msi_cfg *)device_get_match_data(&pdev->dev); I wanted to suggest to drop the unnecessary cast of the void pointer. But the driver keeps msi_data->cfg as a non-const pointer, and that causes a warning that is otherwise suppressed by this cast. So eliminating the type cast and keeping "cfg" as const is definitely a separate change. > + if (!msi_data->cfg) > + return -ENODEV; > > msi_data->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &res); > if (IS_ERR(msi_data->regs)) { > -- > 2.42.0 >