Re: [PATCH RESEND v2 1/4] mfd: intel_soc_pmic: Core driver

2014-05-28 Thread Mark Brown
On Wed, May 28, 2014 at 08:55:11AM +0800, Zhu, Lejun wrote: > Oh I see. Sorry I missed your point. So you are saying "int > intel_soc_pmic_readb(int reg)" is bad, but if I have: > int intel_soc_pmic_readb(struct intel_soc_pmic *pmic, int reg) > { > int ret; > unsigned int val; > >

Re: [PATCH RESEND v2 1/4] mfd: intel_soc_pmic: Core driver

2014-05-27 Thread Zhu, Lejun
On 5/27/2014 7:20 PM, Mark Brown wrote: > On Tue, May 27, 2014 at 08:48:58AM +0800, Zhu, Lejun wrote: >> On 5/26/2014 10:51 PM, Mark Brown wrote: > We created these names to hide the implementation of how read/write is done from other platform specific patches interacting with this driv

Re: [PATCH RESEND v2 1/4] mfd: intel_soc_pmic: Core driver

2014-05-27 Thread Mark Brown
On Tue, May 27, 2014 at 08:48:58AM +0800, Zhu, Lejun wrote: > On 5/26/2014 10:51 PM, Mark Brown wrote: > >> We created these names to hide the implementation of how read/write is > >> done from other platform specific patches interacting with this driver. > >> So when we change the implementation,

Re: [PATCH RESEND v2 1/4] mfd: intel_soc_pmic: Core driver

2014-05-26 Thread Zhu, Lejun
On 5/26/2014 10:51 PM, Mark Brown wrote: > On Mon, May 26, 2014 at 02:01:11PM +0800, Zhu, Lejun wrote: >> On 5/24/2014 1:49 AM, Mark Brown wrote: > >>> There should also be no need to add extra locking around regmap calls, >>> the regmap API has locking as standard. > >> Actually it also protec

Re: [PATCH RESEND v2 1/4] mfd: intel_soc_pmic: Core driver

2014-05-26 Thread Mark Brown
On Mon, May 26, 2014 at 02:01:11PM +0800, Zhu, Lejun wrote: > On 5/24/2014 1:49 AM, Mark Brown wrote: > > There should also be no need to add extra locking around regmap calls, > > the regmap API has locking as standard. > Actually it also protects the pmic variable, so it won't be set to NULL >

Re: [PATCH RESEND v2 1/4] mfd: intel_soc_pmic: Core driver

2014-05-25 Thread Zhu, Lejun
On 5/24/2014 1:49 AM, Mark Brown wrote: > On Fri, May 23, 2014 at 08:40:26AM +0800, Zhu, Lejun wrote: > >> +struct device *intel_soc_pmic_dev(void) >> +{ >> +return pmic->dev; >> +} >> +EXPORT_SYMBOL(intel_soc_pmic_dev); > > Why do you need to take a global reference to this? It was used b

Re: [PATCH RESEND v2 1/4] mfd: intel_soc_pmic: Core driver

2014-05-23 Thread Mark Brown
On Fri, May 23, 2014 at 08:40:26AM +0800, Zhu, Lejun wrote: > +struct device *intel_soc_pmic_dev(void) > +{ > + return pmic->dev; > +} > +EXPORT_SYMBOL(intel_soc_pmic_dev); Why do you need to take a global reference to this? > +/* > + * Read from a PMIC register > + */ > +int intel_soc_pmic_