From patchwork Wed Aug 8 15:31:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10560231 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 4C60F15A6 for ; Wed, 8 Aug 2018 15:36:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38E1B2B014 for ; Wed, 8 Aug 2018 15:36:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CED02B0E3; Wed, 8 Aug 2018 15:36:01 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8C572AE8E for ; Wed, 8 Aug 2018 15:36:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729703AbeHHRyL (ORCPT ); Wed, 8 Aug 2018 13:54:11 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:33899 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729221AbeHHRyK (ORCPT ); Wed, 8 Aug 2018 13:54:10 -0400 Received: by mail-wr1-f65.google.com with SMTP id c13-v6so2426358wrt.1 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=OccENX0PRcZQJrqjZbs8gfhaSr9G71v8fOFrbyOkkNychqyM2sOo6OgA57e8j/e0uo J7kM6s+Sk+VwL9tKnD1kfDoW/nXVWGJyqr5FWbcwOWa+Z2nRMbOPl1O7ukaSn8XR2bjN UuopXiBtsDxvJRti23iQNOQj8a4SqJBDRtpkt0hFu6jFVr319GD+PRfMcsYFdGQjsSiO aSsKCVyFa9xc1HgHx7YuV0jux02LZ8SFc9eRdh6Jvbj7Fjv1TmilOtZ1S9KNL0mycwew MaJDtox/Ij5eHmKS5B64XEzjJDRF36wijpjaUSJ3Lc1htPCKO2FusF34qq9mSUZ2nWx6 Hnfw== X-Gm-Message-State: AOUpUlE/CCF5IdW05+BqJp94sjhvbB6GwLosVaRA0X3GCgFULpyQ5P9p 1HWxxhCkKVDjHROd6Rz7gG2N/g== X-Google-Smtp-Source: AA+uWPzK9N3srWQOKZizp+e36Bb1tujnskBeB665f8ip+bKvJb9nbUnCV0l1aVqnV0EM3B2GUzqrng== 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-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.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;