Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp747989ybe; Wed, 4 Sep 2019 07:12:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqyy7AdDuAKSzVBAMSxTAE6I8riInZS+WwAr1QksqTY9xS9Xq1QXqu0H+3C4D9bdtM1OkFDp X-Received: by 2002:a63:c009:: with SMTP id h9mr35153444pgg.166.1567606355208; Wed, 04 Sep 2019 07:12:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567606355; cv=none; d=google.com; s=arc-20160816; b=ipSiqoSJutCUGzY6npJ9FndGWbcsyJIj5JoTtPp+jKinlmNa7f9gOY8RUIC2+fzpR5 iqu9Y2KOcL1xrTl4r7+LjS/WY5bpPeDAqGAKeYW5LCryJt163dWVfq1n7CZWtA39r87q kHS3EHbRZIUpaXLhamr/ys8Lu0lfYYvbyLakmiByD4ZtbYkRe7R9UfkC36oejO9RmyXb WlpiCmZ8BkJJL3RaGFAwiVioD1VPw7i1LANQEkdaWQsmFNvJhQFGBcmJXlVD7EH9aQzq aI5fBfUi8YIqsj/NBoDJrB1kd31YpG1z2ZGNMusvx5r0BxlKXK9oIYVvkTGNTJINZ9hL GWFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=ndiu1qeyYiTsgd1IQKxLqytq07+6AvPDInzgXch1dx0=; b=XyMJW5Io1PFygslMA8W6VcZTC6xGd89d4zCZjwIaGew1sZF0n1lRlYxkg5N8tHo+N3 YlL2kA+/ATBOP+4HWAlKkKwQXmvCBUPoAbxi51h30kkkhH7J1Y9dWFncO7FkQGLZNFFI GvRiT6i2eSRd/bG7R9gMfe4mkxqqPm/psMGEbZrN0FuGJLZ2b/Vu42z7sEGt9fcNrYz+ fMD9i8ocjJ9QTN7/MSezVVax9UArKABv0BDNuNrs0snzHZGbo7foH2NR4+gK6lcZNTlZ 8LBXJj6EFhj3uj2v03J8QBAfVePDPtYCy5u9zYe6o2AAxUX4rGBQ+fqQJl1yzx19+Sl+ wuZA== ARC-Authentication-Results: i=1; mx.google.com; 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 r15si17047355pgj.71.2019.09.04.07.12.16; Wed, 04 Sep 2019 07:12:35 -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; 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 S1730078AbfIDOLQ (ORCPT + 99 others); Wed, 4 Sep 2019 10:11:16 -0400 Received: from mail-yb1-f193.google.com ([209.85.219.193]:46894 "EHLO mail-yb1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729877AbfIDOLP (ORCPT ); Wed, 4 Sep 2019 10:11:15 -0400 Received: by mail-yb1-f193.google.com with SMTP id y194so7322951ybe.13; Wed, 04 Sep 2019 07:11:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ndiu1qeyYiTsgd1IQKxLqytq07+6AvPDInzgXch1dx0=; b=jG6sUMeGvrOa7y8hDzJRpMlJ0GH5PIveC8dv0iHURRSK7qWEeeJPOvWub6Yb+Jceb4 3fl9eRUIgX4OmqmA9ZqXB2SD0DZ/VghK/AkfF+qnFWyo0aSV/a7CEEN+meI1QaMS3GPo T380Rtm5WLulWZ2fOV4udEFBaXG+uucMpf8FfN5euqnj2tEtVJLu5PzMls14PzlmOaEa 6m3LpvG0I2AKf6NgW90jqW1uqXhHhctz9bWKtcOejWqR6CzHwO2IG0hs34RjSJHFUvxE m0YkNCoLdNK1gvQfnVg8ojDgIxgYYe6iquTDxySWhvFT3J8jMeEcDI6csZ4no1WNj6t8 ZuRQ== X-Gm-Message-State: APjAAAXAN5qGSvYNGANXbLIfHnq6sRQT0lG1Es4zOHObJzN6AdprPl49 avCDZF8YfSZYg8py1BvTd8s56Qksnl7Lph/jFuc= X-Received: by 2002:a5b:981:: with SMTP id c1mr27761719ybq.14.1567606274841; Wed, 04 Sep 2019 07:11:14 -0700 (PDT) MIME-Version: 1.0 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> <20190813132321.GF15047@lunn.ch> <20190813153820.GY14290@lunn.ch> In-Reply-To: <20190813153820.GY14290@lunn.ch> From: Harini Katakam Date: Wed, 4 Sep 2019 19:41:03 +0530 Message-ID: Subject: Re: [PATCH 2/2] net: gmii2rgmii: Switch priv field in mdio device structure To: Andrew Lunn 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andrew, On Tue, Aug 13, 2019 at 9:40 PM Andrew Lunn wrote: > > > > 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)? > > > > Maybe phydev_mdio_get_drvdata? Because the driver data member available is > > phydev->mdio.dev.driver_data. > > I still prefer phydev_get_drvdata(). It fits with the X_get_drvdata() > pattern, where X is the type of parameter passed to the call, spi, > pci, hci. > > We can also add mdiodev_get_drvdata(mdiodev). A few DSA drivers could > use that. Sorry for the late reply. I just sent a v2 adding mdiodev_get/set_drvdata helpers and using them in gmii2rgmii driver. I did not add a corresponding phydev helper because there is no "struct dev" in "struct phy_device" and I dint know if there were any users to add the member and then a helper for driver data. Also, strutct phy_device { struct mdio_device { struct device }} is already available and it seemed logical to use that field to set/get driver data for gmii2rgmii. Please let me know if v2 is okay. Regards, Harini