From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965627AbdCVSaO (ORCPT ); Wed, 22 Mar 2017 14:30:14 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:57583 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965514AbdCVSaJ (ORCPT ); Wed, 22 Mar 2017 14:30:09 -0400 Date: Wed, 22 Mar 2017 19:30:02 +0100 From: Andrew Lunn To: sean.wang@mediatek.com Cc: f.fainelli@gmail.com, vivien.didelot@savoirfairelinux.com, matthias.bgg@gmail.com, robh+dt@kernel.org, mark.rutland@arm.com, devicetree@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, davem@davemloft.net, Landen.Chao@mediatek.com, keyhaede@gmail.com, objelf@gmail.com Subject: Re: [PATCH net-next v2 5/5] net-next: dsa: add dsa support for Mediatek MT7530 switch Message-ID: <20170322183002.GP30655@lunn.ch> References: <1490088910-19405-1-git-send-email-sean.wang@mediatek.com> <1490088910-19405-6-git-send-email-sean.wang@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1490088910-19405-6-git-send-email-sean.wang@mediatek.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > +static int > +core_read_mmd_indirect(struct mt7530_priv *priv, int prtad, int devad) > +{ > + struct mii_bus *bus = priv->bus; > + int value, ret; > + > + /* Write the desired MMD Devad */ > + ret = bus->write(bus, 0, MII_MMD_CTRL, devad); > + if (ret < 0) > + goto err; > + > + /* Write the desired MMD register address */ > + ret = bus->write(bus, 0, MII_MMD_DATA, prtad); > + if (ret < 0) > + goto err; > + > + /* Select the Function : DATA with no post increment */ > + ret = bus->write(bus, 0, MII_MMD_CTRL, (devad | MII_MMD_CTRL_NOINCR)); > + if (ret < 0) > + goto err; Hi Sean This appear to be a copy of mmd_phy_indirect(). There are patches from Russell King which made this a public function. Once Russell patches make net-next, it would be nice to use mmd_phy_indirect(). But that might be as a follow up patch, rather than now, depending on the order of acceptance of the patches. Andrew From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH net-next v2 5/5] net-next: dsa: add dsa support for Mediatek MT7530 switch Date: Wed, 22 Mar 2017 19:30:02 +0100 Message-ID: <20170322183002.GP30655@lunn.ch> References: <1490088910-19405-1-git-send-email-sean.wang@mediatek.com> <1490088910-19405-6-git-send-email-sean.wang@mediatek.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, vivien.didelot-4ysUXcep3aM1wj+D4I0NRVaTQe2KTcn/@public.gmane.org, matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, mark.rutland-5wv7dgnIgG8@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org, Landen.Chao-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org, keyhaede-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, objelf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org To: sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org Return-path: Content-Disposition: inline In-Reply-To: <1490088910-19405-6-git-send-email-sean.wang-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: netdev.vger.kernel.org > +static int > +core_read_mmd_indirect(struct mt7530_priv *priv, int prtad, int devad) > +{ > + struct mii_bus *bus = priv->bus; > + int value, ret; > + > + /* Write the desired MMD Devad */ > + ret = bus->write(bus, 0, MII_MMD_CTRL, devad); > + if (ret < 0) > + goto err; > + > + /* Write the desired MMD register address */ > + ret = bus->write(bus, 0, MII_MMD_DATA, prtad); > + if (ret < 0) > + goto err; > + > + /* Select the Function : DATA with no post increment */ > + ret = bus->write(bus, 0, MII_MMD_CTRL, (devad | MII_MMD_CTRL_NOINCR)); > + if (ret < 0) > + goto err; Hi Sean This appear to be a copy of mmd_phy_indirect(). There are patches from Russell King which made this a public function. Once Russell patches make net-next, it would be nice to use mmd_phy_indirect(). But that might be as a follow up patch, rather than now, depending on the order of acceptance of the patches. Andrew -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html