From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Jones Subject: Re: [PATCH v6 2/5] MFD: RK808: Add new mfd driver for RK808 Date: Wed, 27 Aug 2014 18:02:51 +0100 Message-ID: <20140827170251.GB24579@lee--X1> References: <1409062444-12019-1-git-send-email-zyw@rock-chips.com> <20140827133936.GD6364@lee--X1> 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: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Doug Anderson Cc: Chris Zhong , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Samuel Ortiz , Liam Girdwood , "broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org" , Alessandro Zummo , Mike Turquette , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org, Grant Likely , Lin Huang , Tao Huang , Eddie Cai , zhangqing , xxx , Heiko =?iso-8859-1?Q?St=FCbner?= , Olof Johansson , Sonny Rao List-Id: devicetree@vger.kernel.org On Wed, 27 Aug 2014, Doug Anderson wrote: > On Wed, Aug 27, 2014 at 6:39 AM, Lee Jones wro= te: > >> +static int rk808_probe(struct i2c_client *client, > >> + const struct i2c_device_id *id) > >> +{ > >> + int ret; > >> + int pm_off =3D 0; > >> + struct rk808 *rk808; > >> + struct device_node *np =3D client->dev.of_node; > > > > Are you prepared for np =3D=3D NULL? >=20 > Given that the driver no longer supports getting its config from > platform data, I think it simply depends on OF now. It seems like we > could add a "&& OF" to the dependencies. Is that OK with you? If the driver depends on OF, then it should be specified in the Kconfig= =2E > It doesn't hurt to still add a check for np =3D=3D NULL and bail out,= though. If we're depending on OF, then there's no real need to do this. And of_property_read_bool() does a NULL check on np anyway, so not checking is still okay. I was just wondering if not checking was a mistake or intentional? --=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