Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp703598yba; Fri, 3 May 2019 09:07:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6mjHS+CDpe/8XSW9SvQijLIO+vpKhzU3ncqq9WkNRtVMuRQXjCxRcTu/ovh61pUpIZ7AX X-Received: by 2002:a17:902:4681:: with SMTP id p1mr11438116pld.139.1556899664551; Fri, 03 May 2019 09:07:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556899664; cv=none; d=google.com; s=arc-20160816; b=qMM8uO2iR51/G7m1i9HXsvoFA9AxRBVcaywpRpBvkX10eOBZFH2gDOxHOzHBjkSe4S 4xwgUj+SbiLjxngLvkMjvptSrWO+GD+ovYfVqokLK5fdCH8u3Al28qOyLIDdqIk633C7 5+ZhZQQW9/eW8QFElOX+7gSXRpis+uvtfBy6gu6m4J3FEUXTiOJP0s0rtfK31+GZrtkw hYiB2JmOxA6hRm/7KAMVF4qSMdmOSTlPWoip0tWTfNAEmtzMQJ4ZujYRDo1WPhKkNynL L/dYaetvsXNTFpgN3XT5noYdVVxsuTnbqWPwb0Us2lyQFwVUYxq/3z4OrcPpzoyL+POY OyoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date; bh=+RHiInNryCCadjArQPNP9FDvnc9CWsAPtP8kU4bBxak=; b=ukmwJ0V2+ZUmVafc1CdAgCb408zpXyl8jVtVhnctD/OESjE0mnDgYAlFx4Sdw5ov04 9lTo1knTu58HwHXN6dPQzyKwyyKr9bKPH2KzludtQlpgo1dQhJ5scRwk0xT3ZEgGBBhU txqCSrgh0TbsttKWHPMDJ6O9vHvRSgmm7UNbfMOnyezULwoiHqHRDByzI6I8BD8DZlBP ITIKXM/FyDYZRsOFotjJF+5bLFVnct63sDsaeWKIhFh1egOTw/9EEvCdnvd5MKsPRtIJ SAmST9UuqA0MNdplk73RKqoGnyCobcb1YRTBuAQ0fdmlnEnjPQzpN2xjqjRszpOF9bXd No9w== ARC-Authentication-Results: i=1; mx.google.com; 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 t9si2628287pgp.273.2019.05.03.09.07.28; Fri, 03 May 2019 09:07:44 -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; 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 S1728115AbfECPoM (ORCPT + 99 others); Fri, 3 May 2019 11:44:12 -0400 Received: from smtp-out.xnet.cz ([178.217.244.18]:33044 "EHLO smtp-out.xnet.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727460AbfECPoM (ORCPT ); Fri, 3 May 2019 11:44:12 -0400 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id 202474CF3; Fri, 3 May 2019 17:44:09 +0200 (CEST) Received: from localhost (meh.true.cz [local]) by meh.true.cz (OpenSMTPD) with ESMTPA id 24f09925; Fri, 3 May 2019 17:44:07 +0200 (CEST) Date: Fri, 3 May 2019 17:44:07 +0200 From: Petr =?utf-8?Q?=C5=A0tetiar?= To: Maxime Ripard Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, Andrew Lunn , Florian Fainelli , Heiner Kallweit , Rob Herring , Frank Rowand , Srinivas Kandagatla , Alban Bedel , Felix Fietkau , John Crispin , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 01/10] of_net: add NVMEM support to of_get_mac_address Message-ID: <20190503154407.GE71477@meh.true.cz> Reply-To: Petr =?utf-8?Q?=C5=A0tetiar?= References: <1556893635-18549-1-git-send-email-ynezz@true.cz> <1556893635-18549-2-git-send-email-ynezz@true.cz> <20190503143643.hhfamnptcuriav4k@flea> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190503143643.hhfamnptcuriav4k@flea> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Maxime Ripard [2019-05-03 16:36:43]: Hi, ... > > + pp = devm_kzalloc(&pdev->dev, sizeof(*pp), GFP_KERNEL); > > + if (!pp) > > + return ERR_PTR(-ENOMEM); > > + > > + pp->name = "nvmem-mac-address"; > > + pp->length = ETH_ALEN; > > + pp->value = devm_kmemdup(&pdev->dev, mac, ETH_ALEN, GFP_KERNEL); > > + if (!pp->value) { > > + ret = -ENOMEM; > > + goto free; > > + } > > + > > + ret = of_add_property(np, pp); > > + if (ret) > > + goto free; > > + > > + return pp->value; > > I'm not sure why you need to do that allocation here, and why you need > to modify the DT? I was asked about that in v2[0] already, so just copy&pasting relevant part of my response here: I've just carried it over from v1 ("of_net: add mtd-mac-address support to of_get_mac_address()")[1] as nobody objected about this so far. Honestly I don't know if it's necessary to have it, but so far address, mac-address and local-mac-address properties provide this DT nodes, so I've simply thought, that it would be good to have it for MAC address from NVMEM as well in order to stay consistent. [...] 0. https://patchwork.ozlabs.org/patch/1092248/#2164089 1. https://patchwork.ozlabs.org/patch/1086628/ > can't you just return the mac address directly since it's what the > of_get_mac_address caller will expect anyway? I don't need this stuff, I can remove it, please just tell me what is appropriate and I'm going to do that. -- ynezz