Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp77274imm; Fri, 10 Aug 2018 07:54:17 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx2C0m5fMe7QSgvWas4dJoQoJVk+JK7AvM5AfmjoMBSP9uUYcimEljx3e1nepxQk5Lr4dJ6 X-Received: by 2002:a62:f909:: with SMTP id o9-v6mr7461428pfh.141.1533912857703; Fri, 10 Aug 2018 07:54:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533912857; cv=none; d=google.com; s=arc-20160816; b=y1KfcWQ8zPgH5YzuY4Du2AOruhF9bwz9FH16LBbeAq9R45tYf0L6PwjcMt8vPsRUHr RUQdFakdcwwxdjSXLHnaUrinonPsDgmrCc1H4ni8Ceq+YVQX/eJb6rSPXdIvAWltI2Zm PDbZ4e/JocIx4Nua0j+gxLHqOw9eZ8O/BICpTOGi/hB9dWdZHQWMPnqRs/rIBH74vKrf 2RQrDXIZifWbzBl3kEwdx3grGngWFFMfUWmkOBxWm6Ff/JPUSUf1Ex+IIqtsOB3ahHb8 1WUbce+Gl5f/DwGGpPhDNHuuEPsnxKa1WP7oOFtOn0K5z3Ipe6Lv1/l63emc44DFXv8y /I3Q== 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=My/dG6rVWDQZhO6jex8h3m0BrUhvSJlqED5P1zQEhPI=; b=rclUWrlODMvv+BG3TCO2KQmt+OviEDnYjNxYXYeLCg0Q6UpNdwOksG8kmjjSvQuKV/ ihsRVZ2zow7gifXeC8X3mN+k8Gj4X0B+ImM+p39Jw2PR4YiFwcnQaUY5e7zGi/y16fSm ZFjFIhCNZcX6Xt4TiJxw510BqHibiy0r+XFrsPLg2X+zleIs43tLKxbWhQYUrm0WIKzC nbby/+Kv29En48Dx/0To7tYw/fz5OVAS+cskUw7nwgalynBXuFtobbPNM+tKPLxoATrZ qpmhq+0AySe6lZGQgtD7hv2E6IQwOWq7X3jDLU5rCv6rAEZznxJlpzo8nduZcNXrOQld J4UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CkvyuyAn; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ca2-v6si8929840plb.305.2018.08.10.07.54.02; Fri, 10 Aug 2018 07:54:17 -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=@gmail.com header.s=20161025 header.b=CkvyuyAn; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727835AbeHJRJb (ORCPT + 99 others); Fri, 10 Aug 2018 13:09:31 -0400 Received: from mail-ua1-f65.google.com ([209.85.222.65]:34200 "EHLO mail-ua1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727519AbeHJRJb (ORCPT ); Fri, 10 Aug 2018 13:09:31 -0400 Received: by mail-ua1-f65.google.com with SMTP id r15-v6so2076684uao.1; Fri, 10 Aug 2018 07:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=My/dG6rVWDQZhO6jex8h3m0BrUhvSJlqED5P1zQEhPI=; b=CkvyuyAn/IvEkyOfyQNJCGXYdFaz/573Y2n/oE3HynlUveaioUy7eSY+eO79r6/qvI PWG8lCpqv1cV6JsSdufd68jZ0JPllLZzlaZMPg42742XoTooBIe2yhEgwvtDWly8fvt4 STZ5k8Q8rdf+QfLDj167PkQfqB38tJzRkitKS6bbR9HtG2eGAxC4QmTqfdqd5EIx+wGS /tR73NqsbIxVamPiAvWu+MycRvk3Z5wQ+4a8zB375h7hlGnOzeqTsyrLV3kpO/dvuGsr p51fYJLEJvREVtZGhK6CbKS1/ZTempzOyHU1NUBv4RLPOCLz0S7YM1rSOSFOWvoRtII9 CG7Q== 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=My/dG6rVWDQZhO6jex8h3m0BrUhvSJlqED5P1zQEhPI=; b=boelu90iMG/7FgcDGsaEpIKzf8vAYws6mCZaqtXgITsP+hZ/9A/ya5TsiIl9RFe4jM BZ1xZYsBmXRtTedTk/63oVshuIqiYHjaIHeWVHywIC40OyMJ6lavv8nHeIlx7U+dC+69 nl8NvyZsF5erkYPX613ffNVYvx7uatO6f+exdRTEXXanGm+bcBizPmYblxEbhiqgsiXL 8s1VLlbf3x1sXP8Arq5b+kO7ybz3gMNfDZQRu4tfvuTHiJy/bqjKd/HWew55eG3kmpUV h02D2tTZegWOTbbc/e0ahdXmIahAR0K3wtO2o2KLJsEjeM7+AEKeCl60Z282sfvbhBI/ U3EQ== X-Gm-Message-State: AOUpUlGusMobR+wtpLtmmYxnjKl4Y2eRoJBpiXZvuR2WZPOGY0bo4Flj +YZVsfXVGfS1Yc9517ftYxAK5SSShRUWwHUGe2M= X-Received: by 2002:a1f:c884:: with SMTP id y126-v6mr4146396vkf.76.1533911959062; Fri, 10 Aug 2018 07:39:19 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:2149:0:0:0:0:0 with HTTP; Fri, 10 Aug 2018 07:39:17 -0700 (PDT) In-Reply-To: <20180810080526.27207-15-brgl@bgdev.pl> References: <20180810080526.27207-1-brgl@bgdev.pl> <20180810080526.27207-15-brgl@bgdev.pl> From: Andy Shevchenko Date: Fri, 10 Aug 2018 17:39:17 +0300 Message-ID: Subject: Re: [PATCH v2 14/29] net: simplify eth_platform_get_mac_address() To: Bartosz Golaszewski 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 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