From patchwork Tue Nov 13 14:01:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10680749 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 B8B1F14E2 for ; Tue, 13 Nov 2018 14:04:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A641C2094F for ; Tue, 13 Nov 2018 14:04:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99E5F28684; Tue, 13 Nov 2018 14:04:31 +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.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 3939D2094F for ; Tue, 13 Nov 2018 14:04:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387930AbeKNAAf (ORCPT ); Tue, 13 Nov 2018 19:00:35 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:51376 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387851AbeKNAAe (ORCPT ); Tue, 13 Nov 2018 19:00:34 -0500 Received: by mail-wm1-f68.google.com with SMTP id w7-v6so12036745wmc.1 for ; Tue, 13 Nov 2018 06:02:16 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=ow7Ut1GNJ0NN6XzS8yWgikbMVrG9z5cqZIlLq+KQDIE=; b=bv00UTRtZfOTTESxlTwAP96Arhu8T5PCHrwxCFRnOc/Oew7CX7onM+8BVynHJ1ewPq H92YdHhZJxvAxuAQViJWKmgjAYYpAyxssPxW2bS73xu6kVuE1MeguhWX5zNNROFNt5IK Wkpq52HSVVGrkcsAPWyg78ES3X1G5fTD/xfkeux4KNE7/MgHAiXOzTffGrcjtKm9Zk3S 7XDqtNs/D3ERfaLn5rWXejg1atmqKKw22zrgVFAfiUhB7fq1hrNHA6aSNaav0JxqDX+2 eg51yFk5xxxQu8pxQgxFilbzRAe8Y2ynr3AO/XWyZVecGLfYoGdDWW7TlTuMAHRMwADY TCyQ== 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:mime-version:content-transfer-encoding; bh=ow7Ut1GNJ0NN6XzS8yWgikbMVrG9z5cqZIlLq+KQDIE=; b=CTbWq3KT0izT/K8ActYg/bcq6qMQKvH1drwoLFNqUAseWMUcdHNDrZPsM3do3sv6Tb qYzxaq/69ZMmUsvfFJJNXQwlIr2/hfhzEgcHw/52l1OCmk3UGqVUkjKOdVd3ROmme9i7 9/vkv8ia6iZBYlSDEDj8e/BbmYFTv/nIe7hEdst6F81akGALl9RMsUJAmhyXEYJd2txu A6oSaAHucCHKIO9UtBBw6+DqF78np101z1sNPHlB6wFs17rTdv6Ecvq2imhIaNQVwXww H9nuVwzzLPYjE+pGHJGNIJ5P0GO1pH7T2kj3Zb+RtKGpjXk7keFDqHKEW9+IFXFjzqXu t0ug== X-Gm-Message-State: AGRZ1gLGb2q0k0l7/r9fwkU8cMBnhUro2km/3tmFJSeECQA1/m/u6xK5 sYoxz0h4OtK05EhRaAl1hwfiXw== X-Google-Smtp-Source: AJdET5f1p898rgta//ar53TLhYOFfejlqpL3mlIo0fcQPy1QiZ+3q7s7/E75x/rDi2YpkEA93n4W2A== X-Received: by 2002:a1c:3c83:: with SMTP id j125-v6mr3222964wma.65.1542117735429; Tue, 13 Nov 2018 06:02:15 -0800 (PST) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id m69-v6sm16604122wmb.8.2018.11.13.06.02.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Nov 2018 06:02:14 -0800 (PST) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Russell King , Arnd Bergmann , Greg Kroah-Hartman , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Nicolas Ferre , "David S . Miller" , Grygorii Strashko , Srinivas Kandagatla , Andrew Lunn , Florian Fainelli , Rob Herring , Frank Rowand , Wolfram Sang Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org, linux-mtd@lists.infradead.org, netdev@vger.kernel.org, linux-omap@vger.kernel.org, devicetree@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH v2 12/25] of: net: kill of_get_nvmem_mac_address() Date: Tue, 13 Nov 2018 15:01:20 +0100 Message-Id: <20181113140133.17385-13-brgl@bgdev.pl> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181113140133.17385-1-brgl@bgdev.pl> References: <20181113140133.17385-1-brgl@bgdev.pl> MIME-Version: 1.0 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've switched all users to nvmem_get_mac_address(). Remove the now dead code. Signed-off-by: Bartosz Golaszewski Reviewed-by: Rob Herring --- drivers/of/of_net.c | 39 --------------------------------------- include/linux/of_net.h | 6 ------ 2 files changed, 45 deletions(-) diff --git a/drivers/of/of_net.c b/drivers/of/of_net.c index 53189d4022a6..810ab0fbcccb 100644 --- a/drivers/of/of_net.c +++ b/drivers/of/of_net.c @@ -81,42 +81,3 @@ const void *of_get_mac_address(struct device_node *np) return of_get_mac_addr(np, "address"); } EXPORT_SYMBOL(of_get_mac_address); - -/** - * Obtain the MAC address from an nvmem provider named 'mac-address' through - * device tree. - * On success, copies the new address into memory pointed to by addr and - * returns 0. Returns a negative error code otherwise. - * @np: Device tree node containing the nvmem-cells phandle - * @addr: Pointer to receive the MAC address using ether_addr_copy() - */ -int of_get_nvmem_mac_address(struct device_node *np, void *addr) -{ - struct nvmem_cell *cell; - const void *mac; - size_t len; - int ret; - - cell = of_nvmem_cell_get(np, "mac-address"); - if (IS_ERR(cell)) - return PTR_ERR(cell); - - mac = nvmem_cell_read(cell, &len); - - nvmem_cell_put(cell); - - if (IS_ERR(mac)) - return PTR_ERR(mac); - - if (len < ETH_ALEN || !is_valid_ether_addr(mac)) { - ret = -EINVAL; - } else { - ether_addr_copy(addr, mac); - ret = 0; - } - - kfree(mac); - - return ret; -} -EXPORT_SYMBOL(of_get_nvmem_mac_address); diff --git a/include/linux/of_net.h b/include/linux/of_net.h index 90d81ee9e6a0..9cd72aab76fe 100644 --- a/include/linux/of_net.h +++ b/include/linux/of_net.h @@ -13,7 +13,6 @@ struct net_device; extern int of_get_phy_mode(struct device_node *np); extern const void *of_get_mac_address(struct device_node *np); -extern int of_get_nvmem_mac_address(struct device_node *np, void *addr); extern struct net_device *of_find_net_device_by_node(struct device_node *np); #else static inline int of_get_phy_mode(struct device_node *np) @@ -26,11 +25,6 @@ static inline const void *of_get_mac_address(struct device_node *np) return NULL; } -static inline int of_get_nvmem_mac_address(struct device_node *np, void *addr) -{ - return -ENODEV; -} - static inline struct net_device *of_find_net_device_by_node(struct device_node *np) { return NULL;