Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp704787imm; Wed, 18 Jul 2018 09:14:55 -0700 (PDT) X-Google-Smtp-Source: AAOMgpd0TIBS0DQtE7neeK+HtTHW8RWt48cluhYho2lb39at+OBCtLoYhkHFyofuiOHKgvJ7NssZ X-Received: by 2002:a63:1e08:: with SMTP id e8-v6mr6334182pge.281.1531930495711; Wed, 18 Jul 2018 09:14:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531930495; cv=none; d=google.com; s=arc-20160816; b=E3GlTqfE8/5TThZYhfJUOEj1vQb1UIPJCvmBLJiYIKQZCuKOlIDD6DgAVrlNL4A0WU V7YbiH5JSeMmKUQc1PplEI4kabTWcGE8x6ZQSt5UNIZk4Cm1o4jqTaPsCLo+jwD8CNcN GmBjzXyCbBjQa2dSZ2OG4nVvDBDjup9olzDVh/QHoMSEFfcIW3xQaOYTW2YOpk6p7eBQ 5b5GWFjpKJSGnhbrT/t/l3WFt5CaUjj9iw8CZ97k4v4Omvx9NJpG+bthpnnjZhGya71P VucieGdvrZozoEsihGkvBZDLS1DMm0vsPqISZRbV5XTiLK/HgtohHmkLvE71u46+Emus hpng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=QP2WPmDtY6wTfmL4nBDJ1iHeMuOKJmvPoI3id9/o7tA=; b=VmIVU7e9xvupEEsne5KFBXEFHy/JcRD3A/qUPZDknCCO32uU/vo5ZRmRhaBH4XYWfD zlAhkLQl6fkNp16GP2qbqyjNBuRT4TRLVW5fJ986ZW2g97emIj3HrNAMLFIvDHGzy4sr /XPtidssVMHshCMltAFr5pC8kFCL1GJqxyye9FIxSlxjy25WvkQxcJOhXpxKcvFJRqkJ 8n4v6gHB0Iy7AtDycvEjqLbs9kVRIa8GzT+pMTDV7sX5oHWjKRFs3/e1IHt6dqmu+F1T sHrsp/Md+3aPWiKr1sThIfScdspRqGGnCDr+1kad2/Qi2uxhW5WQD71FAYsnPvgrgrxE Yqjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=WHc7en4H; 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 g5-v6si3343411plq.185.2018.07.18.09.14.41; Wed, 18 Jul 2018 09:14: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=WHc7en4H; 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 S1731493AbeGRQtT (ORCPT + 99 others); Wed, 18 Jul 2018 12:49:19 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:50626 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731361AbeGRQtT (ORCPT ); Wed, 18 Jul 2018 12:49:19 -0400 Received: by mail-wm0-f68.google.com with SMTP id v25-v6so3371252wmc.0 for ; Wed, 18 Jul 2018 09:10:42 -0700 (PDT) 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; bh=QP2WPmDtY6wTfmL4nBDJ1iHeMuOKJmvPoI3id9/o7tA=; b=WHc7en4HQHiC5xT4H2BfLn39yEsVeZq8SIO2Fgq+i9TzytJdLWfRFSlhsSvWkE0BkY zAryg4VAidW13C8fv9eDfnSQL13zbcDnDTHiERobfh98zKpUES/PJuSIKQ7j4UXtSdGE IHf9DptI7Wf2oVMdPqAKarp6sYK2th4B7jTYgwgY6qYxH0RVeC4Flht0JjmqV4Vh+gG+ FOOUuiA1mXpGhrIgqQBEAjG7EoLcSgpec/L+FjFpvIk2ghyNv9fu1jogqxzzPYn1WuV/ lAC9KMMsOOTTwXBJ2tPvXyn9cjslWEypxh27BX+hNQe3QBtHii4Q2aLSZB6fajkpGqHO r+ew== 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; bh=QP2WPmDtY6wTfmL4nBDJ1iHeMuOKJmvPoI3id9/o7tA=; b=EzgdVPQJ7LiE5Sa5FGm1MRHb0j7N95oUEOX1C4WeScO5P/5R5gLJpQvbFzNNkCiGoM SaWfG6j0qHvPSw1AAi0/yEc4uXI7BovHq8hDl4ylq+QQdbtPma16DUEmhw6hgq54wU0F w1fnjI+V0pr+kCDNrzQ5Rm5DNjgJuYOV8H9RgVCd+QJxCuk0nn2zpqYUk/1DUeXY05nW CA6Oq7jttarqq9+d+RgM90td24/vawh+tkP7ZJQxQS8v/xsXY8H+TULOYxLZadzIgjk/ LOMH1vkGlnYilg5CMoptNDkjQ6UJSBbqH7ElzdEtCHPDcxcNtd3uw6v4zpc2OwtpGrO1 9Mlg== X-Gm-Message-State: AOUpUlFzgrvuDH6WyUurK91O8L6CLNUByu0W3jro/BkNpFQ0dU/iBI9j No9V0QrjxRBAEfPvEsStpztGqQ== X-Received: by 2002:a1c:3a8f:: with SMTP id h137-v6mr2039020wma.72.1531930241965; Wed, 18 Jul 2018 09:10:41 -0700 (PDT) Received: from brgl-bgdev.home ([2a01:cb1d:af:5b00:e837:b8d5:48c1:571b]) by smtp.gmail.com with ESMTPSA id v185-v6sm2847803wme.30.2018.07.18.09.10.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jul 2018 09:10:41 -0700 (PDT) From: Bartosz Golaszewski To: Sekhar Nori , Kevin Hilman , Russell King , Grygorii Strashko , "David S . Miller" , Srinivas Kandagatla , Lukas Wunner , Rob Herring , Florian Fainelli , Dan Carpenter , Ivan Khoronzhuk , David Lechner , Greg Kroah-Hartman , Andrew Lunn Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, netdev@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 0/5] net: extend eth_platform_get_mac_address() Date: Wed, 18 Jul 2018 18:10:30 +0200 Message-Id: <20180718161035.7005-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a follow-up to a series I posted a while ago the goal of which was to replace the at24 platform data with device properties. To do so we need to somehow remove reading the MAC address from relevant board files. In my patches I used nvmem and MTD to read the MAC address from within the davinci emac driver. It was suggested that we generalize it further but since MTD doesn't support nvmem yet, the best we can do is to move this code over to net core code. The following patches modify the eth_platform_get_mac_address() function which seems to be the best candidate for this code. The first patch only visually shrinks the code because this routine will grow significantly in the next patches. The second patch adds an info message on success so that we keep getting notifications from users who already are verbose. The third patch calls is_valid_ether_addr() on the read address so that we're sure it's correct. The last two patches add nvmem and MTD support to the function. In order to stay compatible with existing users, nvmem and MTD will be tried last - after device tree and arch-specific callback. If this series gets accepted I will modify my previous patches to use it instead of handcoding the same operations in davinci_emac. Bartosz Golaszewski (5): net: visually shrink eth_platform_get_mac_address() net: add an info message to eth_platform_get_mac_address() net: fortify eth_platform_get_mac_address() net: add support for nvmem to eth_platform_get_mac_address() net: add MTD support to eth_platform_get_mac_address() net/ethernet/eth.c | 77 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 65 insertions(+), 12 deletions(-) -- 2.17.1