From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Andrzej Siewior Subject: Re: [PATCH 12/19] iio & mfd & input: ti_tscadc: Match mfd sub devices to regmap interface Date: Tue, 4 Jun 2013 12:52:10 +0200 Message-ID: <20130604105210.GI1151@linutronix.de> References: <1369681926-22185-1-git-send-email-bigeasy@linutronix.de> <1369681926-22185-13-git-send-email-bigeasy@linutronix.de> <51AB84F5.2030405@kernel.org> <20130604102318.GC1151@linutronix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-iio-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Pantelis Antoniou Cc: Jonathan Cameron , linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Samuel Ortiz , Jonathan Cameron , Dmitry Torokhov , Felipe Balbi List-Id: linux-input@vger.kernel.org * Pantelis Antoniou | 2013-06-04 13:25:28 [+0300]: >>>> diff --git a/drivers/mfd/ti_am335x_tscadc.c b/drivers/mfd/ti_am335= x_tscadc.c >>>> index bd127bd..a27401a 100644 >>>> --- a/drivers/mfd/ti_am335x_tscadc.c >>>> +++ b/drivers/mfd/ti_am335x_tscadc.c >>>> @@ -31,6 +31,7 @@ static unsigned int tscadc_readl(struct ti_tscad= c_dev *tsadc, unsigned int reg) >>>> { >>>> unsigned int val; >>>>=20 >>> ???? What is this doing here? It's not doing the move to regmap bu= t rather setting a default value. >>=20 >> No lo s=C3=A9 :) I saw that and was wondering myself a little and pl= anned the >> romval of this default for later. Now I think I do this earlier. >>=20 > >The tscadc_read function doesn't have a failure mode; doesn't return a= n error in case of a regmap_read >fail. Rather that change all the callers, we make sure we don't ever r= eturn an uninitialized value=20 >in case of an error (when val should be unchanged). One stupid question: Why did you start using regmap in the first place? >>>> + val =3D (unsigned int)-1; >>>> regmap_read(tsadc->regmap_tscadc, reg, &val); >>>> return val; >>>> } Sebastian