mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/4] arm: imx: iim/ocotp: fix link error when !CONFIG_NET
Date: Thu, 27 Nov 2014 16:54:19 +0100	[thread overview]
Message-ID: <1417103660-32348-3-git-send-email-l.stach@pengutronix.de> (raw)
In-Reply-To: <1417103660-32348-1-git-send-email-l.stach@pengutronix.de>

Don't try to attach mac to device if there is no net support selected.
Fixes:
undefined reference to `dev_add_param_mac' in both iim and ocotp drivers.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
---
 arch/arm/mach-imx/iim.c   | 3 ++-
 arch/arm/mach-imx/ocotp.c | 6 ++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-imx/iim.c b/arch/arm/mach-imx/iim.c
index 2546b921f109..d082d2d9a5dc 100644
--- a/arch/arm/mach-imx/iim.c
+++ b/arch/arm/mach-imx/iim.c
@@ -371,7 +371,8 @@ static void imx_iim_init_dt(struct device_d *dev, struct iim_priv *iim)
 			dev_err(dev, "cannot read: %s\n", strerror(-ret));
 		}
 
-		imx_iim_add_mac_param(iim, macnum, bank, offset);
+		if (IS_ENABLED(CONFIG_NET))
+			imx_iim_add_mac_param(iim, macnum, bank, offset);
 		macnum++;
 
 		len -= MAC_ADDRESS_PROPLEN;
diff --git a/arch/arm/mach-imx/ocotp.c b/arch/arm/mach-imx/ocotp.c
index 837500fff886..5912d7586684 100644
--- a/arch/arm/mach-imx/ocotp.c
+++ b/arch/arm/mach-imx/ocotp.c
@@ -432,8 +432,10 @@ static int imx_ocotp_probe(struct device_d *dev)
 				NULL, NULL, &priv->permanent_write_enable, NULL);
 	}
 
-	dev_add_param_mac(&(priv->dev), "mac_addr", imx_ocotp_set_mac,
-			imx_ocotp_get_mac, priv->ethaddr, priv);
+	if (IS_ENABLED(CONFIG_NET))
+		dev_add_param_mac(&(priv->dev), "mac_addr", imx_ocotp_set_mac,
+				imx_ocotp_get_mac, priv->ethaddr, priv);
+
 	dev_add_param_bool(&(priv->dev), "sense_enable", NULL, NULL, &priv->sense_enable, priv);
 
 	return 0;
-- 
2.1.3


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2014-11-27 15:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-27 15:54 [PATCH 1/4] usb: musb: only build musb_barebox if host is enabled Lucas Stach
2014-11-27 15:54 ` [PATCH 2/4] rtc: select GREGORIAN_CALENDER Lucas Stach
2014-11-27 15:54 ` Lucas Stach [this message]
2014-11-27 15:54 ` [PATCH 4/4] net: rtl8139: depend on MIPS Lucas Stach
2014-11-27 16:13 ` [PATCH 1/4] usb: musb: only build musb_barebox if host is enabled Sascha Hauer

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=1417103660-32348-3-git-send-email-l.stach@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=barebox@lists.infradead.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