From mboxrd@z Thu Jan 1 00:00:00 1970 From: lee.jones@linaro.org (Lee Jones) Date: Wed, 20 Feb 2013 10:43:10 +0000 Subject: [PATCH 06/35] mfd: ab8500-core: Sysfs chip id modification In-Reply-To: References: <1360933026-30325-1-git-send-email-lee.jones@linaro.org> <1360933026-30325-7-git-send-email-lee.jones@linaro.org> <201302192204.45153.arnd@arndb.de> <20130220081311.GB3368@gmail.com> Message-ID: <20130220104310.GA4417@gmail.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, 20 Feb 2013, Marcus Cooper wrote: > On 20 February 2013 09:13, Lee Jones wrote: > > On Tue, 19 Feb 2013, Arnd Bergmann wrote: > > > >> On Friday 15 February 2013, Lee Jones wrote: > >> > struct ab8500 *ab8500; > >> > + int chip_id = -EINVAL; > >> > > >> > ab8500 = dev_get_drvdata(dev); > >> > - return sprintf(buf, "%#x\n", ab8500 ? ab8500->chip_id : -EINVAL); > >> > + if(ab8500) { > >> > + chip_id = ab8500->chip_id; > >> > + if((is_ab8505(ab8500) || is_ab9540(ab8500)) && ab8500->version != 0xFF) > >> > + chip_id = (ab8500->version << 8) | chip_id; > >> > + } > >> > + return sprintf(buf, "%#x\n", chip_id); > >> > } > >> > >> What's the use of printing "ffffffea" for unknown versions here? > > > > You mean instead of -EINVAL? No idea, Marcus? > > > Looks like I'm guilty of just making the minimal changes. Arnd is > right though, getting ffffffea(-EINVAL) back is pretty useless. > I'll have to check user land to see what is using this. Yes, it would be useful to know how it's parsed. Thanks Marcus. > Maybe not > printing and returning 0 should be the correct behaviour > when an unknown version is found. -- Lee Jones Linaro ST-Ericsson Landing Team Lead Linaro.org ? Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog