From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Heiko =?ISO-8859-1?Q?St=FCbner?= Subject: Re: [PATCH] mmc: dw_mmc: move rockchip related code to a separate file Date: Fri, 15 Aug 2014 21:52:32 +0200 Message-ID: <5377586.rAxPyABi4v@diego> In-Reply-To: References: <1406786498-3935-1-git-send-email-addy.ke@rock-chips.com> <1408003293-27375-1-git-send-email-addy.ke@rock-chips.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" To: Doug Anderson Cc: Addy Ke , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Randy Dunlap , Seungwon Jeon , Jaehoon Chung , Chris Ball , Ulf Hansson , Dinh Nguyen , Olof Johansson , "devicetree@vger.kernel.org" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-mmc@vger.kernel.org" , "zhenfu.fang" , Eddie Cai , lintao , chenfen , zyf , Jianqun Xu , Tao Huang , Chris , =?utf-8?B?5ae a5pm65oOF?= , han jiang , Kever Yang , zhangqing , Lin Huang List-ID: Am Donnerstag, 14. August 2014, 10:09:55 schrieb Doug Anderson: > Addy, > > On Thu, Aug 14, 2014 at 1:01 AM, Addy Ke wrote: > > diff --git a/drivers/mmc/host/dw_mmc-rockchip.c > > b/drivers/mmc/host/dw_mmc-rockchip.c new file mode 100644 > > index 0000000..3d86ef3 > > --- /dev/null > > +++ b/drivers/mmc/host/dw_mmc-rockchip.c [...] > > +static int dw_mci_rockchip_probe(struct platform_device *pdev) > > +{ > > + const struct dw_mci_drv_data *drv_data; > > + const struct of_device_id *match; > > + > > + match = of_match_node(dw_mci_rockchip_match, pdev->dev.of_node); > > Your code doesn't have "if (pdev->dev.of_node)". That's OK (I think) > but it means that your KConfig needs a "depends on OF", right? Almost all of_* functions have stubs for the !CONFIG_OF case [0]. Instead I guess this simply needs a if (!pdev->dev.of_node) return -ENODEV; to handle the case when there is no of_node. Heiko [0] http://lxr.free-electrons.com/source/include/linux/of.h#L585