From patchwork Fri Mar 25 07:13:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 783 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:45:45 -0000 Delivered-To: patches@linaro.org Received: by 10.42.161.68 with SMTP id s4cs158442icx; Fri, 25 Mar 2011 00:10:42 -0700 (PDT) Received: by 10.231.111.228 with SMTP id t36mr448439ibp.59.1301037042204; Fri, 25 Mar 2011 00:10:42 -0700 (PDT) Received: from mail-iy0-f178.google.com (mail-iy0-f178.google.com [209.85.210.178]) by mx.google.com with ESMTPS id a6si1948799ibb.23.2011.03.25.00.10.41 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 Mar 2011 00:10:42 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) client-ip=209.85.210.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.178 is neither permitted nor denied by best guess record for domain of shawn.guo@linaro.org) smtp.mail=shawn.guo@linaro.org Received: by iyi12 with SMTP id 12so949624iyi.37 for ; Fri, 25 Mar 2011 00:10:40 -0700 (PDT) Received: by 10.42.132.5 with SMTP id b5mr688897ict.484.1301037040581; Fri, 25 Mar 2011 00:10:40 -0700 (PDT) Received: from localhost.localdomain ([121.228.78.112]) by mx.google.com with ESMTPS id g17sm469227ibb.23.2011.03.25.00.10.31 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 25 Mar 2011 00:10:39 -0700 (PDT) From: Shawn Guo To: devicetree-discuss@lists.ozlabs.org Cc: linaro-dev@lists.linaro.org, patches@linaro.org, Shawn Guo Subject: [PATCH] net/fec: fix compile error introduced by dt support Date: Fri, 25 Mar 2011 15:13:58 +0800 Message-Id: <1301037238-4031-1-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 After fec dt support is added, the following compile error will be seen when building a pure non-dt kernel. drivers/net/fec.c: In function ‘fec_probe’: drivers/net/fec.c:1383: error: implicit declaration of function ‘of_match_device’ drivers/net/fec.c:1383: warning: assignment makes pointer from integer without a cast This patch is to fix the error. Signed-off-by: Shawn Guo --- drivers/net/fec.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/drivers/net/fec.c b/drivers/net/fec.c index b57f879..ffb1e75 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c @@ -85,8 +85,19 @@ static const struct of_device_id fec_dt_ids[] = { { .compatible = "fsl,imx51-fec", .data = &fec_devtype[0], }, {}, }; + +static const struct of_device_id * +fec_get_of_device_id(struct platform_device *pdev) +{ + return of_match_device(fec_dt_ids, &pdev->dev); +} #else #define fec_dt_ids NULL +static inline struct of_device_id * +fec_get_of_device_id(struct platform_device *pdev) +{ + return NULL; +} #endif static unsigned char macaddr[ETH_ALEN]; @@ -1380,7 +1391,7 @@ fec_probe(struct platform_device *pdev) struct resource *r; const struct of_device_id *of_id; - of_id = of_match_device(fec_dt_ids, &pdev->dev); + of_id = fec_get_of_device_id(pdev); if (of_id) pdev->id_entry = (struct platform_device_id *)of_id->data;