Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp497397iol; Sat, 11 Jun 2022 09:23:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzpMx5kA6+8uDtjD2f6bAywkNM0QRqKiYT+yqCN66k7OojII60K+4MxORRCrj6VI4pjrPOP X-Received: by 2002:a17:907:3f0a:b0:711:f0e2:ad67 with SMTP id hq10-20020a1709073f0a00b00711f0e2ad67mr18413110ejc.277.1654964635611; Sat, 11 Jun 2022 09:23:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1654964635; cv=pass; d=google.com; s=arc-20160816; b=vYxu7aNomM/ftCrM0ZwrGW9NsaiM+argkVmxRKU6NAWAl1ld5zXbKd1DxvZWRIEh61 9T6tBU7+aFD9/Jk3DS0dnbOy3AhduJaX4E4U1LYqs+gyUEetmc7y7Vt712PGxU/okJ/T Us+D0l67heETGBDNUH/nM4lxhHCvdVn4OkIgcgAClgvuTb+YA2Y0ahnhrDp+H/UibQuZ 2G/an1e8NUll17AHCX3J8eWA9wBOZdRKkuxXjY4DBh5znbKKDOrzprofUQgOb45CzqiG pS5INTnaB6Rcu33jaIK6F9azmGM4nGKpNGtHMJggdB5FBdO6fcscCveuQOamJF4E3nSL 6XEg== 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=cLHZhUEIzuAYAOI0Ibo95vqLwXIRj3ddyThO4VlhG4c=; b=0WlLZ8r2JZETBmo0FBngI40dfjqweA7PTIYhuuudAEbncTxA4/1JSy+V4GdGadX//6 UTH9Mdoq+i+KUGXgZzxt23iEK4EoAs33PvSwm1DLjcI6/uEXurrbWJl8pQgTRF+Voxjt EtESx0Fd8ied8g1g09vMIEKXr+Ehj0LrfqTnnCz9yq2qTiHTTWNqPpSwfOzfimScXpzY e+qZAIj4zIueaSSS8w0J1uqu6ULsx2Lwi2XSL0y/VcJAJ9axExYr//7ZePhtvYDTB4RR ODdBmcrSO/J1+KA0g2bQD4PMJ0PaSK3Z7rbhLmXO+voVNmbq2qW7q1drkgogJJBuulkA 2ZfQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=NrW5pofm; arc=pass (i=1 spf=pass spfdomain=in-advantage.com dkim=pass dkdomain=in-advantage.com dmarc=pass fromdomain=in-advantage.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=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e26-20020a170906081a00b006fefea3ec2fsi2323074ejd.72.2022.06.11.09.23.30; Sat, 11 Jun 2022 09:23:55 -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=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=NrW5pofm; arc=pass (i=1 spf=pass spfdomain=in-advantage.com dkim=pass dkdomain=in-advantage.com dmarc=pass fromdomain=in-advantage.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=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238996AbiFKPxu (ORCPT + 99 others); Sat, 11 Jun 2022 11:53:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233786AbiFKPxs (ORCPT ); Sat, 11 Jun 2022 11:53:48 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2100.outbound.protection.outlook.com [40.107.243.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7E43F184; Sat, 11 Jun 2022 08:53:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LiI+ma8ksNZGvO5LhydVkyuZ0CgofIwcI2NaYysAjd7fEOdeTRkl/JxQVhcDAQb9cLezAR3cttH1Xbhw6JR3QkPba2gqxIia9hR2DLcvKW+2WRkrkirSKvt6MMRWCEFimXRiqalg+vtDOffuMWBK0NlLULwyrCA3LjQ5Gyid4FFkWX2cuJaR+FJMyOJ52MEZK+kAB91C08KTEgcNYyuLjjz5Mpig6kggq85dsU7mvS2q4XH9nDytxusr3AKmfyPdTZiKVm5H8yHL7A0i6ubBBw+hgdbGqrFEHxRAFzEBP+DMslN/wUusR+3UR/ZJymE8VWIN178XOecpmoB/+R0CUA== 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=cLHZhUEIzuAYAOI0Ibo95vqLwXIRj3ddyThO4VlhG4c=; b=ETtOzfxMB0D0UGMFkC3tWJe5q8uAcLcvi8uxfvJQmbnWRyy3vuITzvwS0hj65ZLAhjCvahLL78cLGgWgP3iGIYUUFB/L8UGrwYAJ1FnO8j6OAhq1qVPmreGLX5E1e0FVoL5JeN5LCM3kag52/Ors4XswiBiD13S099japLxL4cEodu/JpS1wB2S3avnyr8doPd+ICHmYsHAHkdomtDgAczQquDmJpaJqHTfw9shZG8l1wSU5PWiDr+5ssr2C6iUPRm0mfHsLoacjA1hjhfExZb8uWOXl1SDaKjeAdvk36RF8QGUkW8QxmuPRcA7Nxwj7da2rv7TSTvzgz4/ssaQEew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cLHZhUEIzuAYAOI0Ibo95vqLwXIRj3ddyThO4VlhG4c=; b=NrW5pofmc2vajMuoJdI9HkNMSDXAS2Rr2FNiO52WJpUBb1qeh6S/YUuJu8uwklJaWP1fLlKMGAJucXHkftftytmURUdLAGcLjABdvLnpfzaZxjGuJbiHUK6zIOGkfQe3FV6SBoCoMaAq6iH1FWnPWBdGxTfScJORXYOJZrPX+t0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by BY5PR10MB4145.namprd10.prod.outlook.com (2603:10b6:a03:208::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.15; Sat, 11 Jun 2022 15:53:43 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::b8c0:76a2:4c89:d10f]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::b8c0:76a2:4c89:d10f%7]) with mapi id 15.20.5332.014; Sat, 11 Jun 2022 15:53:43 +0000 Date: Sat, 11 Jun 2022 08:53:34 -0700 From: Colin Foster To: Andy Shevchenko Cc: devicetree , Linux Kernel Mailing List , netdev , linux-arm Mailing List , "open list:GPIO SUBSYSTEM" , Vladimir Oltean , Lee Jones , Rob Herring , Krzysztof Kozlowski , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lars Povlsen , Steen Hegelund , Microchip Linux Driver Support , Linus Walleij , Wolfram Sang , Terry Bowman Subject: Re: [PATCH v9 net-next 1/7] mfd: ocelot: add helper to get regmap from a resource Message-ID: <20220611155334.GA848433@euler> References: <20220610175655.776153-1-colin.foster@in-advantage.com> <20220610175655.776153-2-colin.foster@in-advantage.com> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: MWHPR19CA0067.namprd19.prod.outlook.com (2603:10b6:300:94::29) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 091398dd-4339-4cb4-94d7-08da4bc28f7a X-MS-TrafficTypeDiagnostic: BY5PR10MB4145:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vT8T+e1dWhLc9ER9hdnNEMntWyJO0R1LTApZUHwvsMg+29uB4VI8kB3EjJ+lDBmvhFOpYAazIHniCUcQ0HUNVkZYAfmUUHQCengu6O5EWPSHnJAXxsUefAgoujtLr0x2PJ1I3B4oqbdgGJKL60Poh24xTVBax9vMlIW53UxTPSXZFr80EBbYHL8BlD+hxp28wkv7IBPtXLAwfl82IrSEtIwiPFmykxpqQt3QImhK9FbI5F07i/YAbmfuMu/R/EVB5Akh9zhc+nJeo8SPoldXhQl6Yc0cY7ejgNhYeM/q8BCTpgrwR+U3pm4z2PQrx1FzO9wnG3QAGDawonvNSuyWXsuFqEjGRhQ8icB6FQmMQ4TvoNovIH1qW3EFEq3ca/IDY+w8+tCaIYfMEEDcJLm9NAYRLk/pQg5tfSzvmUU+700Usd1sZlQX/8OuBRTYL0+n3SsPlAVVW35G+AkjIPskuvwUEa0EiuK1az+If2qeHKdXMvQI/Tgg/n68tnvhuwwGdqOY+vsGpxWEvatZ8Wox+t46KtSO5nqzyj9v1DCvJ49DQyFpVAfA+4Ct1qS+fW4Kqpfhz3e386/6jOqKLSOunanGcGMyhI7AQ11jqunFFo78SRNtaRtQV/JWWqxI1NmfkcXA6iXY62WLQpd/9Z+oNIJ5uq80PxWEfazrCRkV7UGxR46rzsjNFUHAY9BYkFxHGMT83mGfJfC5CRHPZ0Sl2A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(7916004)(396003)(366004)(39830400003)(346002)(136003)(1076003)(6666004)(53546011)(52116002)(6506007)(186003)(41300700001)(6512007)(26005)(9686003)(83380400001)(38350700002)(38100700002)(66946007)(33716001)(8936002)(7416002)(44832011)(5660300002)(4326008)(86362001)(8676002)(2906002)(66476007)(33656002)(316002)(66556008)(6486002)(508600001)(6916009)(54906003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?0HHFvRVJHmWpDWbEZYSkt+5OHU+d249t8mM2kPMx6UFWAYG6TyhVKpa3XTgq?= =?us-ascii?Q?lkxrihRR2p0JxSRHpHCU0eHbMhmk0BkBfeHTVxEfevuXqwcqMPD3cKPqjFec?= =?us-ascii?Q?ivIDGua7XcGun5p07i+CfTEF98qfDZHw0vMjdMrhru23fhLp/+bTC9NaN0/i?= =?us-ascii?Q?EK1hCV7qSBJhZuimr8Rse5fTkJu69RIRtCT4SyEMNuOtYlaiRP7rBgya/wwa?= =?us-ascii?Q?27XH4vg8h6Q1M3zYwZBeCBeIaIZxsvUCq7P0uEWfavqwMtdtWc4wFRQD0iFA?= =?us-ascii?Q?DGp8iUs0aFN5gO/JhWcjKE3unv7v4dsPh8yhnDqKBGLWX8/6AhTeV9UewXmZ?= =?us-ascii?Q?01TWACmZ/FvALOxhoi/fyp9ZthQFjSy+pY9l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aajiBppdHMAxJ2y8qugnwQT+WKzPJuqL0rnUnH165X?= =?us-ascii?Q?J7O4ckVoq7ADv9Ft2YIrLBDhhVzT7rqqW+SmoYWnYUyWU0K0ehKoSKnz6gdo?= =?us-ascii?Q?v7mP8qxQpTeQr0i+TBr+qD5MP34sY8vDlSXjR1H79YQm74lfg8o1D5dwAd+T?= =?us-ascii?Q?6F7n53ec1300AueW4Ry8eknajNWCGEByW6PIuHgJsCsmFQE9MBPr+XCza9XJ?= =?us-ascii?Q?TXw6e0nfYkLJois8G2u0f2Zpjqk1gti5/p22yQHKb+YO9b1pKyKIF/MC18zd?= =?us-ascii?Q?qHde+3yEXIpKx0eCWbiYe05yAnfhXg56n4KRlxdflhE0BaeqY+rAu8IkKmI2?= =?us-ascii?Q?1tZpqJSQEzdOkeYtP449l77bHDyqnSyTuY2t4k5YOdtJW2VXws18NXwgYDAR?= =?us-ascii?Q?XknHLheiSF1haLiYSrNaQYvD44hoY8eiMiMZv/CV7+HGxDp5ebjuIpiAhIMG?= =?us-ascii?Q?8SM7kM53JpafpiGVs567eMGJWpCt9NcDEnhcv9YuvypRMe1aPVuL?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 091398dd-4339-4cb4-94d7-08da4bc28f7a X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jun 2022 15:53:43.2229 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7YAba/Eug1VB/8g4kjkT3vinvcBV/4eVnd1VIoLfqNxE+S++09uI/JnqcJ8/Zt9233wnfnh2VxqcOlc97asWnVDLWghTmn27qZtt6v55T8U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR10MB4145 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Jun 11, 2022 at 12:26:31PM +0200, Andy Shevchenko wrote: > On Fri, Jun 10, 2022 at 7:57 PM Colin Foster > wrote: > > > > Several ocelot-related modules are designed for MMIO / regmaps. As such, > > they often use a combination of devm_platform_get_and_ioremap_resource and > > devm_regmap_init_mmio. > > > > Operating in an MFD might be different, in that it could be memory mapped, > > or it could be SPI, I2C... In these cases a fallback to use IORESOURCE_REG > > instead of IORESOURCE_MEM becomes necessary. > > > > When this happens, there's redundant logic that needs to be implemented in > > every driver. In order to avoid this redundancy, utilize a single function > > that, if the MFD scenario is enabled, will perform this fallback logic. > > ... > > > +#include > > +#include > > +#include > > Since it's header the rule of thumb is to include headers this one is > a direct user of. Here I see missed > types.h > > Also missed forward declarations > > struct resource; Ahh, thank you. Yes, you mentioned this in v8 but I misuderstood what you were saying. I'll also include types.h. > > ... > > > + if (!IS_ERR(regs)) > > Why not positive conditional? > > > + *map = devm_regmap_init_mmio(&pdev->dev, regs, config); > > + else > > + *map = ERR_PTR(ENODEV); > > Missed -. Fixed. Thanks. > > -- > With Best Regards, > Andy Shevchenko