From patchwork Fri Aug 10 08:05:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562443 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1E8E61390 for ; Fri, 10 Aug 2018 08:23:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AD3A2881D for ; Fri, 10 Aug 2018 08:23:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F07DF2B3DE; Fri, 10 Aug 2018 08:23:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 960F32881D for ; Fri, 10 Aug 2018 08:23:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=yPT43/R2ngUwf6MNcwcE9DygpQA9pKdjL783bjpY1Gg=; b=Q0G5/S0NPTvL0WBMlyAdsz9bAk aEwUNbzaQFsz40in6SXIIrczuWy1cqIwMd0EAVBziwvSMxkEXkKeKLtiwkh884U1x+1yaLUalHsbf 3gUiSw0YkME71eJ3KSAKSR0XeFNqyYPLqvUFDqfZPJjyziaNwDK8t5kOQG+1zDj+ORwcYLg/g20GR 0mAugjS+1CSm+thZmX96EHOM28JNR36VlY57qDDbX8Rgr3eP8pjICfENVzY+hibz2s1YhFrEtvAPf I2dsF7zSWUfvlOTZmNzTOgCPXYJoykRcw7bp2b0esMZecoVMZibZiFtSHBOK+Yxw0q4Y0tenu9TxE J1VL4KYA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2hp-0000tV-6b; Fri, 10 Aug 2018 08:23:33 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2ge-0007aF-Q6 for linux-arm-kernel@bombadil.infradead.org; Fri, 10 Aug 2018 08:22:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=8UdSyH1lOqINYeO+r/ZsFoxAxuXuxmjPqoo8dlrZx/U=; b=Qg9l1vkeVBiahB3DJm4qmc0vN FJ2BOGO/l2Ydl05FNITBbtyOJ0SkVS5T8ZOSqHQd7r+XrKVau49CyqAkOYUSw4SwD3kCUp8dsXrW6 /jmSzZr9BsVxPlVw5oWNTq1OJwbA3t18JnC193YTSRADZvrZjvpzdlbEjOxLRex3bcFj5fAr3MOg6 gOGQIAJ8B3IIpWBX0pSexEkBtERbQFxtXjr/j9FqxVQSyI32swJKVeURwwyOmH60hoicSV4X38K4Y 0nf0q0LLoTCKdgHAKKlSk+drwiCX9e3XtpEZidAeOKsHaKM2bC9DkYh1EAJNOnd1USRI7wKKwbBwR Ug73/4i1w==; Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2R5-0000YN-RR for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:06:17 +0000 Received: by mail-wr1-x442.google.com with SMTP id b15-v6so7447440wrv.10 for ; Fri, 10 Aug 2018 01:06:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8UdSyH1lOqINYeO+r/ZsFoxAxuXuxmjPqoo8dlrZx/U=; b=mt/KXDC4nfdwHLn2XlDBPM4y81ESlrV3OFQmRIJZkcXOGIiUGUng/VBMv8ne3TnYv/ AvKnsmK7kSXDKQpprVm4gAMTFMkx/qqFRaME6gp/TWgjRkeX6F57yIdIkvtnI16GWvyW qo2U5hnq5J1zzVsY8RFdkrOUyndUEOpQ4osdUWOZAO/uu9t2gNgoatiIyHyyH1k8bc+0 vr6GHJJkNiqTgZCHTDC14/Wx6wiNwKD5BMJV0W0m5E9sExbUqWganevGnP9mSmw2N/TO tHJm2ssDpmKuKzflbSb1q1g8LcF5w9GyRfGnjNs93IaD/bDN6iJuZ7zU068+hpt4Mc++ noEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=8UdSyH1lOqINYeO+r/ZsFoxAxuXuxmjPqoo8dlrZx/U=; b=SnG280SEg9gHu80+Kh492n5IJByRz9KAXQ7JSf2nRWvJv+IPcRM0ujPjTfXnIrtt3W xn8hz8NWI02kxhcn9fT1Fqy48tzRNaSSRbzd9JcKadWRn6EjKtpVYjnrQcUqjLCiIhEh mysutx5s9Qz9tmOZqhrzCiI1nUmIlTWpY6d9EzuvZ3UA1+ymYCMVorDf3IsaZpMf3WtI H3NZyrHxKxtStYckCi1upQ6d7Zv/zTRK80fxHVY3+srXtlIvswFtbDNnsIScy9Msy5Wv QHffqEVQXB03crb7Mew+gOIKIojmPibr3we6YJLScjRqIIalQZ1BXovm9+qBp7Y0+V2u uY3A== X-Gm-Message-State: AOUpUlFW45j0SfI2YG3fOkXYzEhyTHQ7GDwjxthucHYvtje27fBg4Gyl lJ5Gb/70nG/1NlL4sh2pdzTk7w== X-Google-Smtp-Source: AA+uWPwXvALBFOFWa75Ks0v22iEu5lNMBTlP+OzTuPP/ZK9R0ES25xlWVEHr5kXFii1o2Do3GQC7Tw== X-Received: by 2002:adf:fe8f:: with SMTP id l15-v6mr3583225wrr.165.1533888364864; Fri, 10 Aug 2018 01:06:04 -0700 (PDT) Received: from brgl-bgdev.lan (LFbn-MAR-1-609-89.w90-118.abo.wanadoo.fr. [90.118.185.89]) by smtp.gmail.com with ESMTPSA id h7-v6sm9546405wrs.8.2018.08.10.01.06.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:06:04 -0700 (PDT) From: Bartosz Golaszewski To: Jonathan Corbet , Sekhar Nori , Kevin Hilman , Russell King , Arnd Bergmann , Greg Kroah-Hartman , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Grygorii Strashko , "David S . Miller" , Srinivas Kandagatla , Naren , Mauro Carvalho Chehab , Andrew Morton , Lukas Wunner , Dan Carpenter , Florian Fainelli , Ivan Khoronzhuk , Sven Van Asbroeck , Paolo Abeni , Alban Bedel , Rob Herring , David Lechner , Andrew Lunn Subject: [PATCH v2 17/29] net: davinci_emac: use eth_platform_get_mac_address() Date: Fri, 10 Aug 2018 10:05:14 +0200 Message-Id: <20180810080526.27207-18-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180810080526.27207-1-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_090615_888173_EC4DD570 X-CRM114-Status: GOOD ( 20.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski We now support nvmem in eth_platform_get_mac_address() and all boards have the mac-address cells defined. Stop getting the MAC from pdata and use the dedicated helper. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/ti/davinci_emac.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c index f270beebb428..5d01bad4baa5 100644 --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c @@ -1700,7 +1700,6 @@ davinci_emac_of_get_pdata(struct platform_device *pdev, struct emac_priv *priv) const struct of_device_id *match; const struct emac_platform_data *auxdata; struct emac_platform_data *pdata = NULL; - const u8 *mac_addr; if (!IS_ENABLED(CONFIG_OF) || !pdev->dev.of_node) return dev_get_platdata(&pdev->dev); @@ -1712,12 +1711,6 @@ davinci_emac_of_get_pdata(struct platform_device *pdev, struct emac_priv *priv) np = pdev->dev.of_node; pdata->version = EMAC_VERSION_2; - if (!is_valid_ether_addr(pdata->mac_addr)) { - mac_addr = of_get_mac_address(np); - if (mac_addr) - ether_addr_copy(pdata->mac_addr, mac_addr); - } - of_property_read_u32(np, "ti,davinci-ctrl-reg-offset", &pdata->ctrl_reg_offset); @@ -1819,8 +1812,11 @@ static int davinci_emac_probe(struct platform_device *pdev) goto err_free_netdev; } + rc = eth_platform_get_mac_address(&pdev->dev, priv->mac_addr); + if (rc == -EPROBE_DEFER) + return -EPROBE_DEFER; /* We'll get the MAC address later. */ + /* MAC addr and PHY mask , RMII enable info from platform_data */ - memcpy(priv->mac_addr, pdata->mac_addr, ETH_ALEN); priv->phy_id = pdata->phy_id; priv->rmii_en = pdata->rmii_en; priv->version = pdata->version;