Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp170297imm; Fri, 10 Aug 2018 09:18:55 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzWQQlZ+GsBmmiBTAtj524w1mSVN9PDUtGhTY+FKK5fK3weGxhoR5ZUjXjzffy3lGf+n2DD X-Received: by 2002:a17:902:7793:: with SMTP id o19-v6mr6885068pll.306.1533917935919; Fri, 10 Aug 2018 09:18:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533917935; cv=none; d=google.com; s=arc-20160816; b=bt2bL9KR1DmUGmFhpCiWOIchHhy4z8ISUuRCmVzg1m4Avx4hXAr3LblWbjnc/PDVqo jI/SuYDX6K22zd609eXf58YLYNuQYg9/bPvD0vpx2J7+rVj9iSKq3gH3/IZPLL3a9h2t YVOBF+wCcUQId9AN4OgG3b1cHLeZA835Sy/2kuys+NHaBrKBB5enih9foarP+vRkg7uu 3dNI8wbZVsK316D9DpATomN3wxnqSbi+zQ/f1R76Qcb9C4TYKdfEsMZiMMEw5rfasAGB YB4+8AVrb/Atam+5RzoUgIq+DERJU0yAL9JNdLXYGvAnsD6hXajTD0dHx69tWh/9HFAr kEEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=qpDChSEoVOJBPGx9YmxkwlUonMQ7vT7RN3awaNxdtiA=; b=wLZYj9qx6QMoIzczBQRe/VJKqaYXx/wV6aGZK5t8WSLd4ihObQR7N1DKs4nCIMoxqF p44MIFgZJsWs91frnSTVSCP7zURkf7RhnV9G8FXPgp8LUxxsWL0S5XtiIJv2UoJojeWJ yexiy3wbVDWuexq+zaD4r1oHakQW6tNN5na8vdpe7du6CvUedz1c6vrAKwOEeLMxLST6 Leru1QYu5mBNOiqaQQo0eko+QZT52Ev+NIw52YBFsoYGtk7V2Xlq1Ydu6PDna4fwmvob 22Byw9I9La2EldBaixGvj/dyto8MH02qNmTZa4hkvSufUeovR3O/M+9KR/ej9+sF+7eV fE/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=jzZVqEAa; 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 q18-v6si7836419plr.134.2018.08.10.09.18.40; Fri, 10 Aug 2018 09:18:55 -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=jzZVqEAa; 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 S1728075AbeHJSsU (ORCPT + 99 others); Fri, 10 Aug 2018 14:48:20 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:33403 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728076AbeHJSsT (ORCPT ); Fri, 10 Aug 2018 14:48:19 -0400 Received: by mail-it0-f66.google.com with SMTP id d16-v6so5110002itj.0 for ; Fri, 10 Aug 2018 09:17:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=qpDChSEoVOJBPGx9YmxkwlUonMQ7vT7RN3awaNxdtiA=; b=jzZVqEAaMmIH2ybo1dK0Fx0LdoATYIo8pEwHs3ChBJMYx0VdKlF2Iu75Lm7yflPCC9 RrVTUTphMA/O7ZnVzsvTOKco1FY+JwKhtevTgeU3z5poo56HVg5b08tx/fCezH7Si6E1 koel88l99C3elXlb7VRWLdjApI2O1s+g1LWVZB3p+JQFe7NqmvovWt69KNrQ6LJMxf0I saCmBeGEQzSjIc0UAtHPTfurEsVKiDmL7ad8d3+JklSg+yeHesmiOCavnBzExzJHgNWt IczNUjCE7FsPIdOWwsG+8RqKl0/8GdqFyOR4UzwRf3DgACnFdmajmFZQ+BroXCcg6yHr FFuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=qpDChSEoVOJBPGx9YmxkwlUonMQ7vT7RN3awaNxdtiA=; b=uLmWmsmzJUEDcVxxrW47QS3MjyumTnmJlECeza0E7NyIL+WxH0/3F62eeJmLEA2R8t XqTDmqQnMqcBoBjSjSndtqIU9XneEyU9ZgLyL5jAxmMcI4pxHfiS+JsCYiG2aK8v8nop 9cBnIPxkYtaauG5aLFJNCJacRdWZfwkWiALchHETi2jCXW8AUgpcwmrz2itrSZqygXlD ujnvREXs2aFWA62xGAFntSA8p9NKIqLc9qNUNUHFI36JVLT7h8zukK6/oFsCxXjPPvrh EF3GLx9Ad2NSFPMhj3betL/2dYhqPnqNbTZsTScIhTZUrSDGa2ApGlzqHIfinh4gfxdf wujg== X-Gm-Message-State: AOUpUlFRfXBc9cztvAuVeHMZLtHzdEVYtz8Apm/HRJlbERocBaxgwe63 75tJZ7ACki5OienjTu4n1jsZbfBMfC9kVa7ty8WEZw== X-Received: by 2002:a24:1013:: with SMTP id 19-v6mr2722355ity.141.1533917868345; Fri, 10 Aug 2018 09:17:48 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5e:9403:0:0:0:0:0 with HTTP; Fri, 10 Aug 2018 09:17:47 -0700 (PDT) In-Reply-To: References: <20180810080526.27207-1-brgl@bgdev.pl> <20180810080526.27207-15-brgl@bgdev.pl> From: Bartosz Golaszewski Date: Fri, 10 Aug 2018 18:17:47 +0200 Message-ID: Subject: Re: [PATCH v2 14/29] net: simplify eth_platform_get_mac_address() To: Andy Shevchenko Cc: 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 , Linux Documentation List , Linux Kernel Mailing List , linux-arm Mailing List , linux-i2c , "open list:MEMORY TECHNOLOGY..." , Linux OMAP Mailing List , netdev , Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2018-08-10 16:39 GMT+02:00 Andy Shevchenko : > On Fri, Aug 10, 2018 at 11:05 AM, Bartosz Golaszewski wrote: >> From: Bartosz Golaszewski >> >> We don't need to use pci_device_to_OF_node() - we can retrieve >> dev->of_node directly even for pci devices. >> > >> struct device_node *dp; >> >> - if (dev_is_pci(dev)) >> - dp = pci_device_to_OF_node(to_pci_dev(dev)); >> - else >> - dp = dev->of_node; >> - >> + dp = dev->of_node; >> addr = NULL; >> if (dp) >> addr = of_get_mac_address(dp); > > Looking more at this I could even propose to change all above by > > addr = device_get_mac_address(dev, mac_addr, ETH_ALEN); > > Thoughts? > > -- > With Best Regards, > Andy Shevchenko Indeed seems like it's even more generalized. Thanks for spotting that. Bart