From patchwork Fri Sep 7 10:07:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10591979 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 CA33A112B for ; Fri, 7 Sep 2018 10:11:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A9AED2ADE7 for ; Fri, 7 Sep 2018 10:11:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C07B2ADF0; Fri, 7 Sep 2018 10:11:50 +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,RCVD_IN_DNSWL_NONE autolearn=ham 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 17F2B2ADE7 for ; Fri, 7 Sep 2018 10:11:49 +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=Rb/6bKjXbM9z3XXuQDo8dH9EAgbRqu850JrcezKnbXk=; b=GII zYOY2ccOGIweKnNEQeyHpRXq9rMMBnWoqmi1y5h59QpX2qGre0Nm7wtNKhRCHlLMXj5JXgXpkTh7N YqxGfrh1n2QAWa75FD6fKOtlYxVdwsDZOMdpbopiNh1DEJmj4frxB8a7f932p/Rq5JbGPdbTQKqQw +UZelI3pjrEFi/z0Bc0FQ7EFxAZdu1Dd4EwyA8McKcAVnb3DAcYiTEVYR5WDQ43O+99Z6jwGG4Qiz aOdKy0Wu8sMjQh3JVdhR8mnCqaGQFJTimVes3EZJWRWkNvkDw91Qi6jHnPalJn7ugwc+lmQbovWgU cHYGK8Rct83x/zNGtusySIN7JQGQO1w==; 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 1fyDjn-0001au-38; Fri, 07 Sep 2018 10:11:39 +0000 Received: from mail-wm0-f43.google.com ([74.125.82.43]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fyDje-0008Ra-NS for linux-arm-kernel@lists.infradead.org; Fri, 07 Sep 2018 10:11:35 +0000 Received: by mail-wm0-f43.google.com with SMTP id n11-v6so14023875wmc.2 for ; Fri, 07 Sep 2018 03:09:20 -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=NIjhAzMS9ZUuLCp0EBL3tEJKEyuNDcoVnz4Jw1POrk4=; b=u9dos1iG4oQODsxjzZPK7pq/jAwux0Eyhw4CUt7lxU7NItdN1eUWupFewUk8/UMJ74 kkivBSLQjpQk4LELW4QVNT0xdsNC0gEHVwTcxPlkR3e1UTu61XjK49RsjI3Sbr/GerIL RZodkaflPI7kGeVGoGRc/ma8tDk7Wz8PghrswOp3FNAb/Zxa3rmKzrywBdnrXt5I5LZ5 4NT5LZkoclONxOFM1bLaHqkW8DbvBeqOgFJyZXqWloU0APpyi2Esi66B9KavAmkWcA3s aHtnQ/v94eNKbOa+KlehHzJm861VRalJIXRunhCGzAK1BEc/zmPvbJsjy+8aAkcnZuyO bNsQ== 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=NIjhAzMS9ZUuLCp0EBL3tEJKEyuNDcoVnz4Jw1POrk4=; b=X2IzkiB2GQjOVz+YV6ys5aBCdqxkgslJKlvq+IqwiFA0shiXfPHi0wMAonZrQUbR0A RHO94KaKUyVDRGnRnySsz2cf/K/M7HS6PJfNinlc+oyNYPQKEOFBw4GhPBJPr8j5EsxC 31+3Sr9nRYZ2q6HqPMmtTNkzyptHk9UiOEIGWFrox/9YAYhjOn8VEJZKuwJ4Vnu3WJum 1JyhBWt1GjvIxJRNkJvsTkRQM9s7azVSWst1DdM2Fm1tHaPDIWW81964QKr/8kw4RZSs xiGbi1UDIhZjIKlKb4YweeKB/wf1xZsWmFKH3lM/6DCY0pxnrxEVSnkgLpQlZSQGJutB FK/g== X-Gm-Message-State: APzg51CyGvBRH5YMwhlU1uCqyFQNcVxJ+HRFZ5y/AdaaISgiBLQFr8Oq zJBXRaRnmr6VOE8GRAdiiGykrA== X-Google-Smtp-Source: ANB0VdZNAyQibYCVEJOcc70ZdpeU9lS93TKIOrbx8bdgu7DP0BfvltpvlUJv5n9BH1R000EbQ8P2UA== X-Received: by 2002:a1c:2ed4:: with SMTP id u203-v6mr4639771wmu.19.1536314898633; Fri, 07 Sep 2018 03:08:18 -0700 (PDT) Received: from brgl-bgdev.baylibre.local (AStLambert-681-1-83-232.w90-86.abo.wanadoo.fr. [90.86.25.232]) by smtp.gmail.com with ESMTPSA id 72-v6sm6631619wrb.48.2018.09.07.03.08.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Sep 2018 03:08:17 -0700 (PDT) From: Bartosz Golaszewski To: Srinivas Kandagatla , "David S . Miller" , Mauro Carvalho Chehab , Greg Kroah-Hartman , Andrew Morton , Arnd Bergmann , Jonathan Corbet , Sekhar Nori , Kevin Hilman , David Lechner , Boris Brezillon , Andrew Lunn , Alban Bedel , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH v2 00/16] nvmem: rework of the subsystem for non-DT users Date: Fri, 7 Sep 2018 12:07:34 +0200 Message-Id: <20180907100750.14564-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-20180907_031130_790074_56EF2B59 X-CRM114-Status: GOOD ( 15.85 ) 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: Bartosz Golaszewski , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.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 series contains nvmem framework changes prerequisite for further development of my previous series[1] that aims at removal of the platform data struct from at24 EEPROM driver. First we remove unused APIs and the global cell list. We then switch to using kref instead of manual user counting. Next we simplify the provider unregistration by removing the return value from nvmem_unregister(). Next three patches improve the framework by adding a notifier chain for future use and fixing the issue with nvmem device names. Finally we add support for cell definitions, cell lookups and make DT systems resolve the nvmem cells during provider's registration. Last patches just use the SPDX license identifiers and make the naming convention for some arguments more consistent. Tested both DT and non-DT use cases. [1] https://lkml.org/lkml/2018/8/10/149 v1 -> v2: - extended the lookup structure with a proper con_id independent from the cell name defined in the cell definition table - added a patch that makes the naming convention for the cell name argument in the nvmem_cell_get() family of functions consistent - there were two users of nvmem_unregister() that still checked the return value, now switched to devm_nvmem_register() - fixed build failures reported by kbuild test robot Bartosz Golaszewski (16): nvmem: remove unused APIs nvmem: remove the global cell list nvmem: use kref nvmem: lpc18xx_eeprom: use devm_nvmem_register() nvmem: sunxi_sid: use devm_nvmem_register() nvmem: mxs-ocotp: use devm_nvmem_register() nvmem: change the signature of nvmem_unregister() nvmem: provide nvmem_dev_name() nvmem: remove the name field from struct nvmem_device nvmem: add a notifier chain nvmem: add support for cell info nvmem: resolve cells from DT at registration time nvmem: add support for cell lookups from machine code Documentation: nvmem: document cell tables and lookup entries nvmem: use SPDX license identifiers nvmem: make the naming of arguments in nvmem_cell_get() consistent Documentation/nvmem/nvmem.txt | 31 ++ MAINTAINERS | 1 + drivers/nvmem/core.c | 676 ++++++++++++++++++--------------- drivers/nvmem/lpc18xx_eeprom.c | 6 +- drivers/nvmem/mxs-ocotp.c | 4 +- drivers/nvmem/sunxi_sid.c | 20 +- include/linux/nvmem-consumer.h | 62 ++- include/linux/nvmem-machine.h | 57 +++ include/linux/nvmem-provider.h | 27 +- 9 files changed, 493 insertions(+), 391 deletions(-) create mode 100644 include/linux/nvmem-machine.h