Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4714691rdb; Tue, 12 Dec 2023 07:26:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IFhhLx9xGJ86uONtvwguqo+vFo/3MW5SWDL0NYHpP08zDp2aTnJNtzUs4j5Pew4R5qNInzR X-Received: by 2002:a05:6a20:f39c:b0:18b:89fa:e924 with SMTP id qr28-20020a056a20f39c00b0018b89fae924mr7068033pzb.52.1702394813945; Tue, 12 Dec 2023 07:26:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702394813; cv=none; d=google.com; s=arc-20160816; b=kY2RQ18pByxwuW8rmAgZOdnkmy421fddGuga3eTI50sBMNMLSAcD/0ontfAKyRhRNn qgS6bS9kneb2xPcQAQm+QFInKAbQpcVn/sD/w4CcspNBArrCgzSAO+GtAMWuFVfxPr5V Hf77qwcmbWDOAHiqPnEr41SAqtc18pDtdOED2ECqF1vD9hqu54k+zsv1KrUN9Di/InD4 dZXbEjlVGWEqpDstfsLukEUAvvD0Z7kDt+PjmmJ4QyzpUECVtr8G7XVOWKcWejTT3626 F45ZZoyYaOVm1FWV1yxL+aSqIv2tM0lh86AALbFIyjniKDeVZSEr2c5x9rGlhFoWBJD/ 5zgA== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RzfykjqVsJboNXe+GyM6OYXbP3W5WNnJ1aGISEQJa3Q=; fh=AVtV1Wls/v1UV+o3DAyFguJvoENHVXWve3bKunUr09U=; b=CBaArbxQkJT0kf1LTpW1Eq5fTDSHkfXwcFCb/VlJfjbD+m7Y2ILpzVgRzm8Yi708Sl yBx3bPtM5nLJmGmPHGwfm9zRNc9/d87kIgCJHknCDmLC5kIDPiHaJ4C645jZvEG9TsSo HpVCpKfUt1+O+RbiU9K7mkOvG8sjjt53b3Oi9j95JURoFfQow/3VJyTYPjmiPNAk18LN 7AfJ8Vap6mE/A4xjps4FkMl0OuH8L2ubtsD+mUUNXltUKEqT4LWvOar2R5EtgOuo0DpW z/tPm+sXh8W5vKwHqdlD29AaZHFMgfomI5Efwo4Nqi49+K8InENBSztrk2NYHfXO0aFP 7Y7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YHX5pL6o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id bq5-20020a056a02044500b005b938759695si8333167pgb.886.2023.12.12.07.26.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 07:26:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=YHX5pL6o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id BE6E3804E44A; Tue, 12 Dec 2023 07:26:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235018AbjLLP0U (ORCPT + 99 others); Tue, 12 Dec 2023 10:26:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232949AbjLLP0R (ORCPT ); Tue, 12 Dec 2023 10:26:17 -0500 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72B43AA; Tue, 12 Dec 2023 07:26:23 -0800 (PST) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2ca0f21e48cso74882821fa.2; Tue, 12 Dec 2023 07:26:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702394781; x=1702999581; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=RzfykjqVsJboNXe+GyM6OYXbP3W5WNnJ1aGISEQJa3Q=; b=YHX5pL6oJFUsSwBk8s91P4GP016767zDZ3xGtKlET9cPh6G2ogZ3OcXLZsFNF5OHfz cR0ySMmXZUsmIlbCAUAJWtBG7R0TsGpP+WkbPkz/q6NWxO/Fj1gPIZJCKMHVcEG0G5Ld Ae4De6TUtKxQRtYqYZ2sS8+SiOhp0OBRXfQlllJhDIIUz+fUOAcEN1/O25kWS7c6sc7l JPgxq6k5tmcInCnHg4AM32SmIzaRcBidVyWRfYP5/xSV9gG3wSSgk3jnU9sZCWR79NFO v5rZpeb5sjIefZYyS28z4FmBfr0zsFkxgYQOD69hV1VdrC+PC4BrfY2h2uTvWymc+nJp e1Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702394781; x=1702999581; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=RzfykjqVsJboNXe+GyM6OYXbP3W5WNnJ1aGISEQJa3Q=; b=huKyYmnDjkz3BN16Tettb7ikFPm7FlHVbl5qfB2MGHv/zS6jwoEZDe0YnUDLGmupKn Rp8vn0r/g1LbVPg+JwVHkUM3pK05H8/FIqCBc1Ujoboiwea6tJFM0hmADYJ3p3MR/0OQ JjGXMtS+p1Ru1gjutMtsm33XvZFqHEYGAv7gbAugW9fi1cyW8ysABrHdypuOiOhpdvyS UC6MynOvPNKbXq9L+Io4ztVEKZKefzgFP5xfVNYXiRWB2d3Klo2wzS4+YA3YnCjMNtIc M5Z+y+mkZ+1e7OL7g9Vt6WyrcnJ6f6DsSd5Tgms1uymXsSI8zBB6wsKz400QwoBPvhqg 4NVw== X-Gm-Message-State: AOJu0YyTmt5LfL5OUlk374E+F0XvbmNFWXY/l0Khp6gGvp5TjLYfFvOT keKNTh01MmW+v0HL2E7N4cw= X-Received: by 2002:a2e:9ec4:0:b0:2ca:752:24a3 with SMTP id h4-20020a2e9ec4000000b002ca075224a3mr2851858ljk.22.1702394780915; Tue, 12 Dec 2023 07:26:20 -0800 (PST) Received: from mobilestation ([178.176.56.174]) by smtp.gmail.com with ESMTPSA id z18-20020a2ebe12000000b002c9f59f1748sm1537789ljq.7.2023.12.12.07.26.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 07:26:20 -0800 (PST) Date: Tue, 12 Dec 2023 18:26:16 +0300 From: Serge Semin To: "Russell King (Oracle)" Cc: Andrew Lunn , Heiner Kallweit , Alexandre Torgue , Jose Abreu , Jose Abreu , Maxime Chevallier , Tomer Maimon , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , openbmc@lists.ozlabs.org, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 06/16] net: pcs: xpcs: Avoid creating dummy XPCS MDIO device Message-ID: References: <20231205103559.9605-1-fancer.lancer@gmail.com> <20231205103559.9605-7-fancer.lancer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 12 Dec 2023 07:26:53 -0800 (PST) On Tue, Dec 05, 2023 at 02:54:00PM +0000, Russell King (Oracle) wrote: > On Tue, Dec 05, 2023 at 01:46:44PM +0000, Russell King (Oracle) wrote: > > For your use case, it would be: > > > > mdiodev = bus->mdio_map[addr]; > > By the way, this should be: > > mdiodev = mdiobus_find_device(bus, addr); > if (!mdiodev) > return ERR_PTR(-ENODEV); > > to avoid a layering violation. I would have used in the first place if it was externally visible, but it's defined as static. Do you suggest to make it global or ... > At some point, we should implement > mdiobus_get_mdiodev() which also deals with the refcount. ... create mdiobus_get_mdiodev() instead? * Note in the commit message I mentioned that having a getter would be * better than directly touching the mii_bus instance guts. -Serge(y) > > -- > RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ > FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!