Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1211605ybl; Tue, 13 Aug 2019 09:03:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9ZlFlk7aU8hkh1b3hsHoF3ItasbRjDxkpd/YMiBM5ligusixGKsMuqXPNRVXOhMiSWyn0 X-Received: by 2002:a63:40a:: with SMTP id 10mr35635478pge.317.1565712188169; Tue, 13 Aug 2019 09:03:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565712188; cv=none; d=google.com; s=arc-20160816; b=Xbyq3ND2NDYSZ4SBRI7+WAkyqSL1T9p5gIEbKV3N32Q0SK6ym/3OyM9Zun/qUPAeqT u+U3LNs8yTfsw49UGBRW7RkehfHHybEAo0l9l0C2Iiig0/pXnn8brYH5BPF3V7aAqfE6 WiDyeDpngjZuKyaw8pahqSmT5y3StXePBMSiAGsvwYYfI7u+i0EccZMjslvVy/0f1zJ8 tq20U7z9ayvnXCrZLtGTzBzrd5JqfWcpvO+GOcu0PLIKZwIDFocDfc1yvArCmoYKK7Bo qE7x7vqPU4TXJU5q//RHrhfhZ8FlRhYmekXRp9YymMs483S3cruHZJUg5P0mY1XGxjUw S1zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=YCHZ3K8mmCIRGs587/Fkq0X6NLVBIcMaI9O+DVE1psw=; b=L9TWjbOdb+gj7GHZMGNd59MOweEhX+WPwn5ULZKDadlB2g4xHquvTAzl4iOfBTYN4V WoplRtsaDg04A2rCz6qeEmhUUwxnWP3gm/1KOu4Bnvu2c05eT/D5gJF4bu9F9ofF5ROB Nr2hehTYXB0NBL1JjghLZh+7wQo35k4PsImWPgI8OFDwTwPyZn34zURRGtYJH/36lo5x xgHGdw8ZnPdUXl2YgDK1CczZmEPuyCS9wqdHNYcsAmeUxTFqiF/5hUELf8U4W/wBf/N3 G+jb3wBBN229bg9j96Epr9jl0Po6jsu6twIpwnSbjKmgFwum/rbGUG/S7hp5A3H4RQLI 0Log== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=eF7GmDgM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b18si58405387plz.389.2019.08.13.09.02.52; Tue, 13 Aug 2019 09:03:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=eF7GmDgM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729068AbfHMNX0 (ORCPT + 99 others); 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