linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Green <andy-/Zus8d0mwwtBDgjK7y7TUQ@public.gmane.org>
To: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org
Cc: patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	Steve Glendinning
	<steve.glendinning-sdUf+H5yV5I@public.gmane.org>,
	Andy Green <andy.green-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Subject: [RFC PATCH 5/5] USBNET: SMSC95XX: if mac set in platform data no need for random one
Date: Sat, 12 Mar 2011 22:51:09 +0000	[thread overview]
Message-ID: <20110312225109.27728.88417.stgit@otae.warmcat.com> (raw)
In-Reply-To: <20110312224440.27728.60593.stgit-MbR9/eEqKADKkTgpAXvmkg@public.gmane.org>

This is part of an RFC patch series introducing asynchronous platform
data, which may be attached to discovered bus devices at probe time
based on the device path.

As part of the series, platform_data is enabled in usbnet layer.

This patch allows smsc95xx usbnet driver to understand that the MAC
setting was handled by plaform_data sent into usbnet, and that it
does not need to overwrite the already correct MAC with a random one.

Cc: Steve Glendinning <steve.glendinning-sdUf+H5yV5I@public.gmane.org>
Signed-off-by: Andy Green <andy.green-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---

 drivers/net/usb/smsc95xx.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index bc86f4b..1d09cad 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -639,6 +639,16 @@ static int smsc95xx_ioctl(struct net_device *netdev, struct ifreq *rq, int cmd)
 
 static void smsc95xx_init_mac_address(struct usbnet *dev)
 {
+	struct usbnet_platform_data *pdata = dev->udev->dev.platform_data;
+
+	/*
+	 * if netdev platform data has taken responsibility for forcing
+	 * the MAC then nothing to do here
+	 */
+
+	if (pdata && pdata->flags & USBNET_PLATDATA_FLAG__USE_MAC)
+		return;
+
 	/* try reading mac address from EEPROM */
 	if (smsc95xx_read_eeprom(dev, EEPROM_MAC_OFFSET, ETH_ALEN,
 			dev->net->dev_addr) == 0) {

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2011-03-12 22:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-12 22:50 [RFC PATCH 0/5] OMAP2+ / Panda implementation for async platform_data Andy Green
2011-03-12 22:50 ` [RFC PATCH 1/5] OMAP2+: Panda introduce async platform data definition Andy Green
2011-03-13  1:05   ` Greg KH
2011-03-12 22:50 ` [RFC PATCH 2/5] OMAP2+: add cpu id register to MAC address helper Andy Green
2011-03-18  8:34   ` Arnd Bergmann
2011-03-18  8:49     ` Andy Green
2011-03-18 14:37     ` Premi, Sanjeev
     [not found]       ` <B85A65D85D7EB246BE421B3FB0FBB593024C3B8670-/tLxBxkBPtCIQmiDNMet8wC/G2K4zDHf@public.gmane.org>
2011-03-18 14:47         ` Andy Green
     [not found]   ` <20110312225047.27728.1835.stgit-MbR9/eEqKADKkTgpAXvmkg@public.gmane.org>
2011-03-18  8:52     ` Roger Quadros
     [not found]       ` <4D831D4B.8090407-xNZwKgViW5gAvxtiuMwx3w@public.gmane.org>
2011-03-18  9:13         ` Andy Green
2011-03-12 22:50 ` [RFC PATCH 3/5] OMAP2+:Common CPU DIE ID reading code reads wrong registers for OMAP4430 Andy Green
2011-03-14 18:12   ` Tony Lindgren
2011-03-12 22:51 ` [RFC PATCH 4/5] OMAP2+: Set onboard Ethernet MAC address using unique CPU ID data Andy Green
     [not found] ` <20110312224440.27728.60593.stgit-MbR9/eEqKADKkTgpAXvmkg@public.gmane.org>
2011-03-12 22:51   ` Andy Green [this message]

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=20110312225109.27728.88417.stgit@otae.warmcat.com \
    --to=andy-/zus8d0mwwtbdgjk7y7tuq@public.gmane.org \
    --cc=andy.green-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=patches-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=steve.glendinning-sdUf+H5yV5I@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).