From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Jones Subject: Re: [PATCH v2 2/5] MFD: RK808: Add new mfd driver for RK808 Date: Wed, 27 Aug 2014 12:27:09 +0100 Message-ID: <20140827112709.GB6364@lee--X1> References: <1408505461-24200-1-git-send-email-zyw@rock-chips.com> <20140820092117.GI4266@lee--X1> <53FA9D1E.8040202@rock-chips.com> <20140826092205.GG9574@lee--X1> <20140826162831.GA22842@core.coreip.homeip.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: <20140826162831.GA22842-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Dmitry Torokhov Cc: Chris Zhong , robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, pawel.moll-5wv7dgnIgG8@public.gmane.org, mark.rutland-5wv7dgnIgG8@public.gmane.org, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org, galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org, sameo-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org, mturquette-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org, grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, hl-TNX95d0MmH7DzftRWevZcw@public.gmane.org, huangtao-TNX95d0MmH7DzftRWevZcw@public.gmane.org, cf-TNX95d0MmH7DzftRWevZcw@public.gmane.org, zhangqing-TNX95d0MmH7DzftRWevZcw@public.gmane.org, xxx-TNX95d0MmH7DzftRWevZcw@public.gmane.org, dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org, olof-nZhT3qVonbNeoWH0uzbU5w@public.gmane.org, sonnyrao-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, dtor-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org, javier.martinez-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org, kever.yang-TNX95d0MmH7DzftRWevZcw@public.gmane.org List-Id: devicetree@vger.kernel.org On Tue, 26 Aug 2014, Dmitry Torokhov wrote: > On Tue, Aug 26, 2014 at 10:22:05AM +0100, Lee Jones wrote: > > On Mon, 25 Aug 2014, Chris Zhong wrote: > > > On 08/20/2014 05:21 PM, Lee Jones wrote: > > > >On Wed, 20 Aug 2014, Chris Zhong wrote: > > > > > > > >>The RK808 chip is a power management IC for multimedia and hand= held > > > >>devices. It contains the following components: > > > >> > > > >>- Regulators > > > >>- RTC > > > >> > > > >>The rk808 core driver is registered as a platform driver and pr= ovides > > > >>communication through I2C with the host device for the differen= t > > > >>components. > > > >> > > > >>Signed-off-by: Chris Zhong > > > >>--- > >=20 > > [...] > >=20 > > > >>+ rk808->pdata =3D pdata; > > > >Remove pdata from 'struct rk808'. You can obtain it from dev. > > >=20 > > > Can I keep this pdata in rk808, because it is used in the regulat= or driver. > > > The one obtain from dev maybe empty. > >=20 > > If the one in dev is empty, you should populate that instead. >=20 > No, drivers should not populate platform data in devices - they do no= t > own it (unlike drvdata). Platform data should be read-only so that if > one would unbind and then try to re-bind the driver we'd end up in > exactly same state as before. Right. I guess this point is moot now, as my other point about pdata not actually being required has been accecpted. But, when I say "you can obtain it from dev" I meant via dev_get_platdata(dev), rather than dev_get_platdata(dev->parent). So if this 'pdata' has to go somewhere, rather than sticking it in the MFD's (parent) platform_data, the =2Eplatform_data attribute in 'struct mfd_cell' should be used. > For DT systems we should be allocating platform data separately and m= ake > sure we clean up after ourselves. --=20 Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org =E2=94=82 Open source software for ARM SoCs =46ollow Linaro: Facebook | Twitter | Blog -- To unsubscribe from this list: send the line "unsubscribe devicetree" i= n the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html