From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752548AbcBFSMU (ORCPT ); Sat, 6 Feb 2016 13:12:20 -0500 Received: from saturn.retrosnub.co.uk ([178.18.118.26]:41020 "EHLO saturn.retrosnub.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751923AbcBFSMS (ORCPT ); Sat, 6 Feb 2016 13:12:18 -0500 Subject: Re: [PATCH v3] iio: adc: Add TI ADS1015 ADC driver support To: Daniel Baluta , Michael Welling References: <1454518796-10897-1-git-send-email-daniel.baluta@intel.com> <20160203181919.GD25464@deathstar> Cc: Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Linux Kernel Mailing List , "linux-iio@vger.kernel.org" , Lucas De Marchi , linux@roeck-us.net, eibach@gdsys.de From: Jonathan Cameron Message-ID: <56B6377F.10807@kernel.org> Date: Sat, 6 Feb 2016 18:12:15 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/02/16 12:51, Daniel Baluta wrote: >> Would it be more consistent to handle the mutex outside of the switch above similar >> to how it is handled in ads1015_write_raw? >> >> Also the ads1015_set_power_state(data, false) is called either way so why not just >> use one call? >> > > I don't have a strong preference for that. I think across IIO drivers > we can find both coding practices. Often we move it into the switch because in most driver some of the read_raw elements don't need to query the hardware (scales are often fixed for example) so we don't need to take the lock for them. Here it makes sense to take the lock. (Not that I care much either way!) > > Indeed consistency with ads1015_write_raw is a good argument. Will fix it. > > I will leave the code here for one more day and then send an updated version. > > thanks, > Daniel. > -- > To unsubscribe from this list: send the line "unsubscribe linux-iio" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >