devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Guo <shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org
Cc: linaro-dev-cunTk1MwBs8s++Sfvej+rw@public.gmane.org,
	patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org
Subject: [PATCH] net/fec: fix compile error introduced by dt support
Date: Fri, 25 Mar 2011 15:13:58 +0800	[thread overview]
Message-ID: <1301037238-4031-1-git-send-email-shawn.guo@linaro.org> (raw)

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 <shawn.guo@linaro.org>
---
 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;
 
-- 
1.7.1

_______________________________________________
devicetree-discuss mailing list
devicetree-discuss@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/devicetree-discuss

             reply	other threads:[~2011-03-25  7:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-25  7:13 Shawn Guo [this message]
     [not found] ` <1301037238-4031-1-git-send-email-shawn.guo-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2011-03-31 16:09   ` [PATCH] net/fec: fix compile error introduced by dt support Grant Likely
     [not found]     ` <20110331160940.GF26709-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2011-04-01  7:49       ` Shawn Guo
     [not found]         ` <20110401074916.GI25866-+NayF8gZjK2ctlrPMvKcciBecyulp+rMXqFh9Ls21Oc@public.gmane.org>
2011-04-05  4:54           ` Grant Likely
     [not found]             ` <20110405045400.GA28956-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2011-05-05 15:18               ` [PATCH v2] " Shawn Guo
2011-05-05 15:20               ` [PATCH] " Shawn Guo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1301037238-4031-1-git-send-email-shawn.guo@linaro.org \
    --to=shawn.guo-qsej5fyqhm4dnm+yrofe0a@public.gmane.org \
    --cc=devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org \
    --cc=linaro-dev-cunTk1MwBs8s++Sfvej+rw@public.gmane.org \
    --cc=patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).