From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dong Aisheng Subject: Re: [PATCH v2 1/2] pinctrl: pinctrl-imx: add support for set bits for general purpose registers Date: Thu, 12 Jul 2012 19:04:43 +0800 Message-ID: <20120712110442.GE22640@shlinux2.ap.freescale.net> References: <1342084080-3145-1-git-send-email-b29396@freescale.com> <4FFE9D7E.1080302@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <4FFE9D7E.1080302-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: "devicetree-discuss" To: Hui Wang Cc: Zhao Richard-B20223 , "linus.walleij-0IS4wlFg1OjSUeElwK9/Pw@public.gmane.org" , "devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org" , Guo Shawn-R65073 , Liu Hui-R64343 , "kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org" , "s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org" , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" List-Id: devicetree@vger.kernel.org On Thu, Jul 12, 2012 at 05:48:46PM +0800, Hui Wang wrote: ... > > + > > +int imx_pinctrl_gpr_read(u8 gpr) > > +{ > > + if (!imx_pinctrl) > > + return -EPROBE_DEFER; > > + > > + return readl(imx_pinctrl->base + gpr); > > > Suppose the MSB of the register content is 1, how does the caller > distinguish if the function return an error or return a register content? > Good catch, it's indeed an issue. We need find a way to fix it, probably i would add a parameter for read API to return a u32 value. Thanks Regards Dong Aisheng From mboxrd@z Thu Jan 1 00:00:00 1970 From: b29396@freescale.com (Dong Aisheng) Date: Thu, 12 Jul 2012 19:04:43 +0800 Subject: [PATCH v2 1/2] pinctrl: pinctrl-imx: add support for set bits for general purpose registers In-Reply-To: <4FFE9D7E.1080302@gmail.com> References: <1342084080-3145-1-git-send-email-b29396@freescale.com> <4FFE9D7E.1080302@gmail.com> Message-ID: <20120712110442.GE22640@shlinux2.ap.freescale.net> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, Jul 12, 2012 at 05:48:46PM +0800, Hui Wang wrote: ... > > + > > +int imx_pinctrl_gpr_read(u8 gpr) > > +{ > > + if (!imx_pinctrl) > > + return -EPROBE_DEFER; > > + > > + return readl(imx_pinctrl->base + gpr); > > > Suppose the MSB of the register content is 1, how does the caller > distinguish if the function return an error or return a register content? > Good catch, it's indeed an issue. We need find a way to fix it, probably i would add a parameter for read API to return a u32 value. Thanks Regards Dong Aisheng