From patchwork Sat Mar 12 22:51:09 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Green X-Patchwork-Id: 630791 X-Patchwork-Delegate: tony@atomide.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2CMpZRw023162 for ; Sat, 12 Mar 2011 22:51:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756240Ab1CLWvQ (ORCPT ); Sat, 12 Mar 2011 17:51:16 -0500 Received: from mail-ww0-f44.google.com ([74.125.82.44]:57222 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752530Ab1CLWvN (ORCPT ); Sat, 12 Mar 2011 17:51:13 -0500 Received: by wwa36 with SMTP id 36so4421041wwa.1 for ; Sat, 12 Mar 2011 14:51:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:sender:from:subject:to:cc:date:message-id :in-reply-to:references:user-agent:mime-version:content-type :content-transfer-encoding; bh=lMwvkeM7OfSPD+5p15b4nLXjhENJPu5JBgUAQYpuomE=; b=D3gEptLS85Sry/RUQIFV4EvT6HYkHzfoJ1hGiFV3n1OfjU8pZpPRJSXkasQm22p+Jl eJ+wNvSC3YuJRruu0FcbuUCuQWzSfXlvl31YuQLgPoAEbhbUy0U3uLq6XkPsfsToq5T3 Fz3Tl40bC775plUNgL6flmomwm1IOmQPJOrzc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=sender:from:subject:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; b=d0g+cdlCcDHajPFKlT0vHbIr71IdQ95PYvcC5Y2CoDGEbuQSJLjaJbdQPaPMHVzY3G DuLGzlVuBJRM65XO5h+gciJj2Zvi4lKl7ypKSEH4R/3ykMxt5hECDgLTmmCJqE6TPWWn 42rkxxV4QoPglTXs3BiFqfEGtfjR6//pBESOE= Received: by 10.216.25.136 with SMTP id z8mr847121wez.93.1299970272252; Sat, 12 Mar 2011 14:51:12 -0800 (PST) Received: from otae.warmcat.com (s15404224.onlinehome-server.info [87.106.134.80]) by mx.google.com with ESMTPS id h39sm2975606wes.5.2011.03.12.14.51.11 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 12 Mar 2011 14:51:11 -0800 (PST) From: Andy Green Subject: [RFC PATCH 5/5] USBNET: SMSC95XX: if mac set in platform data no need for random one To: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: patches@linaro.org, Steve Glendinning , Andy Green Date: Sat, 12 Mar 2011 22:51:09 +0000 Message-ID: <20110312225109.27728.88417.stgit@otae.warmcat.com> In-Reply-To: <20110312224440.27728.60593.stgit@otae.warmcat.com> References: <20110312224440.27728.60593.stgit@otae.warmcat.com> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 12 Mar 2011 22:51:35 +0000 (UTC) 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) {