Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp970286imm; Wed, 8 Aug 2018 08:38:21 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyuemrng1KREb0iSbo5sX0Es3SdMkpGyWa0GK5x3qXmE9rhMrXHM3fA9gQqk66YIiJkrUi2 X-Received: by 2002:a17:902:708b:: with SMTP id z11-v6mr3025761plk.262.1533742701204; Wed, 08 Aug 2018 08:38:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533742701; cv=none; d=google.com; s=arc-20160816; b=rjjchHBmQAOPjxs75ZXhQrLQpGnUwBXDHmBaigHHkgzBs3ijJpZqth/qugHfnoUUgy IbwyRflbBGnzEjlvYNVJGbpjeZL4CGDeU1qWfJiQhTCzYSLZicQOEG50I4OMdx6R9psb H+yKANtByyEQKVREnV9rRzkPehHYrgeuHlPzz86e3x+FaRV7DRbk7WjP7cL/Fr6Fpn0g 4kta81OIKzMizSMsTJrWZtTXkUKDBeZyjHaa5Ub45bAgDDccR9h9iM3UsFpjayZKDkSB m/KaGLfQ3W102VC/qi/gVoiEaLblDQ+rvjH9CPlcPLswvn+qw/t48lo5X9g6jAtjQ/sD AGMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=8UdSyH1lOqINYeO+r/ZsFoxAxuXuxmjPqoo8dlrZx/U=; b=XitY74S9+ugfGKa1LzeUUFXPMRWYMQwsD22KJwZp6NX/dycqW7RGAVrpOxvKAHaTnl vyA3DfXaKPlpqJixZz8Nq2XlqxIRrrfsn/+3GXiReJQ3GgvhUFjIt19b/kKbWhs4fU16 Uw1TZqbQ/AV+dGOLtLJcjZHnlUAGwdnuH2aCWZGOSFtuuB4QV/kqeU4inLW9CL7KtTJm cVJhJvLfJnd+MOVR6ASvTWeF1vv5iNTNfws1aoKwE3UBIbhBNxzfX7AaBA4WUpVvit9I OjrrzNL+//uSRy3UPbBgGpiKJJq2KLMR13ieMBd+xG1u4EQARmu7s2knrW6K8of4iGQi F4hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=C2WWfRY4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6-v6si4527227pgh.50.2018.08.08.08.38.06; Wed, 08 Aug 2018 08:38:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=C2WWfRY4; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729221AbeHHRyL (ORCPT + 99 others); Wed, 8 Aug 2018 13:54:11 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:37444 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729652AbeHHRyK (ORCPT ); Wed, 8 Aug 2018 13:54:10 -0400 Received: by mail-wr1-f68.google.com with SMTP id u12-v6so2412759wrr.4 for ; Wed, 08 Aug 2018 08:33:59 -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=C2WWfRY4OGQFixB3NWDziO1RloZdC5VKqUI28ihiyz/MSJfGy4l7a6UducfkAOKq67 UsOMLJx1OlZBcl3LuNHmZS3D0ixwzGNI59pu+2Klhl/y/dRAwLh/lmEAsW6F/n8VU+zx dRb8PIoIT4Y+7jzPPLPUyK/FRX/aGyLrZ9PqhHJDzmbUWiIXrHzHw9O5OwDSzhtMlg7T VX330EfpGsSD+uQMIeb8DGKeW7hMsl+YnAkX8djOaYxJeLiFmCmO1LsJRS92JokpUIks 24mA6u1gyxXTFxGGCrJHSxVSK5yx2bmHxL6WAgy6wNn+zJ5YeyVL9omuAKd6J4O/XV1y vc2g== 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=L7GVbYeOVbYrUcsuc5kTVc1XvWeBMmhRym5Qnw2fPpDJ0DuO8ipICAQtqL+zIlOG/+ f4+E6xs6zWUFSWhGDO4v1qIw702x4rPXPAIVbtrpZJd4rOwSow7xVLNbNjdizu/L80CM rghRYy4AAbz98DyeDXaCA5v9e8J3o2VUPn6CGIf137d9XPbkntX4GMn/upHim6AHZ9Su ZRe5EUHhne2BR7hj67ZgKCx4/unS6NurRsEwCnPtTp3Xnry307XZMZON+fUJpJ4fwRRx lpX3YeqOtXoNEYKe+7A8vAI86i+AfiIpGQJi14PcKtkOXEqzI1VnCM2YqthbxTYIoA4w 5umA== X-Gm-Message-State: AOUpUlFgNsbsya4hY4xrs2pbqR0PLfDmGd/7WSsis3dmSI/j1KTVnWCn 5Uron2Rv860te+PEoG6I5uWjZg== X-Received: by 2002:adf:8362:: with SMTP id 89-v6mr2320257wrd.147.1533742438492; Wed, 08 Aug 2018 08:33:58 -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 s2-v6sm5240915wrw.52.2018.08.08.08.33.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Aug 2018 08:33:57 -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 Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-mtd@lists.infradead.org, linux-omap@vger.kernel.org, netdev@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 16/28] net: davinci_emac: use eth_platform_get_mac_address() Date: Wed, 8 Aug 2018 17:31:38 +0200 Message-Id: <20180808153150.23444-17-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180808153150.23444-1-brgl@bgdev.pl> References: <20180808153150.23444-1-brgl@bgdev.pl> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.18.0