From patchwork Fri Aug 10 08:04:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10562365 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E08A4157B for ; Fri, 10 Aug 2018 08:06:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CFB562B575 for ; Fri, 10 Aug 2018 08:06:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B11C52B3A7; Fri, 10 Aug 2018 08:06:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 44A4327F10 for ; Fri, 10 Aug 2018 08:06:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=Lz/DhHlq99kIKX7SM+tdaUHLabmfJW50onapR/uGpxU=; b=BzC 5O2UZ8cZ5QDG4qpqVv47lPfOFdIekOJQ8Oog1qRT1k7VuDtZyJKeop2g7BC8Wm5vS2tdsT5F83JXN 2S/j5tTr9ZCP6GYB9AbEfAH7ifv0L66g2Wk6/o0BAY4VM8oZCCSxofkB4XZsUe70S9zYWvWNZbopv KJu1IQE0Q1snuDhP9GEfA1SH27HTKiLRuwkysX5NCQX1+JByI8RiPdLJMu/Ben59Miysas/MuCj3f H6oxj3fwJDtNkuLwE4BxeBMXn7Cb2vs+dYob4+k39Il8Q8NqOpSPFK3Fik9poFqLSSdd70kQyZqfo ml4fOoYG88zWKstu8BHLPT0jJike0NA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Qr-0002Yh-Az; Fri, 10 Aug 2018 08:06:01 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fo2Qb-00026L-L8 for linux-arm-kernel@lists.infradead.org; Fri, 10 Aug 2018 08:05:47 +0000 Received: by mail-wm0-x242.google.com with SMTP id r24-v6so776077wmh.0 for ; Fri, 10 Aug 2018 01:05:32 -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=Bc+zUR/F0RdxdwKK5ohOYXrXmQUqg6SjfWoWK0/T+oU=; b=UwOI1adeiYG6JpiqSqes0wR+z55HEnMV0UTLQ/a2C5HMZdSgi68YxgytX+fM9vyd3g 0wvfz7djSWE59ZhnYE98OQECgayglK6P5O1VISorTFMg2zYSHnjkbPxE0lxKGfJNx7BM M01GcxyONszG7uhUVFtNBgW8CE8TxRjR90iXYXAntYNrWdJSFswOAgjPOtdtlfBhDxwt OxIdtVNJaaLGg/c+cD+P5WgQXB0zgbDBYe9/B4wRXEELc01I1rFluNlMcwXS18NUKhNG 5iuZojQH1FISUjSFgfZNT+5vq1EayH0rW2T1TzvgJICdetvNzVfh1/ixxxLTL1wkhSzm 6b8Q== 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=Bc+zUR/F0RdxdwKK5ohOYXrXmQUqg6SjfWoWK0/T+oU=; b=bl31gElQhv6S6XgEyB3CGYvQ8u2iEtEQFEBaW1GcmpBZnR1LYQ8oJV9ZbaxO9zXNWF /gvnilNxTthkOajkb0tLUkYEwvoadeaAkdeZGCjcdbabvpoyHoufslVA3g5VmJKLowmX mUYfTnqMJSGkIpElNi3gIPMwTyJIlP3uGzKmP86zZWj4smNQOaksGXypDN9a6K+HXUyz ePo8hOx+rbAYO8xi5EUJCR9uNCsYdT434K0ynZLcQqjpqVeazPx5GqtwtuWlxB1iqiUh 7C8sqZ0DLu8SgO5Az/AWNZ2beuCWWedWzZQiwzD98nLhF8w6Dop6rUlpkADa9WI+7Q/b hhUA== X-Gm-Message-State: AOUpUlECQO81xnX3VzlsEUlKGTG9C8MT8YfLRZDq9g44pmye684BOoIJ cx79/heYe/AIAouKAOgItO1CQg== X-Google-Smtp-Source: AA+uWPxS/db6mqljLB78Qc4pdYPFfDZ2NDfAF9DZrQsFY4G8kOk/pTx2mF6U5R3aE1/5OMOgogbRPw== X-Received: by 2002:a1c:ec1b:: with SMTP id k27-v6mr742612wmh.157.1533888331490; Fri, 10 Aug 2018 01:05:31 -0700 (PDT) Received: from brgl-bgdev.lan (LFbn-MAR-1-609-89.w90-118.abo.wanadoo.fr. [90.118.185.89]) by smtp.gmail.com with ESMTPSA id h7-v6sm9546405wrs.8.2018.08.10.01.05.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 01:05:30 -0700 (PDT) From: Bartosz Golaszewski To: 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 Subject: [PATCH v2 00/29] at24: remove at24_platform_data Date: Fri, 10 Aug 2018 10:04:57 +0200 Message-Id: <20180810080526.27207-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180810_010545_727493_E94FB809 X-CRM114-Status: GOOD ( 24.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-doc@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , linux-mtd@lists.infradead.org, linux-i2c@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski This is a follow-up to the previously rejected series[1] which partially removed the at24_platform_data structure. After further development and taking reviews into account, this series finally removes that struct completely but not without touching many different parts of the code base. Since I took over maintainership of the at24 driver I've been working towards removing at24_platform_data in favor for device properties. DaVinci is the only platform that's still using it - all other users have already been converted. One of the obstacles in case of DaVinci is removing the setup() callback from the pdata struct, the only user of which are some davinci boards. Most boards use the EEPROM to store the MAC address. This series adds support for cell lookups to the nvmem framework, registers relevant cells for all users, adds nvmem support to eth_platform_get_mac_address(), converts davinci_emac driver to using it and replaces at24_platform_data with device properties. There's also one board (da850-evm) which uses MTD for reading the MAC address. I used the patch from Alban Bedel's previous submission[2] to add support for nvmem to the MTD framework. Since this user doesn't need device tree, I dropped Alban's patches modifying the DT bindings. We can add that later once an agreement is reached. For the time being MTD devices are registered as nvmem devices and we're registering the mac-address cell using the cell lookup mechanism. This series adds a blocking notifier chain to the nvmem framework, so that we can keep the EEPROM reading code in the mityomapl138 board file with only slight modifications. I also included some minor fixes to the modified code. Tested on da850-evm & dm365-evm. [1] https://lkml.org/lkml/2018/6/29/153 [2] https://lkml.org/lkml/2018/3/24/312 v1 -> v2: PATCH 4/29: - change name to nvmem_dev_name() - return NULL instead of ERR_PTR(-ENOSYS) from nvmem_dev_name() if nvmem is not configured PATCH 5/29: - s/nvmem_device_name/nvmem_dev_name/ PATCH 6/29: - fix the commit message: remove the part mentioning the OF systems PATCH 7/29: - fix ordering of includes PATCH 8/29: - fix ordering of includes PATCH 9/29: - fix ordering of includes PATCH 10/29: - fix ordering of includes PATCH 11/29: - fix ordering of includes PATCH 14/29: - new patch PATCH 22/29: - added missing terminator PATCH 25/29: - removed unneeded coma PATCH 27/29: - s/nvmem_device_name/nvmem_dev_name/ - fix ordering of includes PATCH 28/29: - added missing terminator Alban Bedel (1): mtd: Add support for reading MTD devices via the nvmem API Bartosz Golaszewski (28): nvmem: add support for cell lookups Documentation: nvmem: document lookup entries nvmem: add a notifier chain nvmem: provide nvmem_dev_name() nvmem: remove the name field from struct nvmem_device ARM: davinci: dm365-evm: use nvmem lookup for mac address ARM: davinci: dm644-evm: use nvmem lookup for mac address ARM: davinci: dm646x-evm: use nvmem lookup for mac address ARM: davinci: da830-evm: use nvmem lookup for mac address ARM: davinci: mityomapl138: add nvmem cells lookup entries ARM: davinci: da850-evm: use nvmem lookup for mac address ARM: davinci: da850-evm: remove unnecessary include net: simplify eth_platform_get_mac_address() net: split eth_platform_get_mac_address() into subroutines net: add support for nvmem to eth_platform_get_mac_address() net: davinci_emac: use eth_platform_get_mac_address() ARM: davinci: da850-evm: remove dead MTD code ARM: davinci: mityomapl138: don't read the MAC address from machine code ARM: davinci: dm365-evm: use device properties for at24 eeprom ARM: davinci: da830-evm: use device properties for at24 eeprom ARM: davinci: dm644x-evm: use device properties for at24 eeprom ARM: davinci: dm646x-evm: use device properties for at24 eeprom ARM: davinci: sffsdr: fix the at24 eeprom device name ARM: davinci: sffsdr: use device properties for at24 eeprom ARM: davinci: remove dead code related to MAC address reading ARM: davinci: mityomapl138: use nvmem notifiers ARM: davinci: mityomapl138: use device properties for at24 eeprom eeprom: at24: kill at24_platform_data Documentation/nvmem/nvmem.txt | 28 +++++ MAINTAINERS | 1 - arch/arm/mach-davinci/board-da830-evm.c | 25 ++-- arch/arm/mach-davinci/board-da850-evm.c | 45 +++----- arch/arm/mach-davinci/board-dm365-evm.c | 25 ++-- arch/arm/mach-davinci/board-dm644x-evm.c | 25 ++-- arch/arm/mach-davinci/board-dm646x-evm.c | 25 ++-- arch/arm/mach-davinci/board-mityomapl138.c | 60 +++++++--- arch/arm/mach-davinci/board-sffsdr.c | 13 +-- arch/arm/mach-davinci/common.c | 15 --- drivers/misc/eeprom/at24.c | 127 +++++++++------------ drivers/mtd/Kconfig | 1 + drivers/mtd/mtdcore.c | 50 ++++++++ drivers/net/ethernet/ti/davinci_emac.c | 12 +- drivers/nvmem/core.c | 106 ++++++++++++++++- include/linux/davinci_emac.h | 2 - include/linux/mtd/mtd.h | 2 + include/linux/nvmem-consumer.h | 31 +++++ include/linux/nvmem-provider.h | 10 ++ include/linux/platform_data/at24.h | 60 ---------- net/ethernet/eth.c | 84 ++++++++++++-- 21 files changed, 492 insertions(+), 255 deletions(-) delete mode 100644 include/linux/platform_data/at24.h