From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Lunn Subject: Re: [PATCH 2/2] netdev/phy: add MDIO bus multiplexer driven by a regmap Date: Fri, 5 Oct 2018 15:53:17 +0200 Message-ID: <20181005135317.GA16682@lunn.ch> References: <20181005082926.27845-1-pankaj.bansal@nxp.com> <20181005082926.27845-3-pankaj.bansal@nxp.com> <20181005035142.GC7715@lunn.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Florian Fainelli , "netdev@vger.kernel.org" , Alexandru Marginean To: Pankaj Bansal Return-path: Received: from vps0.lunn.ch ([185.16.172.187]:54866 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728278AbeJEUwK (ORCPT ); Fri, 5 Oct 2018 16:52:10 -0400 Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: > > > + ret = regmap_update_bits_check(s->regmap, > > > + s->mux_reg, > > > + s->mask, > > > + desired_child, > > > + &change); > > > > When getting the mask from DT, you use be32_to_cpup(). > > When testing the reg value against the mask, you use be32_to_cpup(). > > Here you do not use be32_to_cpup()? > > Can you please tell me for which variable you mean I should use be32_to_cpup? > I use be32_to_cpup when reading device tree entries. > After being read, their values are stored in structure. After that no need to do be32_to_cpup desired_child is read from DT by the mdio-mux core. I'm just wondering why any of this be32_to_cpup() is needed. Why not just use of_property_read_u32()? Andrew