From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA1F9C433ED for ; Fri, 16 Apr 2021 07:23:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BBDAA60238 for ; Fri, 16 Apr 2021 07:23:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239607AbhDPHXk (ORCPT ); Fri, 16 Apr 2021 03:23:40 -0400 Received: from elvis.franken.de ([193.175.24.41]:53273 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239532AbhDPHXc (ORCPT ); Fri, 16 Apr 2021 03:23:32 -0400 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1lXIol-0007qW-00; Fri, 16 Apr 2021 09:23:07 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id D32FFC04CD; Fri, 16 Apr 2021 09:12:26 +0200 (CEST) Date: Fri, 16 Apr 2021 09:12:26 +0200 From: Thomas Bogendoerfer To: Andrew Lunn Cc: "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 net-next 07/10] net: korina: Add support for device tree Message-ID: <20210416071226.GA5257@alpha.franken.de> References: <20210414230648.76129-1-tsbogend@alpha.franken.de> <20210414230648.76129-8-tsbogend@alpha.franken.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 16, 2021 at 01:49:07AM +0200, Andrew Lunn wrote: > > - memcpy(dev->dev_addr, mac_addr, ETH_ALEN); > > + if (mac_addr) { > > + ether_addr_copy(dev->dev_addr, mac_addr); > > + } else { > > + u8 ofmac[ETH_ALEN]; > > + > > + if (of_get_mac_address(pdev->dev.of_node, ofmac) == 0) > > + ether_addr_copy(dev->dev_addr, ofmac); > > You should be able to skip the ether_addr_copy() by passing > dev->dev_addr directly to of_get_mac_address(). good point > > > + else > > + eth_hw_addr_random(dev); > > + } > > > > lp->rx_irq = platform_get_irq_byname(pdev, "korina_rx"); > > lp->tx_irq = platform_get_irq_byname(pdev, "korina_tx"); > > @@ -1146,8 +1157,21 @@ static int korina_remove(struct platform_device *pdev) > > return 0; > > } > > > > +#ifdef CONFIG_OF > > +static const struct of_device_id korina_match[] = { > > + { > > + .compatible = "idt,3243x-emac", > > You need to document this compatible somewhere under Documentation/devicetree/binding checkpatch hinted to put it in an extra patch, it's patch 10 of this series and looking at my inbox it didn't get through :-(. Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]