Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp271616iol; Sat, 11 Jun 2022 04:01:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxQzkjgV4XdnqMfd4L1gd4+96F4tasecNcb4o3OOL+vIHfFJ3C9IyfdOQSztxJ/mKiMx29G X-Received: by 2002:a17:906:b053:b0:6fd:d8d5:5cac with SMTP id bj19-20020a170906b05300b006fdd8d55cacmr44171178ejb.370.1654945297138; Sat, 11 Jun 2022 04:01:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654945297; cv=none; d=google.com; s=arc-20160816; b=u5vo9I+we0KWFccmGood+y7fynGtYoFwK9L9j1f8xSfs0/gPbaMRuGcasLoueZ5jGz h7S0jFILwLKeUmDApj/+a/K/zpINAlicPpn5SabvtimN0k3Y0GjEoJ33fzIFPaOV+CEG GQ5laykqjofWF7bY51wfIAJyO1PP8k+MUxBiyz4WSXlSgvDwbvhrQW1K9i6akwgYJu1R e6JAJZNQE9k6+JSCPtDD+oHynQF/lBQwotXkBHyLiGfYbnva/873qzLtAz2O9DlK1Gkv 87xhJX7D9c6qat7m8jrJayIkxJdrOuPQgVIdwC9YY7h3/ary2qKbY5KdQB72Vq02ppju RgNw== 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=GpxAqJ7MKT7TBnj7STiXSamQkAfUNiRyf59KUsb+gv4=; b=ZIO/6IzBzij9eklz6ipR33gsGN2V8a5syMgb5b6FmFhqxdk+Z26r594W5WiTtxTtIj i2b+7wDTFyoBwiGjXRBHRenVoiGFyrZ7DqD5Zoa4KCblkkZSPb4inPbxhXxyBgTVg6Fp L6FcCMFdpKGk9VX89TrZad2J8XPVOzfCtjyruFsjomW9Kx8Og3/oW4ocibXveGIW01hF ZrxR9PVaPnQfG77V1UttF14Sn0AYJYpSKKX2DkOgKJc3jIpkHFpzTfP1/TahMb7znXqA LJjtkUNID1YgUFexTwfA6MFzFUI3rK+sXVGTRKCYiHLL5DBoGTfmaY4/yH1HT6qLnT4d 0vNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=GRW5JRHP; 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 d21-20020a50fb15000000b0042dd84d78d3si1503863edq.439.2022.06.11.04.01.12; Sat, 11 Jun 2022 04:01:37 -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=GRW5JRHP; 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 S232129AbiFKKfm (ORCPT + 99 others); Sat, 11 Jun 2022 06:35:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229659AbiFKKfi (ORCPT ); Sat, 11 Jun 2022 06:35:38 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B29459316; Sat, 11 Jun 2022 03:35:37 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id me5so2430208ejb.2; Sat, 11 Jun 2022 03:35:37 -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=GpxAqJ7MKT7TBnj7STiXSamQkAfUNiRyf59KUsb+gv4=; b=GRW5JRHPVpqNWylUW4116B6JDuh7H+nKErw9Vh1eVDSFt1+KAEwoM9mNBWgjDD8wLp zVupH5fPj6tyUnILQAZIRiBAL6w8LKHXO8klEKDZ+SaBJCw/R/bH8lGWiZW/ARejk7sc oBx4HA3c6h5QFS/2KgL4YCNtMBfjzqT5JSt16/ZW55i5tVmbNdIlRZJpiM+MnfFTdgGq AzutQnuAGQ5HLnLwICZhy7eb2o+HAs2120syTv7GEW2WWNZUVT9v4Y8WuCYFDZDu8lwj 429MiSqAA6YeC7Ex8wt2FghkxvhosaKKYp+LD+oGqSkkt3tl2v4E9kVbJo1vZQpaIi4d 9iPg== 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=GpxAqJ7MKT7TBnj7STiXSamQkAfUNiRyf59KUsb+gv4=; b=xLEWBDhd47WFZBkY4SHZ/K2BjjMQjnLEJBTEvbA7VHAO/WLYPC5AT3921LdEHfaWWu f91zrRk0ewD4zy79vAfiHTA4P/9Kn6WxvflTDvvBQLla31J2Zx0QmlE5hiyAB27Mmu8X /ZIhmS78RujvG4I9aHEL5DU/kN7KdJwEYAeowfAJH+aAK1puNNJWXKrjaS3OzjVujKnM YUNl0SC1TrhVIxAghkk2g+WcLsytLmjZiNwlGnEdabMsIMSzV7pObSDUTfsxFxqdWS3F 3xLtQNle+0BvLQoBZ71kQROT6i1f6CHYE4FDdZPchSkGHlSb4e+xhUVrSRAVtgSsxvHK bJpw== X-Gm-Message-State: AOAM533twvPHZuYVEushiO1r0YJ5lwq6tpmW9ejPOQc2Ok74+/FWvFJG 37D+IDcH7OBwJ0qgJ0lpqNQg6tU16i8YaonX4n8= X-Received: by 2002:a17:906:434f:b0:711:eb76:c320 with SMTP id z15-20020a170906434f00b00711eb76c320mr18646521ejm.636.1654943735816; Sat, 11 Jun 2022 03:35:35 -0700 (PDT) MIME-Version: 1.0 References: <20220610175655.776153-1-colin.foster@in-advantage.com> <20220610175655.776153-3-colin.foster@in-advantage.com> In-Reply-To: <20220610175655.776153-3-colin.foster@in-advantage.com> From: Andy Shevchenko Date: Sat, 11 Jun 2022 12:34:59 +0200 Message-ID: Subject: Re: [PATCH v9 net-next 2/7] net: mdio: mscc-miim: add ability to be used in a non-mmio configuration 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 7:57 PM Colin Foster wrote: > > There are a few Ocelot chips that contain the logic for this bus, but are > controlled externally. Specifically the VSC7511, 7512, 7513, and 7514. In > the externally controlled configurations these registers are not > memory-mapped. > > Add support for these non-memory-mapped configurations. ... > + ocelot_platform_init_regmap_from_resource(pdev, 0, &mii_regmap, NULL, > + &mscc_miim_regmap_config); This is a bit non-standard, why not to follow the previously used API design, i.e. mii_regmap.map = ... ? ... > + ocelot_platform_init_regmap_from_resource(pdev, 1, &phy_regmap, &res, > + &mscc_miim_phy_regmap_config); Ditto. Also here is the question how '_from_' is aligned with '&res'. If it's _from_ a resource then the resource is already a pointer. ... > if (res) { > - phy_regs = devm_ioremap_resource(dev, res); > - if (IS_ERR(phy_regs)) { > - dev_err(dev, "Unable to map internal phy registers\n"); > - return PTR_ERR(phy_regs); > - } > - > - phy_regmap = devm_regmap_init_mmio(dev, phy_regs, > - &mscc_miim_phy_regmap_config); > if (IS_ERR(phy_regmap)) { > dev_err(dev, "Unable to create phy register regmap\n"); > return PTR_ERR(phy_regmap); > } This looks weird. You check an error here instead of the API you called. It's a weird design, the rationale of which is doubtful and has to be at least explained. > + } else { > + phy_regmap = NULL; > } -- With Best Regards, Andy Shevchenko