From patchwork Wed Sep 28 16:58:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Timur Tabi X-Patchwork-Id: 9354353 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1ECB46077B for ; Wed, 28 Sep 2016 17:01:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E3D129769 for ; Wed, 28 Sep 2016 17:01:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02D4029778; Wed, 28 Sep 2016 17:01:21 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 571D829769 for ; Wed, 28 Sep 2016 17:01:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bpICO-0002FQ-97; Wed, 28 Sep 2016 16:59:12 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bpICJ-0002BB-L8 for linux-arm-kernel@lists.infradead.org; Wed, 28 Sep 2016 16:59:08 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id BA69561860; Wed, 28 Sep 2016 16:58:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1475081928; bh=HQwJfg5thyajrSz6j+MTlnV09YMvfS5UYQq7RlrYULU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lTGpYl1po/QPlQHV6lsGLxuT48z88YLGg0aw1WQnmXP42cxBc07rZ3xkCiAv2HgzL aTEjEoGPFKiUjpNgwNBkKSvdTlbIeSowiDmUJbbnWSBd5u6xOjfBS75lzhw5vcbd/T VsNQfGkrpmMF6/KbSxKKJUs5kev+2TkSHc/h16GM= Received: from timur-ubuntu.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: timur@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id CC0F461849; Wed, 28 Sep 2016 16:58:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1475081928; bh=HQwJfg5thyajrSz6j+MTlnV09YMvfS5UYQq7RlrYULU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=lTGpYl1po/QPlQHV6lsGLxuT48z88YLGg0aw1WQnmXP42cxBc07rZ3xkCiAv2HgzL aTEjEoGPFKiUjpNgwNBkKSvdTlbIeSowiDmUJbbnWSBd5u6xOjfBS75lzhw5vcbd/T VsNQfGkrpmMF6/KbSxKKJUs5kev+2TkSHc/h16GM= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org CC0F461849 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=timur@codeaurora.org From: Timur Tabi To: netdev@vger.kernel.org, linaro-acpi@lists.linaro.org, linux-arm-kernel@lists.infradead.org, shankerd@codeaurora.org, vikrams@codeaurora.org, davem@davemloft.net Subject: [PATCH 2/3] [v2] net: qcom/emac: use device_get_mac_address Date: Wed, 28 Sep 2016 11:58:43 -0500 Message-Id: <1475081924-12362-3-git-send-email-timur@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1475081924-12362-1-git-send-email-timur@codeaurora.org> References: <1475081924-12362-1-git-send-email-timur@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160928_095907_859024_6E6CD9D1 X-CRM114-Status: GOOD ( 12.09 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Replace the DT-specific of_get_mac_address() function with device_get_mac_address, which works on both DT and ACPI platforms. This change makes it easier to add ACPI support. Signed-off-by: Timur Tabi --- drivers/net/ethernet/qualcomm/emac/emac.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/qualcomm/emac/emac.c b/drivers/net/ethernet/qualcomm/emac/emac.c index 429b4cb..551df1c 100644 --- a/drivers/net/ethernet/qualcomm/emac/emac.c +++ b/drivers/net/ethernet/qualcomm/emac/emac.c @@ -531,18 +531,16 @@ static void emac_clks_teardown(struct emac_adapter *adpt) static int emac_probe_resources(struct platform_device *pdev, struct emac_adapter *adpt) { - struct device_node *node = pdev->dev.of_node; struct net_device *netdev = adpt->netdev; struct resource *res; - const void *maddr; + char maddr[ETH_ALEN]; int ret = 0; /* get mac address */ - maddr = of_get_mac_address(node); - if (!maddr) - eth_hw_addr_random(netdev); - else + if (device_get_mac_address(&pdev->dev, maddr, ETH_ALEN)) ether_addr_copy(netdev->dev_addr, maddr); + else + eth_hw_addr_random(netdev); /* Core 0 interrupt */ ret = platform_get_irq(pdev, 0);