From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.1 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1D64C433FF for ; Tue, 13 Aug 2019 13:23:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B8A3520578 for ; Tue, 13 Aug 2019 13:23:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="eF7GmDgM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729076AbfHMNX0 (ORCPT ); Tue, 13 Aug 2019 09:23:26 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:56790 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728713AbfHMNX0 (ORCPT ); Tue, 13 Aug 2019 09:23:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=YCHZ3K8mmCIRGs587/Fkq0X6NLVBIcMaI9O+DVE1psw=; b=eF7GmDgMgA1p4uWVsKBK+77zei /20hCu8XCVXTYsIyvLQB4DFzBsGSLw6smKcwkPPLoLGtvP7og8ewHSM9gALv5Vj8dueWVOceFKtpM hxclsGJlT4iTIbCjon8EoDSkUDju6egUvcdVssu8Q5U5JzyeicnT5ThM9W5gRMd9aaWc=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1hxWll-0001Js-2X; Tue, 13 Aug 2019 15:23:21 +0200 Date: Tue, 13 Aug 2019 15:23:21 +0200 From: Andrew Lunn To: Harini Katakam Cc: Harini Katakam , Florian Fainelli , Heiner Kallweit , David Miller , Michal Simek , netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, radhey.shyam.pandey@xilinx.com Subject: Re: [PATCH 2/2] net: gmii2rgmii: Switch priv field in mdio device structure Message-ID: <20190813132321.GF15047@lunn.ch> References: <1564565779-29537-1-git-send-email-harini.katakam@xilinx.com> <1564565779-29537-3-git-send-email-harini.katakam@xilinx.com> <20190801040648.GJ2713@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 13, 2019 at 04:46:40PM +0530, Harini Katakam wrote: > Hi Andrew, > > On Thu, Aug 1, 2019 at 9:36 AM Andrew Lunn wrote: > > > > On Wed, Jul 31, 2019 at 03:06:19PM +0530, Harini Katakam wrote: > > > Use the priv field in mdio device structure instead of the one in > > > phy device structure. The phy device priv field may be used by the > > > external phy driver and should not be overwritten. > > > > Hi Harini > > > > I _think_ you could use dev_set_drvdata(&mdiodev->dev) in xgmiitorgmii_probe() and > > dev_get_drvdata(&phydev->mdiomdio.dev) in _read_status() > > Thanks for the review. This works if I do: > dev_set_drvdata(&priv->phy_dev->mdio.dev->dev) in probe > and then > dev_get_drvdata(&phydev->mdio.dev) in _read_status() > > i.e mdiodev in gmii2rgmii probe and priv->phy_dev->mdio are not the same. > > If this is acceptable, I can send a v2. Hi Harini I think this is better, making use of the central driver infrastructure, rather than inventing something new. The kernel does have a few helper, spi_get_drvdata, pci_get_drvdata, hci_get_drvdata. So maybe had add phydev_get_drvdata(struct phy_device *phydev)? Thanks Andrew