Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp271583iol; Sat, 11 Jun 2022 04:01:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlac+yX3k7Bi13p5h5mD/STzkf/xd/elp7pDbYNKbjAgjGAU959oDX++DmbAp1piAb8kiJ X-Received: by 2002:a05:6402:3551:b0:431:51e1:856f with SMTP id f17-20020a056402355100b0043151e1856fmr36311572edd.323.1654945294844; Sat, 11 Jun 2022 04:01:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654945294; cv=none; d=google.com; s=arc-20160816; b=xaKy/6ftksu1dh7oLr3Bes/V6/ogFJZIZQOyYWgQ12Agg9l9GTqMY1zVFvRaSkGwEu UXyD6A1LDwrAvfJnbxqoDqd1GF7zP7OnYTcGclbTEwyb+mie0llVNgc5eTbfeo6odGCS 4Gz5gW2lIiIz5CpAsktgxlo99gNXH4QsEgD8jJoo8DjxQ+uThFqPUltcC4kF8q4BNf2o ECUSZEBHn1Y2Ud1Rq72wW1Dlr0xzLjfJft1IrToLjCnGCOWXY2SBxmgbLdef6LbxtsNE A0caD9VL3UFuJSFRDMTB9v3tNEsrfUexRobNd7FtalD+RmStqM7+h339HqTsJ3R0WdSK m0MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=TL01zc1wHBLAGsEfDb4Hq71GrxMg8CwLyZooSJWIhuQ=; b=ujjJ5HTI6Tel6G/Zq4CkHXrmiojc++4x9ktkZaD7Zbp77If5A+FBNb8gU9BqKc66AD vQxeBij/MfQQqt1FOYmN151QoIn/LQh/qUlD+Tw9ZDfe0ZPi706YpxatNY3rASppxFdf 7oiC5aAEljlq7GrSUhA5wvIpshNmSzoQyLgT8IhBAiSDQvWgm9NvuO72bxzB0wuRIDMC Ejse5G1/lHlYfjeaONYrAbU16d1iwXiUwHgkzMkDDqxBytAeFLKiTfKLkPj7/ThEedrA XGrre6IoaNicDj3WTHizrwBMTiKmrGbdXLbcKK/vRqRgXrqCNL8GFfs1FIk8w2Dx7zFq mFgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QtMJWb1U; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e26-20020a170906081a00b00702d89f5975si1671118ejd.96.2022.06.11.04.01.09; Sat, 11 Jun 2022 04:01: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=@gmail.com header.s=20210112 header.b=QtMJWb1U; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231174AbiFKKiH (ORCPT + 99 others); Sat, 11 Jun 2022 06:38:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229626AbiFKKiG (ORCPT ); Sat, 11 Jun 2022 06:38:06 -0400 Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66A5367D13; Sat, 11 Jun 2022 03:38:05 -0700 (PDT) Received: by mail-ed1-x52a.google.com with SMTP id b8so1711779edj.11; Sat, 11 Jun 2022 03:38:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TL01zc1wHBLAGsEfDb4Hq71GrxMg8CwLyZooSJWIhuQ=; b=QtMJWb1UWXwOslP4l+K17Z3gPpguIKDzqP/AcqYwPBpC9m4HNdrAjx8i0yHIs3Jr81 T+JWJK6hUr31ohqOEfqY2jE6+afIfHuPKmSFsVHEQwRoq2HS0BakWDReEK31a4xLWKvh HPtQxyskTRUBnBwAVtoWMBjdJ/+qSVbZEBUt7Xbbq6uFY4l0eKXbR2XeYQPB26nt7sTg gKdrjJQ/SB6iyg/q6jT0XNZ1e9+gnB6bgwYTPEI1UHJ7nX0MN0JQ3865pCeA02GV5cYX rjZa83ux9I4Jnsvh2vEcZwVkKMXC85eUejoUYIGlcftYfJSFZqYe6Misg/Hg1zXYK/uq eqfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TL01zc1wHBLAGsEfDb4Hq71GrxMg8CwLyZooSJWIhuQ=; b=Erpc6IYTjF1ZZsnAumCcffnwE3GO5r/qfHKu+0mzQRg6QR0c8vgVL1QbH/KNVSSL5h s8B4Jojgd3YvSdcRLtJWgwb5qzEYgYRjDbDnqtCis8jXff4XfJBEbwUSdvsFvDw5Iquv m00JEIS9zTC4VL70V1kg27wycj1Wu6s/sqIaQc/LSlp5fLWMNql0dTzMHg0bfniRbwZR A8LNt3Yb1ztlfEQfg0LhlCS65v1jp+9LI8k+jtZTKqn6ta75XILFbntdg+9PQs5rMRqc PnwvWhvQovn0j9HvINj/r64D3C0c5sdR6Vk/DUTMzW9D6XVB4i7JDa/CcUUwBa58FH+X p95g== X-Gm-Message-State: AOAM530VzFzugfYXmHJP6lPoN47pnUF6/Ja8xjQTcPlgAcXS3nwNfMsu HrUloqJRgLHZ/Ua0DDSphbQZZ1pHZe9/Pa1ES+U= X-Received: by 2002:aa7:d481:0:b0:42d:d5fd:f963 with SMTP id b1-20020aa7d481000000b0042dd5fdf963mr55696954edr.209.1654943883982; Sat, 11 Jun 2022 03:38:03 -0700 (PDT) MIME-Version: 1.0 References: <20220610202330.799510-1-colin.foster@in-advantage.com> <20220610202330.799510-2-colin.foster@in-advantage.com> In-Reply-To: <20220610202330.799510-2-colin.foster@in-advantage.com> From: Andy Shevchenko Date: Sat, 11 Jun 2022 12:37:26 +0200 Message-ID: Subject: Re: [PATCH v10 net-next 1/7] mfd: ocelot: add helper to get regmap from a resource To: Colin Foster 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 Fri, Jun 10, 2022 at 10:23 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. v10 has the same issues I have pointed out in v9. Please, take your time and instead of bombing mailing lists with new versions try to look how other (most recent) drivers have been done. Also pay attention to the API design. -- With Best Regards, Andy Shevchenko