From patchwork Fri Nov 30 08:20:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10705949 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 EAE0A13BF for ; Fri, 30 Nov 2018 08:21:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA46A2FBF1 for ; Fri, 30 Nov 2018 08:21:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CC3C52FBFF; Fri, 30 Nov 2018 08:21:40 +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 68B102FBF1 for ; Fri, 30 Nov 2018 08:21:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727172AbeK3T3x (ORCPT ); Fri, 30 Nov 2018 14:29:53 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:55233 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727085AbeK3T3w (ORCPT ); Fri, 30 Nov 2018 14:29:52 -0500 Received: by mail-wm1-f66.google.com with SMTP id z18so4835256wmc.4 for ; Fri, 30 Nov 2018 00:21:21 -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=hgb7Jf4JzQq+BZf3FS+sr7z0n9uuyVnC5JrBI/ymMjs=; b=w3qBpdwxixKSwtAr2cNDwRPb862aZc1l5jZUSeftGTT+U5xnaxdDyMnk0xCVgQ6Qr1 SIpGBUmLI2/wwgvA7w/IDXtewl1fq4HIJLwy/U+iipgBZWPVgRk90vzPSB2AHS6MZhq9 SPiMYg05c7lYy/rudI0Zsfq36kIQPgV3HJVlrjDKDeYId4r3huxbFbhvYt8GHoB7sd6J 9U7QDoWPPlrCdFuVh11U8e7SRCNXcYGPlT6M2ZeBZot1EJCdo/qabOEUO8BIYDHo81BV WAdl3WIDrqfHscg45CxbMYHTcHzQRscZqOg0P/CXmAHugm8/xjTrJp0BAwDYN89bjRoI nGQQ== 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=hgb7Jf4JzQq+BZf3FS+sr7z0n9uuyVnC5JrBI/ymMjs=; b=fIFkyQMy/d5TdM13reWEfBcGiVtj6axVQvEjMEFQyCzlNLZRZ5wL+DcSoCFM6v0z5e ZXj1f0gbCUCJCihl5stO6YmTaafV1N227gbFSe6LcCJyBDkqAk1ubDEjK6VyglLICBP1 iJl8v2faxEnvxTpPV9N9YosJN3COEz9W6BDCr7A8x4KIZ1uVpi3W5oeF94BiWJLnVbW0 p5/GA6qSPdzBFcifoeFxUQe+vRdScjp6az5B7c6xxjyHytWeIPASsa7v7LqOhpCUkiUO AxwlgdlyfdCMg+xTXW6f0utIymp8CMLF9Vp0cbFFw0ChPvW1HdXqFpFYM+jpnuM2/PuO n2Gg== X-Gm-Message-State: AA+aEWakUK4xBSxkhH1pvPRUjw2pDchmyxfKzyvAyO37G8aAfwU2C/eD QK8JqrnN270+7OmY/Oh58+FegA== X-Google-Smtp-Source: AFSGD/ViqOg8nrUwEf+F8iUN8aKfzpJNyeWswKQvwjj7Pb3cp37fFbccS3X9uNfsKPQHRgnDZzfwuQ== X-Received: by 2002:a1c:df46:: with SMTP id w67mr3264485wmg.51.1543566080748; Fri, 30 Nov 2018 00:21:20 -0800 (PST) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:6d6c:8493:1ab5:dad7]) by smtp.gmail.com with ESMTPSA id x197sm6473374wmd.2.2018.11.30.00.21.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Nov 2018 00:21:20 -0800 (PST) From: Bartosz Golaszewski To: Grygorii Strashko , Nicolas Ferre , "David S . Miller" , Andrew Lunn , Florian Fainelli , Heiner Kallweit , Rob Herring , Frank Rowand , Sekhar Nori , Kevin Hilman Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-omap@vger.kernel.org, Bartosz Golaszewski Subject: [net-next][PATCH 3/4] of: net: kill of_get_nvmem_mac_address() Date: Fri, 30 Nov 2018 09:20:59 +0100 Message-Id: <20181130082100.6241-4-brgl@bgdev.pl> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181130082100.6241-1-brgl@bgdev.pl> References: <20181130082100.6241-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;