Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp365783rwn; Thu, 8 Sep 2022 02:53:46 -0700 (PDT) X-Google-Smtp-Source: AA6agR4FLAub/aF+AyVLkNGOWYueEemBRZiScT9xjpQC8JfrQ4GwabctKI9XeOJmrri7Osj1ZOIi X-Received: by 2002:a05:6402:2554:b0:450:28d2:2152 with SMTP id l20-20020a056402255400b0045028d22152mr2155868edb.303.1662630826612; Thu, 08 Sep 2022 02:53:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662630826; cv=none; d=google.com; s=arc-20160816; b=r8imz672CypHKDtLyhd8DuQL2S48jLdhMF7w6tzB899PEAiSJdTAUT/fqxf3oI3Ktp lQhDNjdcVe0WWNxh9wmzxzwduR/UKqSiZMlD9KqU5sP0GVg61eSLqDfsPag4pFMji5Wd 8uRLdYSpTPve2PIIfCASDrYgjjkcebES1Sdy/vzh9bQcUcQH6ztr/JQicTbdIO41w83l 9ZjftKqtwsX68jb9wFADjZYEEojMvwb/0LRGerlu1fE5S0PurdC5I4OlOfKCc4m+Mzch OcwwOuoUf9bQQQr46e7Wga7zVtx1IYjjVqogq6zdOgHQtkJc0CSDu+2fHoF7u1f49EfQ o49g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=xF0vySQ9iBwuwxb4Jl9f4wS3Mnf9IgtPD1PNPb/YWt4=; b=HaRL9f8ENNCrkKW16rI/F4xI70xlannzVsGjcpsxB4OdRLU/hq/d+rnH4ZFVFHv+tZ DUw4CNBdkx+O+6xBfCzZyEiRv3nLXe6tPK18zJa36Ge05LGCqntdKSHHVAGG6OyywA8A DcZOX8d0KwN2LPfyuyhaXReHBm45niek8kcvUpB2Yz/C3I52sbATKs84n3IKy0CxSxJ0 /wPbHOq7T0+Hw9g4U7ukNs6y7fwFt9+pGDVp1LHbKVlBAA3ftmjwUuXvo4tlYfsJxlnf Rfsge1POYuxOcQwPDWlkgJwL80KWhYBZXIQW/scwfiOelQe2hGHvlfdLsspp6ET2SnTG v7AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Frp7Mtje; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n22-20020a1709065e1600b007307fa2da78si1512421eju.450.2022.09.08.02.53.22; Thu, 08 Sep 2022 02:53:46 -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=@kernel.org header.s=k20201202 header.b=Frp7Mtje; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230287AbiIHJlB (ORCPT + 99 others); Thu, 8 Sep 2022 05:41:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230317AbiIHJk5 (ORCPT ); Thu, 8 Sep 2022 05:40:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A01DDAB98; Thu, 8 Sep 2022 02:40:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A8DD661C1D; Thu, 8 Sep 2022 09:40:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5287AC433D6; Thu, 8 Sep 2022 09:40:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1662630056; bh=5RUm81zlERyd6+Ku9Ye7uJNcw3jwPTJ2bSQ9G+rtz/k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Frp7Mtje39BEl9ywxYXj2XQNm+g0nazFVUP/IpDYJf+CWzSayLbBJ2I7et4jv6wGB BbTqnkNiToYzsPOFxTPaPWXoK01UhmMGnw5H08khA5XB5Dsbyap9zOWTA9CMpZniUe 4A991NF5lB8u9gf4A0RverqSsQ4bQH4skSN2ZBazBx34WfdqJmsBb/0AyjHtEMt3nl 5nDjVQFALRX5hJFBZy88TBGGdOQFl+HQuXKKN7oB38PhZXXHMd/ZP0sdtpkknlc5E7 7cJUk9bgvr+pt9ap0kgh1s3ZwTxwaRR68N/Y5LHR5Hzig2PpCmIDQTqF/Ito7yqGMN mw3cXjQhNJ3Og== Date: Thu, 8 Sep 2022 10:40:48 +0100 From: Lee Jones To: Colin Foster Cc: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Terry Bowman , Vladimir Oltean , Greg Kroah-Hartman , Andy Shevchenko , Dan Williams , Jonathan Cameron , UNGLinuxDriver@microchip.com, Steen Hegelund , Lars Povlsen , Linus Walleij , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Russell King , Heiner Kallweit , Andrew Lunn , Krzysztof Kozlowski , Rob Herring , katie.morris@in-advantage.com Subject: Re: [RESEND PATCH v16 mfd 1/8] mfd: ocelot: add helper to get regmap from a resource Message-ID: References: <20220905162132.2943088-1-colin.foster@in-advantage.com> <20220905162132.2943088-2-colin.foster@in-advantage.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220905162132.2943088-2-colin.foster@in-advantage.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 Mon, 05 Sep 2022, 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. > > Signed-off-by: Colin Foster > Reviewed-by: Vladimir Oltean > Reviewed-by: Andy Shevchenko > --- > v16 > * Add Andy Reviewed-by tag > > v15 > * Add missed errno.h and ioport.h includes > * Add () to function references in both the commit log and comments > > v14 > * Add header guard > * Change regs type from u32* to void* > * Add Reviewed-by tag > > --- > MAINTAINERS | 5 +++ > include/linux/mfd/ocelot.h | 62 ++++++++++++++++++++++++++++++++++++++ > 2 files changed, 67 insertions(+) > create mode 100644 include/linux/mfd/ocelot.h Applied, thanks. -- Lee Jones [李琼斯]