From patchwork Fri Mar 9 14:46:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131137 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1083537lja; Fri, 9 Mar 2018 06:56:49 -0800 (PST) X-Google-Smtp-Source: AG47ELsJY2RREU6bM5b6tvmMs52LgGtXCvXIIOH9gGquggmPMcdvxwAFlcQrBDE4GdSBZTEE9rV+ X-Received: by 2002:a17:902:9897:: with SMTP id s23-v6mr16156814plp.105.1520607409281; Fri, 09 Mar 2018 06:56:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607409; cv=none; d=google.com; s=arc-20160816; b=d66OfWwjT/Gr6AZpNOTUw/YiwxjeLnlZgYFxb+aqyV3ME3kATkLZs77MQ5XbIyICf0 XCXljdClx2Jjpeu2kXKpRGj/CqpAUAHsYN1Wq1l/NWT0qWiIoEuEZnhEKbla4wPlRsBL 3SvOT5NzdWiAWjWA2EdBJWSHrXyLmIptSmIqEqkfffAf/vl0eKKVVmBCNpDSoaHtmnXn 1bEpgtkCdiI7Ck50stOyUOmGhl6xi+FGolm+Y0XdR3FEFpVnWsqlS3GCErwAqIporV38 nN88WOWvJEqrPke7lF+0FU2EibBYcwGy1ih6LDVNUHnIGkmsyBkqJ2ZNVjIRRYnU2aJy 1mqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=vQR5gljnwr4aCOvufpueUZU1itTLbeOEfIMn7X2e+lg=; b=UO8iVZI10m+gqf37PTwWJm0uY01P6FPJab/vvp+9psHIc3WMUlI+lIPn2BsjpX1WEp xx/6PfnLUIN7e/TmkqbO5bEI3yrZrh0eBVMX4E3WlTepfsSAn0baow0ClU+PmS4Gl8cL UwFsm/ukWJu7VWnPkW2nuLacbZmeazzCxD1duzanuJosvu+WlpcNlkR9IEq+Ks/Akrf9 oSVmh0EjnZ0/m3KaqgUmWq9F9GAsFK01uDNAffjbCyRF0AfEfY2D+sRUhhl7Q8VjUO6C /vAw+7qSSeGMY0i4tOErZLHifZkNABNlDM8RSaNnsM3D5ZxrGrchg2olVQPOl/9ROqTn BEnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XZDZVI/N; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s11-v6si979935plj.701.2018.03.09.06.56.49; Fri, 09 Mar 2018 06:56:49 -0800 (PST) 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=@linaro.org header.s=google header.b=XZDZVI/N; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932303AbeCIO4q (ORCPT + 28 others); Fri, 9 Mar 2018 09:56:46 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:41487 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932067AbeCIOu2 (ORCPT ); Fri, 9 Mar 2018 09:50:28 -0500 Received: by mail-wr0-f193.google.com with SMTP id f14so9266500wre.8 for ; Fri, 09 Mar 2018 06:50:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vQR5gljnwr4aCOvufpueUZU1itTLbeOEfIMn7X2e+lg=; b=XZDZVI/NFoB1gR6GHdIcZXY2a/njgclvMAs1wjbVOhW9H4RRQELFmHLNYAGKmdzo/d rxRb9G4SoxJyfQQ/a/ZMBTGXfwons+/QYiyNrP4jIpCfxDoTIZCSmmMfY2X55bIEaJni avSn1UiSE9jy8Kvs+i3yeZn1OReQg+tnGYnU4= 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:in-reply-to :references; bh=vQR5gljnwr4aCOvufpueUZU1itTLbeOEfIMn7X2e+lg=; b=m5M3x4NtL8DM5P4zRldDx1SuTX+Wi48VGtfTFUEKHdXhWWngExLFJwje2VnjYfyPpV XYgff/FGGnkKY1EFnW0JGLmDPeU9ra3rhRPGKypDnm+4qN+yiBOHNhEke33vbNH4Nx2U 9cbU5ZGJxais21AEZaO+6eyRs/nDZGapV32J/Wc6WlYcSCGUuFAl089VTPYDrCDwgy51 gTekML8jaAXiOXbxXtsTdhYTGG4n3h+L3Ky85YtkmBfyoQ0WawkD2tqvFmhSoScGIMgz 2mTdiRWKsDknUz11V9FkYq8VdIQMcbuzYyUsc85DHHx7YcE/QqbaW9EWorVFGldhBSC/ nq+A== X-Gm-Message-State: APf1xPCjO1nKii9weIZAeRh5VoqxpbSUGVOFYov5M4zmpW1wPJtaNoXP AWDGR4Vo33LVeFCyYEg1NhUuGA== X-Received: by 10.223.209.197 with SMTP id m5mr26276124wri.121.1520607026992; Fri, 09 Mar 2018 06:50:26 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:26 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 01/25] nvmem: Document struct nvmem_config Date: Fri, 9 Mar 2018 14:46:55 +0000 Message-Id: <20180309144719.29904-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov Add a simple description of struct nvmem_config and its fields. Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- include/linux/nvmem-provider.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) -- 2.15.1 diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index 497706f5adca..a39f76ff2ccd 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -22,6 +22,28 @@ typedef int (*nvmem_reg_read_t)(void *priv, unsigned int offset, typedef int (*nvmem_reg_write_t)(void *priv, unsigned int offset, void *val, size_t bytes); +/** + * struct nvmem_config - NVMEM device configuration + * + * @dev: Parent device. + * @name: Optional name. + * @id: Optional device ID used in full name. Ignored if name is NULL. + * @owner: Pointer to exporter module. Used for refcounting. + * @cells: Optional array of pre-defined NVMEM cells. + * @ncells: Number of elements in cells. + * @read_only: Device is read-only. + * @root_only: Device is accessibly to root only. + * @reg_read: Callback to read data. + * @reg_write: Callback to write data. + * @size: Device size. + * @word_size: Minimum read/write access granularity. + * @stride: Minimum read/write access stride. + * @priv: User context passed to read/write callbacks. + * + * Note: A default "nvmem" name will be assigned to the device if + * no name is specified in its configuration. In such case "" is + * generated with ida_simple_get() and provided id field is ignored. + */ struct nvmem_config { struct device *dev; const char *name; From patchwork Fri Mar 9 14:46:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131131 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1081648lja; Fri, 9 Mar 2018 06:54:52 -0800 (PST) X-Google-Smtp-Source: AG47ELtGKDsWHJ4l73jj0vRZjiAQmun6WEqhr3pmsDLcf4iju/1TeqadADEo4v6s5YNUxgMyFoY/ X-Received: by 10.98.228.3 with SMTP id r3mr30490716pfh.77.1520607292762; Fri, 09 Mar 2018 06:54:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607292; cv=none; d=google.com; s=arc-20160816; b=AJ5+jjK1RtOIt2Tot1hTPOHHTFqQ9PBQv/XNN2aK/3eTWbaf1PZ0YmJoyJ1YS81Ay8 GI0G5EJdDusxMO/O9oAKyyGB7WYfDYUhd9MpUPqvQDJfQNz1+jlTZw+JkyhJOmnTwfxA UJAOZlMSUywmEXbHDjVNnSVIan/5ex/fzKPJlFIFsu6Vw3QsA4Q/NYb2sI5+9Yk9t3Jn khbXsbe/VA/CeWsQFQ3+l0PxpnGAHovw09SQbS0RPOFPPx3lKl9hXmaLa/KUNHttif0f SRQ2pbHY3MfxUbfKaPaPxsfFlsF9vqWEczwp7xiV/G7PUqxvn4+0ZhHp00uCy81fFqT/ G9Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=mKP2TnGnWIK7Bi0xi2aUnSgI/KaYTC2r/mhx+bI51D4=; b=Co/VbV6fjMCe9nPSnqCxJIDCwQh0Uf4Q4Srel5uBk8WvXOfCQmY0GAWU0kJdLj8ra7 T/WybxF0j5JOlro0fb6WfSBbKZ6JD/AdNC2Q9CWXU5sHM2iIf9ZZcf1XPt8n9EX1pWFX mcNVmSNPbrVJipmnPsKKifO7W6f+w5SoWERGU+6HthN0RUPltCKSnL5vWuiLbvA0ksFg X89c3W3O1ttPOi1Wvn9aNdNUGgm5T9IJbJfyPzYMpvXYt0fkhAlVat+jDjRBDmkGZw2N rH4mcSWYQs9AQrwvrMi7uq8ZcmF+rHgwP7ndGDz06ZORHVCVtAcxK4UGMCkH/6Ifr+Kd YTEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e8TBcfp0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l9si840959pgs.226.2018.03.09.06.54.52; Fri, 09 Mar 2018 06:54:52 -0800 (PST) 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=@linaro.org header.s=google header.b=e8TBcfp0; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932282AbeCIOug (ORCPT + 28 others); Fri, 9 Mar 2018 09:50:36 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:35057 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932144AbeCIOu3 (ORCPT ); Fri, 9 Mar 2018 09:50:29 -0500 Received: by mail-wr0-f196.google.com with SMTP id a27so1598773wra.2 for ; Fri, 09 Mar 2018 06:50:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=mKP2TnGnWIK7Bi0xi2aUnSgI/KaYTC2r/mhx+bI51D4=; b=e8TBcfp0fVYGZzwb0+3DfUenLg3kgLADFzVIrrswDGbQPexM5qAVtZbaR5zzzPQ61s 4WvsbXlD9cI9Ynxx9xDlJSpAj0sgWWg92aE0dUAdbPTY2iRH6ndnqH2aJ6won86H1Erk qK8Tm9AXQ66RnfGmyUGSDN8fhuv0NSAHKT/1M= 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:in-reply-to :references; bh=mKP2TnGnWIK7Bi0xi2aUnSgI/KaYTC2r/mhx+bI51D4=; b=XIFLf/czaBPLIdc5m+ZTAI3sLmdTL//1CypFdGWz7izOr68yKppbKnIeovrfwjIqtx DApQOEQ+nBHpeA+w0dpxWgOkrRgO7PK+IrmY5TuAXniQuHo9AYKjJ/VH7y0sz8BqYtYR 0EgBwErlxYRePV8P8K8FnoqCG/fiPD30LsG2kz/v5A8HNd2zto8wtGzoLYBRO9COMI2b bZzi55zJSPkoO2X5IecLyp24ccyh8uOX3NHa5eWygLhhXhZhPypc7SyizERhAm2wu00H HAFEE7M0CW4LVevvFWt3xFgeKCyiiNgDIVRHW7M13OU5QOQf9vUl5+3f8oHHg4jRBGM7 Ic/Q== X-Gm-Message-State: APf1xPDT3Y1JeM4wmPJJog/FSJ9HXlnpIz2H+KPS9zS+xFzKn+Phk1sA ECqzA91GZBuLJlPvFk9AUN3pCA== X-Received: by 10.223.138.153 with SMTP id y25mr25606025wry.257.1520607028099; Fri, 09 Mar 2018 06:50:28 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:27 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 02/25] nvmem: core: Allow specifying device name verbatim Date: Fri, 9 Mar 2018 14:46:56 +0000 Message-Id: <20180309144719.29904-3-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov Add code to allow avoid having nvmem core append a numeric suffix to the end of the name by passing config->id of -1. Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 11 ++++++++--- include/linux/nvmem-provider.h | 3 +++ 2 files changed, 11 insertions(+), 3 deletions(-) -- 2.15.1 diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 35a3dbeea324..99e04cfcc723 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -473,9 +473,14 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) nvmem->reg_read = config->reg_read; nvmem->reg_write = config->reg_write; nvmem->dev.of_node = config->dev->of_node; - dev_set_name(&nvmem->dev, "%s%d", - config->name ? : "nvmem", - config->name ? config->id : nvmem->id); + + if (config->id == -1 && config->name) { + dev_set_name(&nvmem->dev, "%s", config->name); + } else { + dev_set_name(&nvmem->dev, "%s%d", + config->name ? : "nvmem", + config->name ? config->id : nvmem->id); + } nvmem->read_only = device_property_present(config->dev, "read-only") | config->read_only; diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index a39f76ff2ccd..b00567a07496 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -43,6 +43,9 @@ typedef int (*nvmem_reg_write_t)(void *priv, unsigned int offset, * Note: A default "nvmem" name will be assigned to the device if * no name is specified in its configuration. In such case "" is * generated with ida_simple_get() and provided id field is ignored. + * + * Note: Specifying name and setting id to -1 implies a unique device + * whose name is provided as-is (kept unaltered). */ struct nvmem_config { struct device *dev; From patchwork Fri Mar 9 14:46:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131134 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1082243lja; Fri, 9 Mar 2018 06:55:29 -0800 (PST) X-Google-Smtp-Source: AG47ELvI1aWVe4N2B3Qagu/gMoZ5oxz/s6xDyz6ufOXQbuf4v5670Z2IE3Je77+YTk/D+Z8NZnmz X-Received: by 10.99.179.14 with SMTP id i14mr24448597pgf.45.1520607329028; Fri, 09 Mar 2018 06:55:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607329; cv=none; d=google.com; s=arc-20160816; b=a0Kg10RcnGm955Te8FQQMb/bMl6R3qICXK3XtrFqtiQW+C/Tgi8SMcpPSlj9kOsMB/ o2x1gH6YQLzzpkQk8WUkT/IddYlrHMazuLmGbOQxgY87NlsnBPKB0xJq97oy44aSvggk DRolvwv0HPMbGpSLAOXkqeW7NBI6B40C4ywA3NmMDTIt4ubztcSk4+ClqVLGtJOHs+I5 v1n7wvLoOIlgZjfuUwoaz9P3K1xtW3cQJ20CPup5QcAsqr0XTB0qGgE6suhurbXJ5lV2 k0sY+2V56N/dY/LqAKMRqp8yHrHb5KIwNluTLNgzHyjSlJqS4uUNGSiynXx8TOSxYOFh fGWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=RT33r5HhOvcPJ59VnfxCyDIOhWrlyqcWmOJNk3eMS/4=; b=uM9LfPPt8frZbqtB/FT2bdiESh2oqx6FBEPpqmmYPRnxsv2ucaWa7e8bsKzTpDW+KT XI4OGBgRsIHoX17o+gZ7EEvZCd8YfBgMLrRpslfJLdm9ZfxOPQg5AHCFXnq7+GUYpE8n lCOsUWqhzdkhMKgwohAlyydjzDaPl72WwEUuynYF11oYtItVf1Y//JbprZs+EzlFMU9r veiLR5cuz+Nuj60ad3k6Q4cU9WOJPCLGl1f+WHFj3u8f4yWoOnKqmm/Q/4N2WpXLpUsC nKmgG4iBURuwn194WDMCaM6EypbjcPoryXV0SKu47IyNtis/nDQYA9pIWExpZzUQf4lG G/3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YEu3kEpg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u3-v6si995691plj.207.2018.03.09.06.55.28; Fri, 09 Mar 2018 06:55:29 -0800 (PST) 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=@linaro.org header.s=google header.b=YEu3kEpg; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932257AbeCIOud (ORCPT + 28 others); Fri, 9 Mar 2018 09:50:33 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34751 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751237AbeCIOua (ORCPT ); Fri, 9 Mar 2018 09:50:30 -0500 Received: by mail-wm0-f68.google.com with SMTP id a20so3779634wmd.1 for ; Fri, 09 Mar 2018 06:50:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RT33r5HhOvcPJ59VnfxCyDIOhWrlyqcWmOJNk3eMS/4=; b=YEu3kEpg9ftU0mnIZUH6bihm5esPS6wbiM7nAa3I9mCjh5gFwyjahVOmGXhX2ktWZP g4uoFSzpdZZrgBjh9chDuBta8WxNKrAqSO4zX9JJ8+YnavbAig8AEJrBRxNILFJKaWpK d0HtH4hLTJTlTxt3rYCJ4K91vqhDCz1oFaGJ0= 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:in-reply-to :references; bh=RT33r5HhOvcPJ59VnfxCyDIOhWrlyqcWmOJNk3eMS/4=; b=P+DD1LpSZDqYfHzf4cfTtx5MK2RoywObGdXikRtwGoO8C7I1E95OtDg7vOwRwk3vjB wLHweJWmhYxVeevOqxMvIPqS9kquKCxQe2wEzImf4KPCLjJuO2Dsz5bzjOhehSOrK6LN is4Zzvln5cS3Uf7akKJiF6WvCVlbenWfmyW+j+EwueD3cOHzHw38Dc+x6bosHG1zVV7m rbPxfnFB4BAkMPt9EW8j5WMiPOmFR+beAgi2gB+UluPO1bZedBU/gdx9dgF4myjwQyOu e4qBZ/U+kDW96gfKE0cSxG6QJOF8solwYbxOTqw7u3Twmj/IO2d9wN5MJB3yaLnEYwkV 9c4Q== X-Gm-Message-State: AElRT7FiqmVWacfqo35O8tGI+EChTggsq+U/sN7HKcmWByFMDosln5Ua pzlNPXom0x3TFti3FRMudm3vug== X-Received: by 10.28.18.2 with SMTP id 2mr2164891wms.108.1520607029338; Fri, 09 Mar 2018 06:50:29 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:28 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 03/25] nvmem: Introduce devm_nvmem_(un)register() Date: Fri, 9 Mar 2018 14:46:57 +0000 Message-Id: <20180309144719.29904-4-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov Introduce devm_nvmem_register()/devm_nvmem_unregister() to make .remove() unnecessary in trivial drivers. Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 59 ++++++++++++++++++++++++++++++++++++++++++ include/linux/nvmem-provider.h | 17 ++++++++++++ 2 files changed, 76 insertions(+) -- 2.15.1 diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 99e04cfcc723..b05aa8e81303 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -549,6 +549,65 @@ int nvmem_unregister(struct nvmem_device *nvmem) } EXPORT_SYMBOL_GPL(nvmem_unregister); +static void devm_nvmem_release(struct device *dev, void *res) +{ + WARN_ON(nvmem_unregister(*(struct nvmem_device **)res)); +} + +/** + * devm_nvmem_register() - Register a managed nvmem device for given + * nvmem_config. + * Also creates an binary entry in /sys/bus/nvmem/devices/dev-name/nvmem + * + * @config: nvmem device configuration with which nvmem device is created. + * + * Return: Will be an ERR_PTR() on error or a valid pointer to nvmem_device + * on success. + */ +struct nvmem_device *devm_nvmem_register(struct device *dev, + const struct nvmem_config *config) +{ + struct nvmem_device **ptr, *nvmem; + + ptr = devres_alloc(devm_nvmem_release, sizeof(*ptr), GFP_KERNEL); + if (!ptr) + return ERR_PTR(-ENOMEM); + + nvmem = nvmem_register(config); + + if (!IS_ERR(nvmem)) { + *ptr = nvmem; + devres_add(dev, ptr); + } else { + devres_free(ptr); + } + + return nvmem; +} +EXPORT_SYMBOL_GPL(devm_nvmem_register); + +static int devm_nvmem_match(struct device *dev, void *res, void *data) +{ + struct nvmem_device **r = res; + + return *r == data; +} + +/** + * devm_nvmem_unregister() - Unregister previously registered managed nvmem + * device. + * + * @nvmem: Pointer to previously registered nvmem device. + * + * Return: Will be an negative on error or a zero on success. + */ +int devm_nvmem_unregister(struct device *dev, struct nvmem_device *nvmem) +{ + return devres_release(dev, devm_nvmem_release, devm_nvmem_match, nvmem); +} +EXPORT_SYMBOL(devm_nvmem_unregister); + + static struct nvmem_device *__nvmem_device_get(struct device_node *np, struct nvmem_cell **cellp, const char *cell_id) diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index b00567a07496..f89598bc4e1c 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -72,6 +72,11 @@ struct nvmem_config { struct nvmem_device *nvmem_register(const struct nvmem_config *cfg); int nvmem_unregister(struct nvmem_device *nvmem); +struct nvmem_device *devm_nvmem_register(struct device *dev, + const struct nvmem_config *cfg); + +int devm_nvmem_unregister(struct device *dev, struct nvmem_device *nvmem); + #else static inline struct nvmem_device *nvmem_register(const struct nvmem_config *c) @@ -84,5 +89,17 @@ static inline int nvmem_unregister(struct nvmem_device *nvmem) return -ENOSYS; } +static inline struct nvmem_device * +devm_nvmem_register(struct device *dev, const struct nvmem_config *c) +{ + return nvmem_register(c); +} + +static inline int +devm_nvmem_unregister(struct device *dev, struct nvmem_device *nvmem) +{ + return nvmem_unregister(nvmem); +} + #endif /* CONFIG_NVMEM */ #endif /* ifndef _LINUX_NVMEM_PROVIDER_H */ From patchwork Fri Mar 9 14:46:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131136 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1083182lja; Fri, 9 Mar 2018 06:56:28 -0800 (PST) X-Google-Smtp-Source: AG47ELtLKK9z6OgrS9kK5iGsmU5gm4vQh1ZauObpk0gfgTagSG5nvZ5KznQuxI5bw1niyrOlN18c X-Received: by 10.101.100.208 with SMTP id t16mr23652337pgv.398.1520607388786; Fri, 09 Mar 2018 06:56:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607388; cv=none; d=google.com; s=arc-20160816; b=rqGMXkhWrpt4sqWBGv4tiJXhez59h5dqoLvtmfDj+Qoad0/AfG7m50+sIUlLwf6p6T 60VMic/+/Q3UCtKgsLY2KeFIeR65zLu6JfOGHqoN/xjM3c6IsuQrztbi9922DX2+f80u gjGC6Mv9OBgIoEMlPVFMAklN8UYKBOnCaWnqRSNlMwTTmwX5pk6YlXO/t6jnM1AqWnk9 a3P4ojdc9lTP7C58M/PYpEJbLANTt5zc6G2Je7sgbos4uW3d13s51rMlTjue0ULzqwce L8ygF19aOlehig1HrzL31lIHJOi7iOAoaZk2rPirrGOd+TjkITwBhXj7bt41RKl8UF5e 7Axg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=BRXbg/NYMkWx49UVLwrgUxtCLt0980URCxFsjoA8MUw=; b=v2wbqNWOOaoqJvciuluaTR0Ce6yXoVX7vQaj/zyGk2o05bBHLr0Mff2ge22aa307X4 hy+1faJbr3McHZyqZE4srBTqZbTH6iQUiyZAFLnwsrU6pzXa6UIUe97j83CLAo81BdgN +AV/r7xkBUapVJWEepKOF7G0k0B3zbzNxjg/cpebkWeSPYPLSbkKGrbBWJ+IbzErL1D+ m4QeJ1pBeYaL/hcrcpWI3lLulPzxUgECCLGSv5t6UExx1Rxp/Q4av9TP7V0a5OcNufqm JL5ZlA/ZxvMyI9vANsfH8FnWlZEnglRZ/Cs/d42EUpr2y5xZ/V5dU1qP8ioaHBckqedJ dbHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iL4ZQnm/; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9-v6si1027983plt.242.2018.03.09.06.56.28; Fri, 09 Mar 2018 06:56:28 -0800 (PST) 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=@linaro.org header.s=google header.b=iL4ZQnm/; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932352AbeCIO4Y (ORCPT + 28 others); Fri, 9 Mar 2018 09:56:24 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:40606 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751239AbeCIOub (ORCPT ); Fri, 9 Mar 2018 09:50:31 -0500 Received: by mail-wr0-f196.google.com with SMTP id o76so9266205wrb.7 for ; Fri, 09 Mar 2018 06:50:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BRXbg/NYMkWx49UVLwrgUxtCLt0980URCxFsjoA8MUw=; b=iL4ZQnm/nJW8P1Rpp02O9OiTfE+tGn79Vz15rLdiT+tbmiwzxNjhyGWsLN+UMVXY9u ClEvOjx98q0WUBkYAshEZC287N8+WeEZ5yODbdWlb7mSi9llBWICx6+CjTsNDypJBYf8 H8X7wQEBkq94dvbEXTm78Kw4bkqp19/dSYFOE= 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:in-reply-to :references; bh=BRXbg/NYMkWx49UVLwrgUxtCLt0980URCxFsjoA8MUw=; b=ADfsO5i1FGPByGn1vMYMR8u9I7NsXn88DXcxSpS7pc6pMDj41VPEz6zE/hgYGqRbVw H/GvOyTDH7n4Py6AYQUf439o4OmZZOgX99y+u5UasS93qSnFwqB6vxUSIt7Th9Scb765 rbBJeofqqVfTXE+EM+cXBTlEg/kmnMPgM62goA+++K+Gd4c8G1kxhnml2kk8KSnU+bDY ejw2Qu+3WKE7CgxzXDdzsrN34Ls4IqNJtlp01JRtbC64YtOYp25hitD++1QuiirLndfP dVxa/h2VEDaHmxbekyIg1rtoiRGUxYotovsBCiELvbLcP3kueMDvpPVFRKRz/625v9QE tIYw== X-Gm-Message-State: APf1xPApMvTNC12M2SdCvLP2PfL22rAsW4tZ5tmm+5PpmbBKktDgKL6J xzjEBlOGkRV40B8pPWur9E2Uxg== X-Received: by 10.223.182.2 with SMTP id f2mr24195018wre.117.1520607030461; Fri, 09 Mar 2018 06:50:30 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:29 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 04/25] nvmem: vf610-ocotp: Convert to use devm_nvmem_register() Date: Fri, 9 Mar 2018 14:46:58 +0000 Message-Id: <20180309144719.29904-5-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov Drop all of the code related to .remove hook and make use of devm_nvmem_register() instead. Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/vf610-ocotp.c | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) -- 2.15.1 diff --git a/drivers/nvmem/vf610-ocotp.c b/drivers/nvmem/vf610-ocotp.c index 5ae9e002f195..5a395ffb2ca8 100644 --- a/drivers/nvmem/vf610-ocotp.c +++ b/drivers/nvmem/vf610-ocotp.c @@ -217,13 +217,6 @@ static const struct of_device_id ocotp_of_match[] = { }; MODULE_DEVICE_TABLE(of, ocotp_of_match); -static int vf610_ocotp_remove(struct platform_device *pdev) -{ - struct vf610_ocotp *ocotp_dev = platform_get_drvdata(pdev); - - return nvmem_unregister(ocotp_dev->nvmem); -} - static int vf610_ocotp_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -246,26 +239,20 @@ static int vf610_ocotp_probe(struct platform_device *pdev) PTR_ERR(ocotp_dev->clk)); return PTR_ERR(ocotp_dev->clk); } + ocotp_dev->dev = dev; + ocotp_dev->timing = vf610_ocotp_calculate_timing(ocotp_dev); ocotp_config.size = resource_size(res); ocotp_config.priv = ocotp_dev; ocotp_config.dev = dev; - ocotp_dev->nvmem = nvmem_register(&ocotp_config); - if (IS_ERR(ocotp_dev->nvmem)) - return PTR_ERR(ocotp_dev->nvmem); + ocotp_dev->nvmem = devm_nvmem_register(dev, &ocotp_config); - ocotp_dev->dev = dev; - platform_set_drvdata(pdev, ocotp_dev); - - ocotp_dev->timing = vf610_ocotp_calculate_timing(ocotp_dev); - - return 0; + return PTR_ERR_OR_ZERO(ocotp_dev->nvmem); } static struct platform_driver vf610_ocotp_driver = { .probe = vf610_ocotp_probe, - .remove = vf610_ocotp_remove, .driver = { .name = "vf610-ocotp", .of_match_table = ocotp_of_match, From patchwork Fri Mar 9 14:46:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131135 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1082435lja; Fri, 9 Mar 2018 06:55:41 -0800 (PST) X-Google-Smtp-Source: AG47ELs6MXkvKE7At2Wyoyg/IL26AfC5ClZL2tdwg8pEbdmzN8MJiryHxbzfB/hRRMa1pLNYVtTw X-Received: by 10.99.141.200 with SMTP id z191mr2545538pgd.418.1520607341397; Fri, 09 Mar 2018 06:55:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607341; cv=none; d=google.com; s=arc-20160816; b=KnUbe0V/xJIb0zXQTk50QaKr0o5sjwGVo1sCszwsCYBeAEbbFgzF8Tm87Z6MQ7oHTy W3UabNtrEp9Rofns1H5qf5jenMPEdJv1WxKarqzuv5rtzdR1UY2yoonPpB98NBQkY9IJ aO8tycUsveFyrbna7bhh06GQqjRuBNWLu4D7hFLoXa1C1IFwWuqoAgmXrUltjbnCvFkS 8+DyUWopUGD1L27r3tgAb/g31o1RPU2N2bptPZhm/KbFAXrSdNEm+J2fyoViF2eFjFOz 0gesckUval6ZeDhffiNHLkuoECbiv5lxM7/Y9i+aCAYE6wYvaDLVeUDi3/q9UUJ7zz/J PLyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=QB0wCS0zDECArGE81snX7r2xwwYd0ZHIjoAtnv+XtT4=; b=CFzk79a32rvfp6IeiLv7wiseMw65r3kSGXlXyhVzp6f/OCEZq3dSAV+ehF+7vPRTPV w53AQGhRLF07bmexzi5cOK1PjAAkaBPuDsoCF1hZ9RFi7+2I5AtNSMiTYXxHMDGg6N6z bAUxIRR6qh9lzKSlds9bjajhJpWVgXiBB+k0IZD0p5KabcXaAMOzKGInOuxrYRfcN0QY ZRyQFITTsjphQpHdY1cFOKgLYnhblZpzDqo03YiHego3/O1Kxxo/IbW7LQJT3o4CV/Bh 6345aHRjtnK3+jhCAPcK39AegUPttb0YMM0EIXJajWKUiM47nl60GsLpbapsunGMaP3/ Jz5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ML52Cz+d; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r16si968043pfl.163.2018.03.09.06.55.41; Fri, 09 Mar 2018 06:55:41 -0800 (PST) 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=@linaro.org header.s=google header.b=ML52Cz+d; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932446AbeCIOzg (ORCPT + 28 others); Fri, 9 Mar 2018 09:55:36 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:54555 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932238AbeCIOud (ORCPT ); Fri, 9 Mar 2018 09:50:33 -0500 Received: by mail-wm0-f65.google.com with SMTP id z81so4358542wmb.4 for ; Fri, 09 Mar 2018 06:50:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=QB0wCS0zDECArGE81snX7r2xwwYd0ZHIjoAtnv+XtT4=; b=ML52Cz+dNQ6g4zZ5uY8eDcu+icDYi0vqglxmGN3s8IGH/QXZWCiXs8hMqpvPbeyiSM 9NCAspVCK3UkmYiJZsHOq5hKZ1hXo3SOss3EAQDUVAPYR/jURbFrMOaJO1gllBYxLPwT aJuYGxw4AfIyNPgcMTgXsy9SAxcPCovfuC4n0= 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:in-reply-to :references; bh=QB0wCS0zDECArGE81snX7r2xwwYd0ZHIjoAtnv+XtT4=; b=O0C7yhTKNt0JXVxb+t+zFjq5sAQRXVUo81GQIfGX4K3e9iHDSbgs465rq1F8a+hjS0 Rgenr+HoYx4ykVinl4WZQllxZ/Z+sTGnPvMqNktoVb7GSJL9mJLRAwpp0ZnIrZTVXry0 30CHXmqcwyqUTctfFx/18Y2bTDwERuUTZ7IJCsJGAkHrTKlLRamnzHXn7wneaPwdpr54 5v+UiGNN3SUUPiFaiZMtL2hTbqEajedMa/O6b4ydIwfhb3rBVCcS41gR7t32ZQoatitP BOiMsQvwTvJkqa4+Ba6R554/EhffJ7zRyZVRoWHsjMGsUOTqyP7rzP1lOv1ui/6cf5bg K6lw== X-Gm-Message-State: AElRT7GmaS/2BeqKAWlNDRrLq4Jy2veaEz/SnefZKXzemsJMKf2u3tc3 15IlEJQFVaCpQ4DGIDGbnIyV6Q== X-Received: by 10.28.216.70 with SMTP id p67mr2421302wmg.36.1520607031610; Fri, 09 Mar 2018 06:50:31 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:31 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 05/25] nvmem: imx-ocotp: Convert to use devm_nvmem_register() Date: Fri, 9 Mar 2018 14:46:59 +0000 Message-Id: <20180309144719.29904-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov Drop all of the code related to .remove hook and make use of devm_nvmem_register() instead. Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/imx-ocotp.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) -- 2.15.1 diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c index d7ba351a70c9..f1482c664b19 100644 --- a/drivers/nvmem/imx-ocotp.c +++ b/drivers/nvmem/imx-ocotp.c @@ -466,26 +466,14 @@ static int imx_ocotp_probe(struct platform_device *pdev) imx_ocotp_nvmem_config.dev = dev; imx_ocotp_nvmem_config.priv = priv; priv->config = &imx_ocotp_nvmem_config; - nvmem = nvmem_register(&imx_ocotp_nvmem_config); + nvmem = devm_nvmem_register(dev, &imx_ocotp_nvmem_config); - if (IS_ERR(nvmem)) - return PTR_ERR(nvmem); - platform_set_drvdata(pdev, nvmem); - - return 0; -} - -static int imx_ocotp_remove(struct platform_device *pdev) -{ - struct nvmem_device *nvmem = platform_get_drvdata(pdev); - - return nvmem_unregister(nvmem); + return PTR_ERR_OR_ZERO(nvmem); } static struct platform_driver imx_ocotp_driver = { .probe = imx_ocotp_probe, - .remove = imx_ocotp_remove, .driver = { .name = "imx_ocotp", .of_match_table = imx_ocotp_dt_ids, From patchwork Fri Mar 9 14:47:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131113 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1077495lja; Fri, 9 Mar 2018 06:50:42 -0800 (PST) X-Google-Smtp-Source: AG47ELsOsaof+LnVSMNnkd+O/JXkr2IduV3yH2RmdceUgwn9s0FcEvxyWfoG5oqYaI+8ppaYUa56 X-Received: by 10.99.119.72 with SMTP id s69mr24369521pgc.224.1520607042056; Fri, 09 Mar 2018 06:50:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607042; cv=none; d=google.com; s=arc-20160816; b=ztTnUr9S0tptipIwr+Jzbx4fB0vEXzxErPt0HH1BCUIyosnms8d119UqXFoLpa0leA q10J82sfeNV1vXW1Wz7kIYUqZBNXnxzAHvTWpfEtPqs4rQadTzxrSoMHtuCjuuXn7Csu Onwj9FrbC8MfbYnF5lWvqONSgd+XhKj5CQQXv2e5Ur3zxxuvqkcTlcBVGHo6FWNMsxsb 4/QObOHWYTGJCUtVw2O9v/IXBfBoPa1+FD8opWhaRve4DSnlb+J1lnQ5xq+yrQ/PGnWs sd1wcMUTbEt3fyg3sEE/OvcLQFr0fYMS/jDqpCm/hsOe/1EZ2ZPyZ3vfg1R80SoHvFf3 Qewg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=iUanzWQSXWeBvkXCvc41usxvXwyGqv6365hkQYXbiXU=; b=MXAPCtN0KQxWXV7hGMcrLSOx24ecJWZH34vzOoejWTwAGctv8iPQ43nUOZNWe5cq8J kmCtNiVMAb1sU/0sVOq5rUakJXJ+bV9zOctzswai3dgr9emmQO0coVGiyKQ6IXLSaO6L nY8ybvEMRrFnSBzqwpC2hW/agXhGORgoaPXMpDHule0s9twsXgbC5jiQ24HKLSYfAf1/ l4YdJYHFw28WY/kBp/jtmfD7Zs1aUHR/n7ock6jZg3A+/w39OFsJkRT/T5PLRg5bm32U VneXLx1HE5Eh+bW3FLZbt4q3Ktky13Nk+sGS4eoLHoI4AJ56ar5EmWnKQDa9rVm69YnX p++A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q+XtcRfo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c14si821127pgu.341.2018.03.09.06.50.41; Fri, 09 Mar 2018 06:50:42 -0800 (PST) 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=@linaro.org header.s=google header.b=Q+XtcRfo; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932313AbeCIOui (ORCPT + 28 others); Fri, 9 Mar 2018 09:50:38 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:36717 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932251AbeCIOud (ORCPT ); Fri, 9 Mar 2018 09:50:33 -0500 Received: by mail-wr0-f194.google.com with SMTP id v111so9284553wrb.3 for ; Fri, 09 Mar 2018 06:50:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iUanzWQSXWeBvkXCvc41usxvXwyGqv6365hkQYXbiXU=; b=Q+XtcRfoMzwbeBH7rs3ZzfgZuEdme83w+iTpMLXwN7IB3/U6Rdi4Cva45cbFUUzhV5 y9yKSl0zyeHhRYw+hvlZ9kNVeQBYgRJc6XWYc7/LlpXxU575xdFd+f3QNQoxRPXCmRNB J7b+MjNU/3mWFN3JzDm5yWl0e6VR+WDMeNjKY= 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:in-reply-to :references; bh=iUanzWQSXWeBvkXCvc41usxvXwyGqv6365hkQYXbiXU=; b=JzZ1gsVRS9hp4uSl6Tpg9CpBWoYUxTH0jPtulhZPEtpsTqtgTFkvUUCk9MQgqlDyi9 1clth03tc6kC86x3sOaie5xNvq0nsOVJgyCy8BVjywpvTlv2E71/mNCbDvjjxaAzfLRd hYQC22uefZbdIcw7X5DhZ6cLMqzkKIIFOcsl5E8hR24puQd8HSe3V3aX4nhPZxIlpY7y pW/SWizH4jzIPT00DLDfzWrPKeUDIChSl3Hpoj0DzgSx8G9YbXEr8Gi5BiE9uHyOlD32 idM547BxIy85TwDROd8CPqVFQtILMt6zo31XsLGXJt/xCQMSVKp8ifqg7IhhmoRF+EtW kogw== X-Gm-Message-State: APf1xPABobAFP6dSGUhqqH74wOzPYZi5TTqvWSKVhZVAhhqbuAFJnLS8 y14U6ckSjwSGVcuw29k8KlKDKQ== X-Received: by 10.223.187.68 with SMTP id x4mr24580707wrg.80.1520607032756; Fri, 09 Mar 2018 06:50:32 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:32 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 06/25] nvmem: uniphier-efuse: Convert to use devm_nvmem_register() Date: Fri, 9 Mar 2018 14:47:00 +0000 Message-Id: <20180309144719.29904-7-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov Drop all of the code related to .remove hook and make use of devm_nvmem_register() instead. Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/uniphier-efuse.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) -- 2.15.1 diff --git a/drivers/nvmem/uniphier-efuse.c b/drivers/nvmem/uniphier-efuse.c index be11880a1358..271f0b2ff86a 100644 --- a/drivers/nvmem/uniphier-efuse.c +++ b/drivers/nvmem/uniphier-efuse.c @@ -60,20 +60,9 @@ static int uniphier_efuse_probe(struct platform_device *pdev) econfig.size = resource_size(res); econfig.priv = priv; econfig.dev = dev; - nvmem = nvmem_register(&econfig); - if (IS_ERR(nvmem)) - return PTR_ERR(nvmem); + nvmem = devm_nvmem_register(dev, &econfig); - platform_set_drvdata(pdev, nvmem); - - return 0; -} - -static int uniphier_efuse_remove(struct platform_device *pdev) -{ - struct nvmem_device *nvmem = platform_get_drvdata(pdev); - - return nvmem_unregister(nvmem); + return PTR_ERR_OR_ZERO(nvmem); } static const struct of_device_id uniphier_efuse_of_match[] = { @@ -84,7 +73,6 @@ MODULE_DEVICE_TABLE(of, uniphier_efuse_of_match); static struct platform_driver uniphier_efuse_driver = { .probe = uniphier_efuse_probe, - .remove = uniphier_efuse_remove, .driver = { .name = "uniphier-efuse", .of_match_table = uniphier_efuse_of_match, From patchwork Fri Mar 9 14:47:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131133 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1081965lja; Fri, 9 Mar 2018 06:55:11 -0800 (PST) X-Google-Smtp-Source: AG47ELuZ66ZXZwor7vGHih6YcHOnglkexmb1s5GME8DsUAx6Cp3ea4pJ+IQ6vUtsNIuGl9ulWzEK X-Received: by 10.101.101.78 with SMTP id a14mr24242045pgw.368.1520607311383; Fri, 09 Mar 2018 06:55:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607311; cv=none; d=google.com; s=arc-20160816; b=ihioPANCrvXajAsixFRURbhzfsx9jTvd8i/7ccJ/bynlWAQqtRAvGvPmVp0LeirsQt WIzNtPv8lST+FaRJ2cIPkozuUYrkx7dXyPtyQxNwQypWM4Ai8y4qYTp++YIt896/1UKB R8flVEM/uNelSADEbUDJ7CTCKIjp1/M27BMwCoDoQK6pgYf9Jp1b0LyS44k1QG/REQTw 0gvP8oJVBO0EeGL1AhN+zwCuTA9HVrOYJl991xlRqoVlxLnmgC/axDNJEVGJ9sKUXzoX Scb/aHc04cDBTKARte37fPCnVLmQ0gJiYgTCrzRK3mE5nLQa8tkNejHdQrHKS8NEWUKu lmvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=iwbfmImi6BY1sK40ria0J88daj3+9B9MGMgTb34A6WE=; b=fiJDCyfjsjJX5v7ZI1EE15CBhH1C12mqE3vI79WgSanNCYBTAHOCrOckq9dFcfuT/B KEGPYzVjNyUuvfINo6x85OU+1OYfj/4QirigtfYCgcgICC/k2O9CnLbOpGQ0mZv1g71g 6vpVg/8Y0dRrBoyJ3HWaSDKFpjsmIP6r2TteDCT5nIg88Av/w3G/reEVhxQGM+0TMid3 LWaDuNzuf1LuCQN6xSYB1RAni666eA4BHnp2DenMhjn/x8d9UokYZ0MSlWHEqCMgRsx7 RQiX+3KbKbkjkEXZjhYTVNeKtUuVNkNfWi+6LrNa0szRkuLPdPkt9emXJQhRr5sPRsgS jWZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J344GYMH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u3-v6si995691plj.207.2018.03.09.06.55.11; Fri, 09 Mar 2018 06:55:11 -0800 (PST) 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=@linaro.org header.s=google header.b=J344GYMH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932391AbeCIOzJ (ORCPT + 28 others); Fri, 9 Mar 2018 09:55:09 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:39411 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932259AbeCIOuf (ORCPT ); Fri, 9 Mar 2018 09:50:35 -0500 Received: by mail-wr0-f195.google.com with SMTP id r66so1681371wrb.6 for ; Fri, 09 Mar 2018 06:50:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iwbfmImi6BY1sK40ria0J88daj3+9B9MGMgTb34A6WE=; b=J344GYMHiD20rOy61HS9XJJ+8patVGdTHsqY2Tzl0CmrXeyOhmFWpfZv/P7J/NkD3G YX+i/DYv8aUZr71oKc1mr7Ix3uMi4FZqc4gbdHcuTYVlt2MVSdCjMXZ7nBDElaKNyDnB v1ogYWqK9SOjuk3HN3NQ9ElTLRO7eafYKss2M= 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:in-reply-to :references; bh=iwbfmImi6BY1sK40ria0J88daj3+9B9MGMgTb34A6WE=; b=NA8WqPs7FEy7TA9SmE62O33XWiQkPmxjqG713amVFLv2aPuk8aozr+mLAxfogBuKZT 8Cue291GaNZQAU/xywFTidi31Oidv1zAncdwyeb+v3KhuYbijGKOxjGfwdF+v4jjWjJB mz8i5XR52uuy7djC0tuziOoC26zn6IGRKqPPs8aq4wWnAGHgpnpDyucFNE7SW4KZDput Y1QGiTXaXlZufqHbxbxUN0HwtFwcceu3x8Z0NMxT9o6XAEfzf5iDw8afmqXz5TNdSnyo xMvd0UoX6Bnup0Dr7tFROk+coby9WyWPaomxwtY+XkSw3L+I1evtGA4PoYptpWSJXJaM 1HfQ== X-Gm-Message-State: APf1xPBgWCWVGDet4HAyhXXLWqqKU1Q4650l2AjyptJhZuDmAjhIYG24 5xdi6Z/GSywET4A5nSHIjduyBg== X-Received: by 10.223.155.142 with SMTP id d14mr27163482wrc.93.1520607033915; Fri, 09 Mar 2018 06:50:33 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:33 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 07/25] nvmem: snvs_lgpr: Convert to use devm_nvmem_register() Date: Fri, 9 Mar 2018 14:47:01 +0000 Message-Id: <20180309144719.29904-8-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov Drop all of the code related to .remove hook and make use of devm_nvmem_register() instead. Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/snvs_lpgpr.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) -- 2.15.1 diff --git a/drivers/nvmem/snvs_lpgpr.c b/drivers/nvmem/snvs_lpgpr.c index e5c2a4a17f03..cb471d5e8e86 100644 --- a/drivers/nvmem/snvs_lpgpr.c +++ b/drivers/nvmem/snvs_lpgpr.c @@ -117,20 +117,9 @@ static int snvs_lpgpr_probe(struct platform_device *pdev) cfg->reg_read = snvs_lpgpr_read, cfg->reg_write = snvs_lpgpr_write, - nvmem = nvmem_register(cfg); - if (IS_ERR(nvmem)) - return PTR_ERR(nvmem); + nvmem = devm_nvmem_register(dev, cfg); - platform_set_drvdata(pdev, nvmem); - - return 0; -} - -static int snvs_lpgpr_remove(struct platform_device *pdev) -{ - struct nvmem_device *nvmem = platform_get_drvdata(pdev); - - return nvmem_unregister(nvmem); + return PTR_ERR_OR_ZERO(nvmem); } static const struct of_device_id snvs_lpgpr_dt_ids[] = { @@ -143,7 +132,6 @@ MODULE_DEVICE_TABLE(of, snvs_lpgpr_dt_ids); static struct platform_driver snvs_lpgpr_driver = { .probe = snvs_lpgpr_probe, - .remove = snvs_lpgpr_remove, .driver = { .name = "snvs_lpgpr", .of_match_table = snvs_lpgpr_dt_ids, From patchwork Fri Mar 9 14:47:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131132 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1081695lja; Fri, 9 Mar 2018 06:54:55 -0800 (PST) X-Google-Smtp-Source: AG47ELsUAAFTh7IO90RIpa6fBdqlC5H6KvUEq5k9hxlqisyYZMDFfWzTeH9q5Y2S7Wx8ANdMBrlv X-Received: by 2002:a17:902:bcc5:: with SMTP id o5-v6mr26969236pls.86.1520607295700; Fri, 09 Mar 2018 06:54:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607295; cv=none; d=google.com; s=arc-20160816; b=ZHhQSatHsGCFzOF975KGe+ww0V9qUqYG4+lGiC6RJ8KsUuIJ4sPaBv1xNEP4GVox+z e2pIuv/QvnvgVhwpbFOnktTnqFeBvNPUirFAVHi9VUyEy9keCzT4SLHW3cI7niLHyJjO M8nmK42yNIANqAZTgsA5ng0c36GW+pF6sTM7/Vyma4McG6mYTG/7Zgg2l64KCANuDYmD 0LmKm9pK+imZQVqVDVXQ2wFh1ughWsgDAwonunglRxFqFczIFv+X/MPrwTuk6qd1O0Wy fkLF0P8KPucFuFM64CC4lHHLeVn8vGW3BpOaHWVjsyOrEqxuvzq0wWbcsWOCC9Y0jljX U/tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=gAUsHSbOIFU6E1G8a/YdYu7okTBUkxYiiz5tKmU42xU=; b=AOENRcDPtlbt1Cw7wpqOwKp0gNp/BopGhiTrPBg8o/nOE58ez6NzW65b6kdLnk+MTP 3NhJrzvRIeJ0Xd6BzZjNWX92Hzz2Rlw+2Sn1ATHe3x4EIdbnHTCUBZz4fNglc9GKjSQx KagqmzIEm+sg2FJdJdy3YmflyVKoCUyNJzHaPOGaR7YM/e3Uj2hZuf+eanG8F7EmAe0i 91uNIgWzIn3GbW8PysO8l9PNyEFBRqBwlEMe3yQxj10L0FlJjXq7bOVLmsu+Vv8lOSaG gF9dWOf3m3+MN76dHX4gy7miNfs8zVl57qGjDj8pBDBPaQeT1dZx3fC+xovk546R+cdP 072g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Lan+og5r; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l9si840959pgs.226.2018.03.09.06.54.55; Fri, 09 Mar 2018 06:54:55 -0800 (PST) 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=@linaro.org header.s=google header.b=Lan+og5r; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932423AbeCIOyt (ORCPT + 28 others); Fri, 9 Mar 2018 09:54:49 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:44478 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932276AbeCIOug (ORCPT ); Fri, 9 Mar 2018 09:50:36 -0500 Received: by mail-wr0-f194.google.com with SMTP id v65so9264478wrc.11 for ; Fri, 09 Mar 2018 06:50:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gAUsHSbOIFU6E1G8a/YdYu7okTBUkxYiiz5tKmU42xU=; b=Lan+og5rxR48wxgbTrCYFdTnZaEAjSUiHPAesFvPqowA1AsfIunl7HphF+FCn+Axrh +oqomh+zeaI6VLZqZ/HelS1M46uDJva1D/RrzMtdq1qs9w44dZP/TrRqKnTxr3vSNJ84 /mWBeWv3bqaoEOvm5nIpr5TZNGJIYLW1ejvkg= 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:in-reply-to :references; bh=gAUsHSbOIFU6E1G8a/YdYu7okTBUkxYiiz5tKmU42xU=; b=OUxOaVSA3j2nLILB4R47sbXk7FTpY2371W0KiHkVCnOUpFjc3zhsfT6cIunp2Siacs 9CD2W8RjwFbPTVrAk51uZbWm5QZuvvPlczvA3RXsiQ4qOKU74SdYZy7qapLePKSU/6Zo WwvLhqMAKq5TAEdv9l+Upuyxb+jUzKcRkgKxnK/M9pl2JUjsVsfg1Atq/h/DAQH2OPae KTwwMJCTK6zBXd6GOhQypIJQCt5zWayQOYcj1j5bU92K+5l1YYnOBkwnvQ0PpPV8mQsW h1Qvr34KpchTVYv8WXJvXHRwF9rMyR9iTfu0DGiOQsYVOE4P7C0JYC1l2wa6no0XnP8b 0sXA== X-Gm-Message-State: APf1xPBlytDAKmXm+JRDTZ/Uvck1xLtACmlo5ZKFeyNfKvZgQY5JOcqx SGEZfU+nQEHnCl90VvvEVlujFg== X-Received: by 10.223.158.10 with SMTP id u10mr27145313wre.165.1520607035105; Fri, 09 Mar 2018 06:50:35 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:34 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 08/25] nvmem: rockchip-efuse: Convert to use devm_nvmem_register() Date: Fri, 9 Mar 2018 14:47:02 +0000 Message-Id: <20180309144719.29904-9-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov Drop all of the code related to .remove hook and make use of devm_nvmem_register() instead. Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/rockchip-efuse.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) -- 2.15.1 diff --git a/drivers/nvmem/rockchip-efuse.c b/drivers/nvmem/rockchip-efuse.c index f13a8335f364..fec6e4c48b9a 100644 --- a/drivers/nvmem/rockchip-efuse.c +++ b/drivers/nvmem/rockchip-efuse.c @@ -289,25 +289,13 @@ static int rockchip_efuse_probe(struct platform_device *pdev) econfig.reg_read = match->data; econfig.priv = efuse; econfig.dev = efuse->dev; - nvmem = nvmem_register(&econfig); - if (IS_ERR(nvmem)) - return PTR_ERR(nvmem); + nvmem = devm_nvmem_register(dev, &econfig); - platform_set_drvdata(pdev, nvmem); - - return 0; -} - -static int rockchip_efuse_remove(struct platform_device *pdev) -{ - struct nvmem_device *nvmem = platform_get_drvdata(pdev); - - return nvmem_unregister(nvmem); + return PTR_ERR_OR_ZERO(nvmem); } static struct platform_driver rockchip_efuse_driver = { .probe = rockchip_efuse_probe, - .remove = rockchip_efuse_remove, .driver = { .name = "rockchip-efuse", .of_match_table = rockchip_efuse_match, From patchwork Fri Mar 9 14:47:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131130 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1081451lja; Fri, 9 Mar 2018 06:54:37 -0800 (PST) X-Google-Smtp-Source: AG47ELs4QmxvOw2pIw9ICxFGuTjDhKyzG2rYBLdiewwXc+lftdSwsjahjb2AoW1QSjw8f2J4zz0f X-Received: by 10.99.191.15 with SMTP id v15mr24549742pgf.396.1520607277687; Fri, 09 Mar 2018 06:54:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607277; cv=none; d=google.com; s=arc-20160816; b=uj0P23U5gk9x61mjAfhR7hZWeN0swxqVyfGfZvC7LiW55Tllifg9TQwKEjiRE6SMq3 i4iHUUhdyAuSLieLGatcJv0KYo24xvZFw1eNmKbHUxJQgmRPFJNbo73YBsYQ5JzGpj/y wWqaTdpV27GfLrAxmBgR9dronUDfyvcoP/LmRgyG0UE7aanxkyFTEk1ZjgeswFUwfovX +Os1gjhHNDlXLp8pYPx2OyUCMtoLEVXlkNJ3hIFbgJbAU8LKdNrfqs5u9PnKg3nmLKU+ M+4n91z2bC0hPjknAJHa8Fh0Csj0OAGOM9cUPl6SW8KMR4TNWDT4529uz1BtHF93qDqJ VgZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=KumflxtmCK4yZqAwSsdyJfWj2rBtjIqqQwGZdvKlUXk=; b=kCNXpVSEqEx3tST8I/57ql6yNNNo/D7ZMhbYBaSPnqeqgQI32LyUMqXJZF2OvQ0+++ fXPB3+9bIPM4969f9x/dXEpsu87gYihSFSEvabOVuwAIehereR4xrezLjMzMtMTu0rtD ZJRl5embOVtklRqxFXfW/CWWNMjNmC+cGGXisMTLwj84ooXGm3XqpncdV/pDDgZk8jaP o2jHcP/JsaAN5wgkLyJciloW5uZyxSceJPlnjSLAVJmEsVfXO0FwkKllxb32LAiGFrof XSTkBl6fFHarJ9qWDxmpCzKwewO3rqucLTWLIWeclkpuMnbj1cfFDP7WbcRgUd2EA7zi /fWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fPtidxFT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z8-v6si989208plk.305.2018.03.09.06.54.37; Fri, 09 Mar 2018 06:54:37 -0800 (PST) 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=@linaro.org header.s=google header.b=fPtidxFT; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932374AbeCIOyf (ORCPT + 28 others); Fri, 9 Mar 2018 09:54:35 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:41510 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932144AbeCIOuh (ORCPT ); Fri, 9 Mar 2018 09:50:37 -0500 Received: by mail-wr0-f196.google.com with SMTP id f14so9266949wre.8 for ; Fri, 09 Mar 2018 06:50:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KumflxtmCK4yZqAwSsdyJfWj2rBtjIqqQwGZdvKlUXk=; b=fPtidxFTo1ed9GtqAgXk7ICat1QVujo3gnoK2s1y4650tRYmkRnwuYKEO9DjOToLii 3mEuT1nlCPEDCZz+3zAme/6pF/LvONdHn/h90aSbEAqULMI8JdjCVv0snHDcv1FIj37h nM0rKXd3HCUnwmjZLFm0iEQXN4rsZDPfWt9ms= 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:in-reply-to :references; bh=KumflxtmCK4yZqAwSsdyJfWj2rBtjIqqQwGZdvKlUXk=; b=mcR54HONJ5mwwMoNlZ7FoqLCavrcXqa9h1XMeT/odkceiUI90QxsFOcV23b7kyUOnR +wCE2zcZbHrO2IJ6wuXWf63wD2zvJFmNMdlIyyTUvRnshoPYMr0AYzVD4/CX4K8sD6pB w7NLxAp6borJCtBtVB4Dlj1h8eaw1gxb72RxxMBj7M+GZRE/pZI+VS752yJcFI880lWW HJ7bSZacIpytpgGN6hIvsBgislrDbF2cwRwVws4QWycyu6+l/02LYrjGWabGHZIn45g8 zmtwErype1Ct7Jrf16GqsReXP6jJV4A86glekbUp1PBYPQX/n7bhrPP0YCfLtl0olPgA nUfw== X-Gm-Message-State: APf1xPAOz9L23mpHlo8zY/zz4ZqI2U9+d2jz+MKg/O95IU3OcC6pik0l 0Q29L0wW7acnZPehPiOL5+g5oQ== X-Received: by 10.223.201.142 with SMTP id f14mr27058277wrh.40.1520607036280; Fri, 09 Mar 2018 06:50:36 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:35 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 09/25] nvmem: mtk-efuse: Convert to use devm_nvmem_register() Date: Fri, 9 Mar 2018 14:47:03 +0000 Message-Id: <20180309144719.29904-10-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov Drop all of the code related to .remove hook and make use of devm_nvmem_register() instead. Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/mtk-efuse.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) -- 2.15.1 diff --git a/drivers/nvmem/mtk-efuse.c b/drivers/nvmem/mtk-efuse.c index 9ee3479cfc7b..e66adf17a747 100644 --- a/drivers/nvmem/mtk-efuse.c +++ b/drivers/nvmem/mtk-efuse.c @@ -72,20 +72,9 @@ static int mtk_efuse_probe(struct platform_device *pdev) econfig.size = resource_size(res); econfig.priv = priv; econfig.dev = dev; - nvmem = nvmem_register(&econfig); - if (IS_ERR(nvmem)) - return PTR_ERR(nvmem); + nvmem = devm_nvmem_register(dev, &econfig); - platform_set_drvdata(pdev, nvmem); - - return 0; -} - -static int mtk_efuse_remove(struct platform_device *pdev) -{ - struct nvmem_device *nvmem = platform_get_drvdata(pdev); - - return nvmem_unregister(nvmem); + return PTR_ERR_OR_ZERO(nvmem); } static const struct of_device_id mtk_efuse_of_match[] = { @@ -97,7 +86,6 @@ MODULE_DEVICE_TABLE(of, mtk_efuse_of_match); static struct platform_driver mtk_efuse_driver = { .probe = mtk_efuse_probe, - .remove = mtk_efuse_remove, .driver = { .name = "mediatek,efuse", .of_match_table = mtk_efuse_of_match, From patchwork Fri Mar 9 14:47:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131128 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1080823lja; Fri, 9 Mar 2018 06:54:03 -0800 (PST) X-Google-Smtp-Source: AG47ELuFDRwcmIBxMLQVbkQ+L2fwe5IsOp7tYBDaw88DrAPkHghejXtPYoA6JHeFvSGN2lQ+yN8T X-Received: by 10.101.80.68 with SMTP id k4mr24163659pgo.81.1520607243517; Fri, 09 Mar 2018 06:54:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607243; cv=none; d=google.com; s=arc-20160816; b=bPilevxpdPrCM3I4vrSXtDm74zDYKXUYkdMIgFsfjeaHdUPPqsMAqM8Q6g0I4ZfJXD aliO4WpFiykEnvkMvfy8x+AvFOXSmBhhLRkbVRMaO9YFdH3ZCPRbZ+5j3t567x5WPOvJ 9U0YBzQCZQS5EfXU3x/orZX2xhfU+t8jRmVaRTdRcAxQq0UcF1e40JRde1/YlL4U8lal dX5CpH06ORFCXasV0oZdb33ObKtzOuXysAzLW75TNpoIVDjvr/+W9FdrL9YgXlISPHvB /7jjGpAT0aXpvhDpfhmI7lCIfJPL2UVYrgWR9yqR8SrkCOEP6iaCayyQohLMKtfXF0Gk XFbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=GiAJ0y/oM9bIBNlXIbJzrUS+2Mb/ffkH60fs1tEzvvc=; b=ymrMdsHQrEWT7XptKEqRb3ikiAKaLU0m5TEoEWjPGG7Yaq+U6xKxdIGx1JupwCcWCY lutnaXhT6TFfGWRnEiCESH9LTYSeIiNjRkQDVe+0qyEzAfxAxm3A8Wf4oayRj7tYq71D 4+TDoxBcLvy3cMQgivWA/Yck0Wl+6Z0xWoVI5UpLOztD74iSo6Ywzcu5ERhXRtMpCX4s ZNGVZvaFML8UkM3MHk42gEHx9d35YA7Y+99DkVWsxbIFK4h7KqZw1KopmmaCxluHB/mQ SYp5XfO0hU77jiYHYbBS7kYEz/TowGl8V7OPJh3IFIP4vkzRtrXIs7Bvo15kSbCLw5FD PKCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WYcHWGWN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91-v6si981357ply.517.2018.03.09.06.54.03; Fri, 09 Mar 2018 06:54:03 -0800 (PST) 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=@linaro.org header.s=google header.b=WYcHWGWN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932332AbeCIOuk (ORCPT + 28 others); Fri, 9 Mar 2018 09:50:40 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:50988 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932304AbeCIOui (ORCPT ); Fri, 9 Mar 2018 09:50:38 -0500 Received: by mail-wm0-f65.google.com with SMTP id w128so4432977wmw.0 for ; Fri, 09 Mar 2018 06:50:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GiAJ0y/oM9bIBNlXIbJzrUS+2Mb/ffkH60fs1tEzvvc=; b=WYcHWGWNtweb1cO43/4Il4Z9kftoh1WQlzvdX4k/OfG5gKgEKkzq6L8LSp6xrDDCvj VTyZUytveYCH2hVRVogFW1JcvtWlAyqlbro18q/yaa9s18WGDCzDTCgVJbYjOqLGG0L7 BXxw9CVzxq/YEquMVe9+rNFcysCPcDFlfPilY= 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:in-reply-to :references; bh=GiAJ0y/oM9bIBNlXIbJzrUS+2Mb/ffkH60fs1tEzvvc=; b=BQnVe/4I15591bLQSQDVBksuwJpHE90JB1dgTxMOBQmbZt/Ce8hL/nnEvkfU6/kYXU G5vn9esJoqseU8blxBTwSionkLFbitPpMQCnqhT/tawk9Yar9mSVNUVwCUcgUVzug/3p yRzVFut/NKGfHz3yGKSGzRKvbT2S8Uw8Vx1ptpjA0uD79n7kmDv/LQZJPt9ZTg9rOqfH 5ujT49OvXQ2xowUwOregTzQ1oNxprpJN8/VOJXp9DCb7RzmicGG+HBdyoK23d+GepyVa p0JN2w52SL9xNGCqiST36d5sw7jnxnMhNcKfKe9Nb26iATqvMEbzB7gNUiyW0OATTt2F ISGQ== X-Gm-Message-State: AElRT7GkSHpM0VqPyObkoWIZ6vCIjaehSG3UT76MK10Zy1swuD8v4oQG VC3Cp4r0kgBYeEIrW3stuLYZ8g== X-Received: by 10.28.236.154 with SMTP id h26mr2449193wmi.77.1520607037440; Fri, 09 Mar 2018 06:50:37 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:36 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 10/25] nvmem: meson-mx-efuse: Convert to use devm_nvmem_register() Date: Fri, 9 Mar 2018 14:47:04 +0000 Message-Id: <20180309144719.29904-11-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov Drop all of the code related to .remove hook and make use of devm_nvmem_register() instead. Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/meson-mx-efuse.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) -- 2.15.1 diff --git a/drivers/nvmem/meson-mx-efuse.c b/drivers/nvmem/meson-mx-efuse.c index 41d3a3c1104e..a085563e39e3 100644 --- a/drivers/nvmem/meson-mx-efuse.c +++ b/drivers/nvmem/meson-mx-efuse.c @@ -233,25 +233,13 @@ static int meson_mx_efuse_probe(struct platform_device *pdev) return PTR_ERR(efuse->core_clk); } - efuse->nvmem = nvmem_register(&efuse->config); - if (IS_ERR(efuse->nvmem)) - return PTR_ERR(efuse->nvmem); + efuse->nvmem = devm_nvmem_register(&pdev->dev, &efuse->config); - platform_set_drvdata(pdev, efuse); - - return 0; -} - -static int meson_mx_efuse_remove(struct platform_device *pdev) -{ - struct meson_mx_efuse *efuse = platform_get_drvdata(pdev); - - return nvmem_unregister(efuse->nvmem); + return PTR_ERR_OR_ZERO(efuse->nvmem); } static struct platform_driver meson_mx_efuse_driver = { .probe = meson_mx_efuse_probe, - .remove = meson_mx_efuse_remove, .driver = { .name = "meson-mx-efuse", .of_match_table = meson_mx_efuse_match, From patchwork Fri Mar 9 14:47:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131114 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1077546lja; Fri, 9 Mar 2018 06:50:45 -0800 (PST) X-Google-Smtp-Source: AG47ELvW+ntAss9wVmuFYllBzwZRz4xr1LtivMDrt7GQmzUDihLOkKbknKa0QSXsgPjZGs2P2h7G X-Received: by 10.98.41.134 with SMTP id p128mr30611147pfp.120.1520607045175; Fri, 09 Mar 2018 06:50:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607045; cv=none; d=google.com; s=arc-20160816; b=EeF5+j8TU4x5LvzCR46bHwdy649Bi7doUTStEbsU4YC0kBllgUwqwiR/6tsNDGrI2C AQZjQlzVpP+INGMdmPzJcbj2mMPu5yJbRbls0gnErsNbKWimh/pEI7uOiojn0pZ554Js YkQulgrc5ioMgkB9o/871K3gE7N7QzfatncR/lFZZabPjxsoUZkLyFId5xsL2xQb3szd ClhsHbTa8IiR/H1Bj8ZJgMSoKm6Ryp0aINof5smTOeMTfG0YPuB7URippWc0SW/U/4J5 iDo50J7wvPm37hDGVq0wZBDkazcbYdLSTf/ZGppvm7EV4F+tAea4bccKS3gz29OvZn/R LTYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Kj3Wgn8PCDjUYLmW96ZzmQO1V0hWd6X4T456qfUITAw=; b=glQMc5Lr9z4vlHb7zYAg4nptuM/eH1Yy7LLmGTEgmheYFrt9t9HJfRNFpWGqPUVKXQ Rwqjx36Tl8BtZEXlpb29pLhF0o3I7oMltt+qBtYxEAvYIZ+bCcB1XIfAAOjgFit4oCzG 6LWlcmWxpWq+FqbBLLSNeReOodQnfYURvhG6U8sbZ2qvRUqADpqW7Au5JccihtN1ea35 chP+aFjJPc/tcnUgnaHHt5b1YgZGo6FaRii8X8OU4F4w60dOAHn2ZxRdrlnORz3gX27e aVd2IMqmC9FCIXqZW5lHF6gYke3Vq/8yRzfuMMrTGI0D5ssTzpZFsg9yuw7ug7107iNb wayQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AUS1Fyl8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c14si821127pgu.341.2018.03.09.06.50.44; Fri, 09 Mar 2018 06:50:45 -0800 (PST) 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=@linaro.org header.s=google header.b=AUS1Fyl8; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932350AbeCIOum (ORCPT + 28 others); Fri, 9 Mar 2018 09:50:42 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33258 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932251AbeCIOuj (ORCPT ); Fri, 9 Mar 2018 09:50:39 -0500 Received: by mail-wm0-f68.google.com with SMTP id s206so3793751wme.0 for ; Fri, 09 Mar 2018 06:50:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Kj3Wgn8PCDjUYLmW96ZzmQO1V0hWd6X4T456qfUITAw=; b=AUS1Fyl8lyNpzJat7M983kUbY8VH86gvAxQLgKg2qAxx3T10QI85gqRjVivYkLgv/u gkMM/3Ec6UaUnbOlfBKS1IuhJ6tdtK/izhb8IpdwbGmBHnQolNOYSAyfjkDSeUtWoU+d zTtsI8NPdTTXoRmw/Ejt3SjRIq2JH4tvtkvg8= 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:in-reply-to :references; bh=Kj3Wgn8PCDjUYLmW96ZzmQO1V0hWd6X4T456qfUITAw=; b=k2cSImSmrdK6GdA2p0whjx5Q0N5BPZwHEiaLSHH/CSnqxlfYwoNS46fHGALLACniw9 Vd7mvkZOCtw/u7g+c+mlSEUAfhrmIVj2ZaMClCmwWTXwTdwz9kPGgvNfJo4gm+EeZYjG 5O5LMRXIbPuTSydDrcBkHF6zPBAD58PlBzO9QNkG8/y00CtyB3d36ujA+uOn2DRE5M2k K45G25g/qYVuaLm2JXa1E+jLn7lGEbnMo7IMKZnrZaiNYA2Wxjq5BZcYYOVm7tnHOg0V w9J39Vk8XJC/rx8V3n2iLA9junONWebcAty5T6oqeJObzHHvK+QGUHwFdFUQpd7cX1NO A4Cw== X-Gm-Message-State: AElRT7HHY1qsI2yF192rnUcyDX2IR/voOgGas7DUX+S+VX/rRZ1NkcHi rMU2l8xCwtS68ABAJk/AROleyg== X-Received: by 10.28.125.197 with SMTP id y188mr2231116wmc.150.1520607038600; Fri, 09 Mar 2018 06:50:38 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:38 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 11/25] nvmem: meson-efuse: Convert to use devm_nvmem_register() Date: Fri, 9 Mar 2018 14:47:05 +0000 Message-Id: <20180309144719.29904-12-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov Drop all of the code related to .remove hook and make use of devm_nvmem_register() instead. Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/meson-efuse.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) -- 2.15.1 diff --git a/drivers/nvmem/meson-efuse.c b/drivers/nvmem/meson-efuse.c index a43c68f90937..71823d1403c5 100644 --- a/drivers/nvmem/meson-efuse.c +++ b/drivers/nvmem/meson-efuse.c @@ -60,25 +60,13 @@ static int meson_efuse_probe(struct platform_device *pdev) econfig.reg_read = meson_efuse_read; econfig.size = size; - nvmem = nvmem_register(&econfig); - if (IS_ERR(nvmem)) - return PTR_ERR(nvmem); + nvmem = devm_nvmem_register(&pdev->dev, &econfig); - platform_set_drvdata(pdev, nvmem); - - return 0; -} - -static int meson_efuse_remove(struct platform_device *pdev) -{ - struct nvmem_device *nvmem = platform_get_drvdata(pdev); - - return nvmem_unregister(nvmem); + return PTR_ERR_OR_ZERO(nvmem); } static struct platform_driver meson_efuse_driver = { .probe = meson_efuse_probe, - .remove = meson_efuse_remove, .driver = { .name = "meson-efuse", .of_match_table = meson_efuse_match, From patchwork Fri Mar 9 14:47:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131129 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1080929lja; Fri, 9 Mar 2018 06:54:10 -0800 (PST) X-Google-Smtp-Source: AG47ELsthfb3bku/R8wLmhXkIMgcxs9ff0V7qrd7LdKZ35RLhZfZ69AGxj9xhQtgPZ/I83fekiqI X-Received: by 10.99.66.65 with SMTP id p62mr23982142pga.378.1520607250034; Fri, 09 Mar 2018 06:54:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607250; cv=none; d=google.com; s=arc-20160816; b=oW2I8Jla7gp+06sCW+PEqc8OHCCWqPMs3LEdo88Lb5M7Lls8ti8dAjpDGmizM6xp4b w06wOjYvOLXm0Xevc8ir8aPH2Tax10B0nu9xlpL0YAxfw1wj/tdWAq5lmbReN0SwPoSf ZuCF9SPmKHMgaN+gFIhBIe45qX/M7x6G6qqzc1c1lR7oqzJ45b3n8yduhOwf4t/ZaXLT Sotu5aa+v5E3QL62b8Ze/TnV4C1TMTKVDAE8Fke9RPWl9c0l8cCnpGMshTCdw09OrtEb WtJi7B0n7OCC1bqw/eVCGrOV99ugr0WJMBIAw2XVskNtM3Al47KB6+z3rANaYFXoYH4M ImQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=RavD4BX1QznlPkzfSUZRMQAlKOGAL73sP/pXb7t41AQ=; b=ebG3SpjQeXASn8atVNg7qti2zK/dxkYcelO7YZJor4LPHcqx3oUs4MbgtkTWvvNKE3 5kNW31UBimjyTKu1EsvfVx11XcwlAW9AsUvfvAkm+HhDL6veJrWCOOpHYmQx0smXp/Rh JDE1IoNM7d0GvewGyJ2C6kFCcXECrv6C7nO4BJI4uAUgNCC3dBss9ww6qex8/zd/BSYX vR3uwVJSMD44+HqrsxJh+a3D4kVqDtbh+6fQBc9LvwYCMglYwTMj+Jp9/PgBwFaaroRS rCgLK4Smj28B5MQApQTEqK+30yeJwlkwNUF8msD9frEBqn2z3ckEvP2uDIM140yS9+9K eMgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HqxbwN1e; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z8-v6si989208plk.305.2018.03.09.06.54.09; Fri, 09 Mar 2018 06:54:10 -0800 (PST) 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=@linaro.org header.s=google header.b=HqxbwN1e; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932388AbeCIOyC (ORCPT + 28 others); Fri, 9 Mar 2018 09:54:02 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:40172 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932333AbeCIOuk (ORCPT ); Fri, 9 Mar 2018 09:50:40 -0500 Received: by mail-wm0-f67.google.com with SMTP id t6so4361220wmt.5 for ; Fri, 09 Mar 2018 06:50:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RavD4BX1QznlPkzfSUZRMQAlKOGAL73sP/pXb7t41AQ=; b=HqxbwN1eWY5N2HDvShlXb7TQAIEABuYiDW4XCNBi+ZBFhWz/ojHmnqs3nrlZmYRHLo KpinbxFku/tKJlrGYbBQCjayIFleayqEqbbzV2ZzzDcpzjzuahu8oxjhEqnK8vTsIE3S YaF208oL9C59vrCPvTkiIMRR/871v2PT1hVEI= 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:in-reply-to :references; bh=RavD4BX1QznlPkzfSUZRMQAlKOGAL73sP/pXb7t41AQ=; b=ZPSffcS+oQEM01Dql6DE5PH9hRIfS+mFO5OR6Fj0DIqODfdm7IKsYAnWSE+Cj0O6XF irtPT/G0hQrl3NnyoorosQtyJNYvzWHbk5kYNRiba6xpSikswh0dIz1qdAkzOTQAwzap lGqRPiD+jwygc7iQlzhK382EvXPixfWD0/RxTCqTdjngZuH+Mva4XTcRZi4QoBStmpcN cCr6loKhcpjVwSdbYLs9nIt/NHHXBEZyLbSNiO5na3DKnjfkz/BD8OIrl6M1rESooUIt RhcbYou7S6YDggVDOa/5vO8sjsJoRnyL37+WwjNuLhnVgM+3tdgb15iwMDsafJjRZSUN HZsw== X-Gm-Message-State: AElRT7HI6VEkOZNh+/FXHGioT5yS1xrq+5IQpZXXbF5e+ly+bKLqC6Og IMoy0Om23cuJdKNFW7erKG61Ag== X-Received: by 10.28.94.11 with SMTP id s11mr2200935wmb.159.1520607039722; Fri, 09 Mar 2018 06:50:39 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:39 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 12/25] nvmem: lpc18xx_otp: Convert to use devm_nvmem_register() Date: Fri, 9 Mar 2018 14:47:06 +0000 Message-Id: <20180309144719.29904-13-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov Drop all of the code related to .remove hook and make use of devm_nvmem_register() instead. Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/lpc18xx_otp.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) -- 2.15.1 diff --git a/drivers/nvmem/lpc18xx_otp.c b/drivers/nvmem/lpc18xx_otp.c index 95268db155e9..549b5298ac4c 100644 --- a/drivers/nvmem/lpc18xx_otp.c +++ b/drivers/nvmem/lpc18xx_otp.c @@ -86,20 +86,9 @@ static int lpc18xx_otp_probe(struct platform_device *pdev) lpc18xx_otp_nvmem_config.dev = &pdev->dev; lpc18xx_otp_nvmem_config.priv = otp; - nvmem = nvmem_register(&lpc18xx_otp_nvmem_config); - if (IS_ERR(nvmem)) - return PTR_ERR(nvmem); + nvmem = devm_nvmem_register(&pdev->dev, &lpc18xx_otp_nvmem_config); - platform_set_drvdata(pdev, nvmem); - - return 0; -} - -static int lpc18xx_otp_remove(struct platform_device *pdev) -{ - struct nvmem_device *nvmem = platform_get_drvdata(pdev); - - return nvmem_unregister(nvmem); + return PTR_ERR_OR_ZERO(nvmem); } static const struct of_device_id lpc18xx_otp_dt_ids[] = { @@ -110,7 +99,6 @@ MODULE_DEVICE_TABLE(of, lpc18xx_otp_dt_ids); static struct platform_driver lpc18xx_otp_driver = { .probe = lpc18xx_otp_probe, - .remove = lpc18xx_otp_remove, .driver = { .name = "lpc18xx_otp", .of_match_table = lpc18xx_otp_dt_ids, From patchwork Fri Mar 9 14:47:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131123 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1079384lja; Fri, 9 Mar 2018 06:52:31 -0800 (PST) X-Google-Smtp-Source: AG47ELsI05O+8vMu1Zat/nbV4XSHiR8W4+H5jZL1KesEb1BAkGurEUKpjcxrrBqe7JKrzdRTVxjH X-Received: by 10.101.75.18 with SMTP id r18mr24456403pgq.36.1520607151708; Fri, 09 Mar 2018 06:52:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607151; cv=none; d=google.com; s=arc-20160816; b=PIJRTZKCBA3Yl03btrCwwqkds7fOm7ud3HLRiuWUZ3q/+Jv2Q0DlFvtObaDrFYzUaR 0GUUmwJxxZb/Hq1ERketuWEGutLs0zr7YkEyMqySIwACGntCADD459QBr2YDZEabwV56 mXuOM4kWxMFol3fUDnMo4gtnJtaBpNKaZccM8398hsIdUig/sf5OkNDn3SNiqBWMEFPs uyMMJzEAwYRjkl1U0BWYAN9GNDAls9k7Q7PYuwWYrqEFTp02SwnsBQDk1qfLF6efFTcH U/d+fPMGxCp2JbvTtk3OOI71PcvlQoAcKyTXFe/D3qikrh3fcNIuEoM6wNTr/MCoOcw7 waHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=/mYmlEklSxmgWb3ph/DuGZ98vAdv2XK271WMG5BcyN8=; b=HhwOSewzLvZ1AEeM1Jrkvnv9UdIsZkC8PMpM7HgcaKFiZ9omR6vNsqO00QeBEuFzYN 3BNuZMml5ctgnCbGadM0wjZoswYaq8iQJ3v51vJ9W2tuyL6jhO6D8LjZZHGIVa8iR3Vm dMrHKThB9xWjbm6rGBX2ZmifzluLvhWj1eXtFB5H0jl0iZ0F+7sLtg0VMA9cHo2h0AMz irsWiZPDHXLQpbS4k7t+3hMWPnCukycFrCuNT3BMDrOKJ62L2v+Nwo4VzfUMcPzuIqp7 cs/NSp6Hb/5kLhk2wEsR7YvBXPz/JMSusq8K8wJwcNdlSEl6usC4BLXyxjlV/mwtVnWb DSmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Oc286PCp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a3-v6si1004666plp.76.2018.03.09.06.52.31; Fri, 09 Mar 2018 06:52:31 -0800 (PST) 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=@linaro.org header.s=google header.b=Oc286PCp; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932367AbeCIOur (ORCPT + 28 others); Fri, 9 Mar 2018 09:50:47 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:55924 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932343AbeCIOum (ORCPT ); Fri, 9 Mar 2018 09:50:42 -0500 Received: by mail-wm0-f67.google.com with SMTP id q83so4384201wme.5 for ; Fri, 09 Mar 2018 06:50:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/mYmlEklSxmgWb3ph/DuGZ98vAdv2XK271WMG5BcyN8=; b=Oc286PCp+/7UNH1chy5Q3WagvrvvrbWSkS+4xdkUp+zhgFcGGhF9IuRmfEi58y+qNR t+KvwONY12mK+Lzxq7mpPApWMzCA98D8h/PtJrLXNtX94pg1rnP3h8rM/tPLlQZof1XK IgbJn9CmEqbX0E3cjbNIfamRftvin7KAqj+pY= 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:in-reply-to :references; bh=/mYmlEklSxmgWb3ph/DuGZ98vAdv2XK271WMG5BcyN8=; b=XPDm2Zpjpj1JIVL1NVFFVx8G/MBRy/kTuZKyRqD0PPfYLz4ryrFCCYZBeDa+PDn4jr B9OpxCxvAjfqhcKrI6j/1UL49YNDJZ080JUM3JGbBSjZZCJuQWPU5alvHOwZ9YtPWLVE +DOkEZRQ8IprlPbm9q6CrNWvdMA3QWPOXzWyeO9VcVdt1EzpiVOl1HB46obOaQWyasPF B0ku6nyUMVdAC3vk9kGOi+Zw+/vyE3Oa9VSymlbQUXGBOdaf7c6gHZa4voqkjSsTTBqm SdcEcIFVZcbQ7wlaVJynbZpCzUQ8UK40SNV1ZlM3ViP10PZ/UTTA9rMOqWXEYzmV8L/I mS1g== X-Gm-Message-State: AElRT7FjEgwkn8Kogouve3ZE7/m30iOmewd6hJfAOAJkDJp5+3hx/bQV R22ls2jQScpcYw9ADCp9WvYtZA== X-Received: by 10.28.18.2 with SMTP id 2mr2165306wms.108.1520607040933; Fri, 09 Mar 2018 06:50:40 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:40 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 13/25] nvmem: imx-iim: Convert to use devm_nvmem_register() Date: Fri, 9 Mar 2018 14:47:07 +0000 Message-Id: <20180309144719.29904-14-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov Drop all of the code related to .remove hook and make use of devm_nvmem_register() instead. Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/imx-iim.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) -- 2.15.1 diff --git a/drivers/nvmem/imx-iim.c b/drivers/nvmem/imx-iim.c index 52cfe91d9762..b98d76ac7790 100644 --- a/drivers/nvmem/imx-iim.c +++ b/drivers/nvmem/imx-iim.c @@ -138,25 +138,13 @@ static int imx_iim_probe(struct platform_device *pdev) cfg.size = drvdata->nregs; cfg.priv = iim; - nvmem = nvmem_register(&cfg); - if (IS_ERR(nvmem)) - return PTR_ERR(nvmem); + nvmem = devm_nvmem_register(dev, &cfg); - platform_set_drvdata(pdev, nvmem); - - return 0; -} - -static int imx_iim_remove(struct platform_device *pdev) -{ - struct nvmem_device *nvmem = platform_get_drvdata(pdev); - - return nvmem_unregister(nvmem); + return PTR_ERR_OR_ZERO(nvmem); } static struct platform_driver imx_iim_driver = { .probe = imx_iim_probe, - .remove = imx_iim_remove, .driver = { .name = "imx-iim", .of_match_table = imx_iim_dt_ids, From patchwork Fri Mar 9 14:47:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131115 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1077731lja; Fri, 9 Mar 2018 06:50:54 -0800 (PST) X-Google-Smtp-Source: AG47ELt/UdVTJHZGSKUEuigqPb/9AOUGA5JJ01qj4hkuS0xJJ7XXxYvXkaO2Th+qhmVnjrCKOfC+ X-Received: by 2002:a17:902:b109:: with SMTP id q9-v6mr28437844plr.340.1520607054113; Fri, 09 Mar 2018 06:50:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607054; cv=none; d=google.com; s=arc-20160816; b=e4MQdg5CmpW4BEzBQ0sIaqnSgTsklZrzU/8tReDsiKBCQltNSQT9sadoKnVgDxPfpE BqFvae+aZNMg04TN8l3L+H3pC3AzWNLh2xL0JYamkKtOqTWiiOVf0A3na+1xL9SjdxM7 V0lrczaWFP3O4o3ljkb6cxPhmGvQ22/pp8uPjX+X6NtCJSnHaemAJFOgcdxgfGg/oCRC 9jBl0nHTIbOX2IjzgnV1r6SezNkbxJI4G8Da72dlaHXdl+iuGUR0Oi3x/sBBRNDd3xrf THySOwBdTkEgb7VlvtTLyQm5POAbZ835r3A3zmJummQ8kfEQmQ2lsSbEJ+Cs2/aaCw3+ k1Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=cX9nl+YTq+v5dxz2HWkpxIJ479dHsg9YyJ8aO5HY8eU=; b=PPN0YzvWuz3EiHN6PHsRZiEJ2sfaWQYKR59ethke8/NDFN/hGtvtyMghHOJglfGNaM 2IhY27aO12fksrLpvhPQm1V4MadUThaWKKeeXWLce9MeWi+DOcjDlRMBNJUFN2aBQ+6K NfEk/mvrBnrC+pCRazJafwBhKwZuSX5gyMZ1YpvGv1nxUxKk3ZN4Aq4i4ywUYVMvU0LN eYtHp0rl0x3GAdO7lRSPfCEVQU8ZaLh/MhQmZ4WxxW9N0j2wP6myyyjr1waJTcZVBgg5 0+/FngrYDH9VGyy9clnEB0oZnTw+qdyhC0gBOJ7rqwASC6AyjLn4zlOhTeq+pAMhPu0V apIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IuoHpl5J; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1si827525pgn.191.2018.03.09.06.50.53; Fri, 09 Mar 2018 06:50:54 -0800 (PST) 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=@linaro.org header.s=google header.b=IuoHpl5J; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932384AbeCIOut (ORCPT + 28 others); Fri, 9 Mar 2018 09:50:49 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35752 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932251AbeCIOun (ORCPT ); Fri, 9 Mar 2018 09:50:43 -0500 Received: by mail-wm0-f66.google.com with SMTP id x7so4378489wmc.0 for ; Fri, 09 Mar 2018 06:50:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=cX9nl+YTq+v5dxz2HWkpxIJ479dHsg9YyJ8aO5HY8eU=; b=IuoHpl5J63h6V7nEL9wQ/UCSa4a8cw3FtTdMWyAtHwpE/8MdXKxvuqkiTzEDD4ELbc 6fO9mcRg266NixPhfbcLtJ64K+jnLTRO9uDypvkIwnwnUp8Zawe01uGwz1HDPDgUELUh mEaE0wSUC8/NWLpZTJjRM8+IEl9Zw8uV04Z0A= 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:in-reply-to :references; bh=cX9nl+YTq+v5dxz2HWkpxIJ479dHsg9YyJ8aO5HY8eU=; b=a2h/AEEr9QuFBz0vAIxaseG/4cEP6IXuWBYEeGkO7pA/LyRTG5gYkAncHfoVfwOgB0 mSlp7Vs8w0eZ8SS1/psLFKc6g/zdl/zTFLGzXsoycZpGhSzqdHt+j+G5qgy098IzFmwR 3XkQD7FtNOAHNEPEB2su5alKGdqbMTycHgLlPx7xh4JK/vUIHMcHLMK0NGirhBTRuiPz iYtKmvD4NzZmeBWVJXVFnq5REgYN9UoS5pTuTUjBufhs3wQcYg7vv8r/aNFXXcinSOcI mUNg2urvTeIAJX83zdZDnZDAoZWlZO0kkcsDiL9j5lzhg4q1NUJwiIWjlE7fYSwZoM61 yjEA== X-Gm-Message-State: AElRT7EVd6eq3Zkqj1RnvbmeZIVG2m2XtNi342Ms3lS3IxkEfuZKwaU4 lwOhgLIBGnSLNbGS3qtmOQvCiw== X-Received: by 10.28.231.10 with SMTP id e10mr2392547wmh.125.1520607042060; Fri, 09 Mar 2018 06:50:42 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:41 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 14/25] nvmem: bcm-ocotp: Convert to use devm_nvmem_register() Date: Fri, 9 Mar 2018 14:47:08 +0000 Message-Id: <20180309144719.29904-15-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov Drop all of the code related to .remove hook and make use of devm_nvmem_register() instead. Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/bcm-ocotp.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) -- 2.15.1 diff --git a/drivers/nvmem/bcm-ocotp.c b/drivers/nvmem/bcm-ocotp.c index 5e9e324427f9..24c30fa475cc 100644 --- a/drivers/nvmem/bcm-ocotp.c +++ b/drivers/nvmem/bcm-ocotp.c @@ -302,27 +302,17 @@ static int bcm_otpc_probe(struct platform_device *pdev) priv->config = &bcm_otpc_nvmem_config; - nvmem = nvmem_register(&bcm_otpc_nvmem_config); + nvmem = devm_nvmem_register(dev, &bcm_otpc_nvmem_config); if (IS_ERR(nvmem)) { dev_err(dev, "error registering nvmem config\n"); return PTR_ERR(nvmem); } - platform_set_drvdata(pdev, nvmem); - return 0; } -static int bcm_otpc_remove(struct platform_device *pdev) -{ - struct nvmem_device *nvmem = platform_get_drvdata(pdev); - - return nvmem_unregister(nvmem); -} - static struct platform_driver bcm_otpc_driver = { .probe = bcm_otpc_probe, - .remove = bcm_otpc_remove, .driver = { .name = "brcm-otpc", .of_match_table = bcm_otpc_dt_ids, From patchwork Fri Mar 9 14:47:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131127 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1080449lja; Fri, 9 Mar 2018 06:53:41 -0800 (PST) X-Google-Smtp-Source: AG47ELsSmST156E6UefFVzBcRJRn34BAeX2iN4UTT2jUUZQ4FbddILwCOcySj4XIkMH0F7jykLiD X-Received: by 2002:a17:902:2e04:: with SMTP id q4-v6mr27797065plb.22.1520607221333; Fri, 09 Mar 2018 06:53:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607221; cv=none; d=google.com; s=arc-20160816; b=qvvyQNSqBgfziJTQMwvrdg6zyV1RvgsxK4HCJbs36tLerubEeSVrZntb3wl9yoLFnM DfxT3HFCdFtb06lgLUMN8QZx9UXC/CamOWGqumYH1TvpUzMqeKgZzorMvxnxaewbLKjx Jt2YA33guBLyv5xh/T9aJwwFGj/nGF6dH2vJRq3gZQlCVn56RhFHVZ5ErR6gxViS+8d9 9KHznbKzvCEFeQgY9obZzSsUqHRRDBeUai/fNsJ2hrjFMv7BKPUfG5Urqclg9fg/6aXq UbisiyE0G6kJr1cWMz9nh4FmW6JuEMqozSLOHpKp9KUMAyMPN3kp9VYEVb6UQUW+w9+c lASg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=HNnsiLc9yf+W4lfxSi/47y81SkTcPUabpKQPBMCemyA=; b=uRTA8PLzJ3WoYaYtrHYUapwr3/q32x9nlZpgEE4XL6SVfAM9ZJFLCTisSn1Srs0Bx9 a8lR6UE80RdMrsFrc3BOxcYRWxLFycyOX+rjTkKQkRQ4zAn4psJyaZURPeKFmD8WYy4S xTFM5DOb4HX0XzaATuZP7QgnVoH74ejA4jSSfG7dkQg6aUYKJQsBiFqWvZS1gZsLPvGM W4Ezb7WlME1cTI7BrXrYQ2JEehxxVa+wUplITbK+jzZBThYMFvZ3zle/5HYpYYsBPaG6 C0k6SN4jt/vvildot7pFLeEzQXdM1xjRx7Om7TaWoTRp5yPy3gaf2eE3F7QUasCrCC1E Wv6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F6DzIFCx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 91-v6si981357ply.517.2018.03.09.06.53.40; Fri, 09 Mar 2018 06:53:41 -0800 (PST) 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=@linaro.org header.s=google header.b=F6DzIFCx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932464AbeCIOxh (ORCPT + 28 others); Fri, 9 Mar 2018 09:53:37 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:42417 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932353AbeCIOuo (ORCPT ); Fri, 9 Mar 2018 09:50:44 -0500 Received: by mail-wr0-f193.google.com with SMTP id k9so9260504wre.9 for ; Fri, 09 Mar 2018 06:50:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HNnsiLc9yf+W4lfxSi/47y81SkTcPUabpKQPBMCemyA=; b=F6DzIFCxcgjbfIyveTNjmhM+DK5vvmN1PiBLXl6c8gVI4HiO6pseaVXgXCN5STn4je QUGkG6d17uLBANgK139xyXyhUkdB1DHYjocHyj1L+TujdNu18ND+p+FYvL7AqR+cr/+M AT7Eb2dkQ7qX/OM3LnDlS15j/kMrvT7lp6PS8= 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:in-reply-to :references; bh=HNnsiLc9yf+W4lfxSi/47y81SkTcPUabpKQPBMCemyA=; b=rcJnct5ari7ptBsf5yylg0gMcqweOPrqj7epeNur30jKe6/PofImucIOTWjMBHDBXE 65aaWXANRqc1AaYxBLGpRJASSct6BfVQIpEE9XAbtqvuVLiubS6mtqzuSX21tJdRKCN3 4iaqoYsoLYKnrtLjcYAb1WQoCRgeIkhbyGeCtvDkZ0/xam+bKeUJp6P7P4rdXK233NZa EMnsUczXzeuz3Mky0qL0kS2W3FZI+r1h2ivcDdUaIK/8eZxbvsdiFD8UcifR5VteC3Oa RI5DuYMM+h2yioa/1NS8t605QbFQi+YTEAheF+tUYgvxW2MODUPmZnhsXYLBgtTtRk/1 q3KA== X-Gm-Message-State: APf1xPD8rx8ENfsrkQLFcSKk8NdcBnoXn0JaIN3ropdVAfrPSiT+pNB+ w4wMzyfOPkLX6xmu2YnAZrE4mq8+1A0= X-Received: by 10.223.184.124 with SMTP id u57mr26113324wrf.100.1520607043163; Fri, 09 Mar 2018 06:50:43 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:42 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 15/25] nvmem: qfprom: Convert to use devm_nvmem_register() Date: Fri, 9 Mar 2018 14:47:09 +0000 Message-Id: <20180309144719.29904-16-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov Drop all of the code related to .remove hook and make use of devm_nvmem_register() instead. Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/qfprom.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) -- 2.15.1 diff --git a/drivers/nvmem/qfprom.c b/drivers/nvmem/qfprom.c index cb3b48b47d64..4f650baad983 100644 --- a/drivers/nvmem/qfprom.c +++ b/drivers/nvmem/qfprom.c @@ -47,13 +47,6 @@ static int qfprom_reg_write(void *context, return 0; } -static int qfprom_remove(struct platform_device *pdev) -{ - struct nvmem_device *nvmem = platform_get_drvdata(pdev); - - return nvmem_unregister(nvmem); -} - static struct nvmem_config econfig = { .name = "qfprom", .stride = 1, @@ -82,13 +75,9 @@ static int qfprom_probe(struct platform_device *pdev) econfig.dev = dev; econfig.priv = priv; - nvmem = nvmem_register(&econfig); - if (IS_ERR(nvmem)) - return PTR_ERR(nvmem); - - platform_set_drvdata(pdev, nvmem); + nvmem = devm_nvmem_register(dev, &econfig); - return 0; + return PTR_ERR_OR_ZERO(nvmem); } static const struct of_device_id qfprom_of_match[] = { @@ -99,7 +88,6 @@ MODULE_DEVICE_TABLE(of, qfprom_of_match); static struct platform_driver qfprom_driver = { .probe = qfprom_probe, - .remove = qfprom_remove, .driver = { .name = "qcom,qfprom", .of_match_table = qfprom_of_match, From patchwork Fri Mar 9 14:47:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131126 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1080180lja; Fri, 9 Mar 2018 06:53:23 -0800 (PST) X-Google-Smtp-Source: AG47ELtzKuI3dVMtzdqWMdc1f4RlCJ5BoRSHMUM3RQkH42h0RcejLVvD8qe5LQjbNtUfoGs+4X+h X-Received: by 2002:a17:902:9307:: with SMTP id bc7-v6mr17827552plb.29.1520607202980; Fri, 09 Mar 2018 06:53:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607202; cv=none; d=google.com; s=arc-20160816; b=LQ8p17Vo6fV79+P4iuwU5mUKeBbUvyE4lyWwpgDjDn4kZmZh5BgnfRGs3400yXlpEh T6XRX31RGjyvR0lGM/3NUNUWMWEb3GqJ4q2eWcZ+m09ox9oixpFUC0OQxbHLr5066jTq RIG+uiaT1VqDaSHbFHoQqQ6l5R+5NFOlk18YHZ16VhwHKOs5K6BpDRmEVbHIP+6g1aY8 fWKrNpcgX82XIgKj7qJLeuSbAqE9r+e9Rp5sCKiKvepccyb1ip6S3xHQPCpYeHvPIWt/ IujMmnn0sbrOowqzrnGv48YtxAvwMW7qjHEYpGauR+DQWTEpqPDDwdXiGdjy/gFqqoVy 7lVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=V1wYXU+KUDrx+qL3t9emawfRo3d+7vjAjrk7o5LYCD0=; b=vg8a2LKxmcSAg9E0dpvzT8T4kerI3KtQoG5lBiOJynhpLohTjjG6GBI8x/02Qn3HmZ 7vuDugyWPFP9Tk6E17xA49FdiN06dU5TeKe0cZruolCyuC9/sAbJkPB2Ih2/uII//hgW FR+HTotZrlCCmwjHi1pygu8fyIn7UfgKjI383j9UeNcPGiHiu0X2T8t6vgSJiTHYditc pA45fzSHQIqESOA6DnGOfG6/4/ULG8y62WihqAI/iBc5ZRYFP5g05wnnVQn9ZZ3n32fZ UMZ16BThsw/fnUOUZKjQh+eZ1Fp313Do2ScAeXt6I86dXJycDExry6IEbfoACslW9XOo FliQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HruqlRxn; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d26si834914pge.98.2018.03.09.06.53.22; Fri, 09 Mar 2018 06:53:22 -0800 (PST) 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=@linaro.org header.s=google header.b=HruqlRxn; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932429AbeCIOxT (ORCPT + 28 others); Fri, 9 Mar 2018 09:53:19 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:40637 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932178AbeCIOup (ORCPT ); Fri, 9 Mar 2018 09:50:45 -0500 Received: by mail-wr0-f196.google.com with SMTP id o76so9266911wrb.7 for ; Fri, 09 Mar 2018 06:50:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=V1wYXU+KUDrx+qL3t9emawfRo3d+7vjAjrk7o5LYCD0=; b=HruqlRxnu8t8cCiDJ/lcm9mEUY4vLOA+mdFwy4jQYCRmfQgKDbY2QvNWI6Wxcv52xY HJRHlde5NY28AaezmKhAd9/ea8xp9TaVQwN7j6L90p+y4in8SmzbMfzAOatdvNNO5NB6 Y12VmEHddKPawk7gfsdBjrDs8RVU2XSnEU0Sw= 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:in-reply-to :references; bh=V1wYXU+KUDrx+qL3t9emawfRo3d+7vjAjrk7o5LYCD0=; b=oIMV7P7RSqMR2MkeTQp6jutFqUBgcg45fIHlWwW0hlnHK1Xy8jD/UXX4uwPFuC6isN jXwbREK2QPxskIfJvnDm/4zH/+js8JELkvhX9QtC2JBqwrlcg6LjZ4eQsOtsScRYtc5H 5YqVmD0O4RQB4ddYuiI73+f+CI42VfENgXls2xliQBSvcy0Bf7qOJkCsqma25dRDyhF1 zL+01dIwudrbg/x+FJ6eV5TacOe5mlvigW5nz0w78dZq2OIddCR8hiyfdX164l04ujgJ psrLIf9q6aB1rXXgaFsq1kD/ImICH7fMJPQxtf9aJiw39q9kFP4CbSH2C5ds/wYZTW6d AU+w== X-Gm-Message-State: APf1xPAAcsTE8zEa+Osg69AhLpNu1CEfggK8bHj+YDndznZHDSC3oZNy 1j5MFlzaAeSe2xc2KY+CSmQt3g== X-Received: by 10.223.176.86 with SMTP id g22mr24841722wra.11.1520607044253; Fri, 09 Mar 2018 06:50:44 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:43 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 16/25] nvmem: snvs_lpgpr: Convert commas to semicolons Date: Fri, 9 Mar 2018 14:47:10 +0000 Message-Id: <20180309144719.29904-17-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov Looks like commas were accidentally used where semicolons were supposed to be. Fix that. Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/snvs_lpgpr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) -- 2.15.1 diff --git a/drivers/nvmem/snvs_lpgpr.c b/drivers/nvmem/snvs_lpgpr.c index cb471d5e8e86..92e1e41d128e 100644 --- a/drivers/nvmem/snvs_lpgpr.c +++ b/drivers/nvmem/snvs_lpgpr.c @@ -110,12 +110,12 @@ static int snvs_lpgpr_probe(struct platform_device *pdev) cfg->priv = priv; cfg->name = dev_name(dev); cfg->dev = dev; - cfg->stride = 4, - cfg->word_size = 4, - cfg->size = 4, - cfg->owner = THIS_MODULE, - cfg->reg_read = snvs_lpgpr_read, - cfg->reg_write = snvs_lpgpr_write, + cfg->stride = 4; + cfg->word_size = 4; + cfg->size = 4; + cfg->owner = THIS_MODULE; + cfg->reg_read = snvs_lpgpr_read; + cfg->reg_write = snvs_lpgpr_write; nvmem = devm_nvmem_register(dev, cfg); From patchwork Fri Mar 9 14:47:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131125 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1079941lja; Fri, 9 Mar 2018 06:53:07 -0800 (PST) X-Google-Smtp-Source: AG47ELvmSykebEgOKuv72qYTOrdIMkkCJ2a6lxswcAzhzhDAxqzZAslrqWBC0oeQUqUOnHbU0L1z X-Received: by 10.99.55.70 with SMTP id g6mr24503128pgn.284.1520607187193; Fri, 09 Mar 2018 06:53:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607187; cv=none; d=google.com; s=arc-20160816; b=HCq1qVYMb5I+a2qYtRqprbG5yJHQPPwLTiIWk4Z0qIEOe1zo+ELXjzwxzW7JGpNldT HMv9IQgbO8S5ymoETrG61zvzL8Tkwzav7vtp7x1UmehhqRX8uKTjT1HvimPsqrltVXa8 HnbAbwVhWiqRAtbzom7iqtD93cyFZO/f+ie6OuCDFH/sdVZbXLCFxNdaplsSNeIZ2269 Wk3YIw/w8acrU/3y7oHiXV1CvDDDkuW6XlFe+37UFNKPMMT4+ixIVfA5d3N/phDeGHmn dW5Rj86csDLh+zxnm0edg0N12kPEnnLRmGCRfodY40y6ygAfM+/6MVIoMCAbHd6lISl5 2zTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=AL3vSk4vvDm22SR1uW6+Qq0PXmzWtxma/3Yintv32TA=; b=BTYbf8ZiLTZqzirUSvlDk1PAgqUx7DTvSObyREATV5MuWlTVyP1ARpkg69sAoXC0Np gwHr7ztHXPFwnJo9SOJ73HxiBvx2Bb5ZK1yRifiZyv/dUHa7rk5ii37WtVsTFrT2F12V 546QdeMuI+FPmctUFQdSJyrTVhhNgN95bMNLG71fSHsXH1saB4hzAo6JGCLXl1a1BMVZ tNbGscHAcjqPD0FsuwWr7/tYQ5G+CNuN2TAFFOjI85/535B5EotI707KgbUaimhhh1Hv lE+/uTjNxMpApFY1BL1jHkJcVHlSulnJ0G+gECwoLV8FFT0XcazeS0it+aCcCBN3y+G3 cqxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YEPlV/Ju; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si809859pgv.563.2018.03.09.06.53.06; Fri, 09 Mar 2018 06:53:07 -0800 (PST) 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=@linaro.org header.s=google header.b=YEPlV/Ju; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932405AbeCIOxD (ORCPT + 28 others); Fri, 9 Mar 2018 09:53:03 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:41532 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932361AbeCIOuq (ORCPT ); Fri, 9 Mar 2018 09:50:46 -0500 Received: by mail-wr0-f196.google.com with SMTP id f14so9267424wre.8 for ; Fri, 09 Mar 2018 06:50:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AL3vSk4vvDm22SR1uW6+Qq0PXmzWtxma/3Yintv32TA=; b=YEPlV/JuPhVZZih3BQaJ/liMRNiRfPP6kLMzZtjp5EqasQrUM1hnTaXaUtzjA+IcXi jHJXoraTWchblW7ouLX3vg7hTSyYA7O5n+b2tXxiTP1rXDXgXAUduuFO1BJLdNPlTwGm D7IvoQlJLXqeQMsa+eBZBZxjcRH1xNJ806pPE= 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:in-reply-to :references; bh=AL3vSk4vvDm22SR1uW6+Qq0PXmzWtxma/3Yintv32TA=; b=JYm8CPl/EnLTUQPwsVouT06RTUmf3je0RMRJ8YUag9cqO/a2GUJBRuN9siCm8G0YVz IqUds0cOdhVoLVmMqYh8OOvNyMRM16YvyNXF7ar7IuYBxzLTncUEzXb7Rl/23CG/9xGE SdtzcAWEGOWEiCIGNQsapSqWQ6ZvLI/rEYsB62e/aJrkeMST6tq5M6dvt8XyOV6RmShu uwBhfUcPNt1/SZE5h3rN/feMBLmAGGHgjTO4acQ4uCoyb+1xj3O8EhgG0YvrET7pu3YA oebBcD0FjC3j5Cz8Cr4j8I0IjLnx4kYzN16B1JNMF/OD9xv+o2qqW7lysq6ZJ9LvJkqf taPA== X-Gm-Message-State: APf1xPDB73jI4oeA49LRMpY22YZ1gBW3emL5wlyv0J0cbtybyQAbhna0 3RqNWDkCB3g+PQ/pmR9ipM6TNA== X-Received: by 10.223.139.68 with SMTP id v4mr27398823wra.23.1520607045497; Fri, 09 Mar 2018 06:50:45 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:44 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 17/25] nvmem: rockchip-efuse: Make use of of_device_get_match_data() Date: Fri, 9 Mar 2018 14:47:11 +0000 Message-Id: <20180309144719.29904-18-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov Simplify code a bit by using of_device_get_match_data() instead of of_match_device(). Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/rockchip-efuse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.15.1 diff --git a/drivers/nvmem/rockchip-efuse.c b/drivers/nvmem/rockchip-efuse.c index fec6e4c48b9a..ade8848adf82 100644 --- a/drivers/nvmem/rockchip-efuse.c +++ b/drivers/nvmem/rockchip-efuse.c @@ -259,11 +259,11 @@ static int rockchip_efuse_probe(struct platform_device *pdev) struct resource *res; struct nvmem_device *nvmem; struct rockchip_efuse_chip *efuse; - const struct of_device_id *match; + const void *data; struct device *dev = &pdev->dev; - match = of_match_device(dev->driver->of_match_table, dev); - if (!match || !match->data) { + data = of_device_get_match_data(dev); + if (!data) { dev_err(dev, "failed to get match data\n"); return -EINVAL; } @@ -286,7 +286,7 @@ static int rockchip_efuse_probe(struct platform_device *pdev) if (of_property_read_u32(dev->of_node, "rockchip,efuse-size", &econfig.size)) econfig.size = resource_size(res); - econfig.reg_read = match->data; + econfig.reg_read = data; econfig.priv = efuse; econfig.dev = efuse->dev; nvmem = devm_nvmem_register(dev, &econfig); From patchwork Fri Mar 9 14:47:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131124 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1079735lja; Fri, 9 Mar 2018 06:52:53 -0800 (PST) X-Google-Smtp-Source: AG47ELu9S5vfRkZbpYRRxmCbdqFS4hnlIZq5owzuFB5jycNQqEb+0NEFFdYR82lIDN8RFkqs+9ev X-Received: by 10.99.160.80 with SMTP id u16mr24210673pgn.389.1520607173461; Fri, 09 Mar 2018 06:52:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607173; cv=none; d=google.com; s=arc-20160816; b=Nqopg/UBtq07T50yVdC6H2uzDRbnbsOWlL1QkWevkyjFhITokdig4xY8dRIv4GpAr2 PGmIWMBwNL8E8WWRlLIkenTv7i5kroQl+hV1K/l6KbEIafxSZGOuWeXrbE1FY3CnpK4j polHYg1vFiE3ZiZzPXyd9DvwVAUzOu/MRPm1u+sEtQE7/bD6juVQewlTa8h6Wj+7HJZ2 wb47WtWyFyoc61ZhJRwbN9E9UlXQ++N1g7d3HL/YPJBCGoGgcDLqkZVzsomiNGdXRhz4 GU4YprPmnuHQimAssNLBHLiIlMWbaralcy1BJEZp6e6pkVfPjpl0+gpopezJhw03+/gb HTtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=GD6bLYBRCS/d7tbmXKvDegmT5vCtX9uh12GfjuFtTG4=; b=KOrcAczMKLU9HeA1Axmj4vufjILZBpHlCvAkDfADAVMgyBlxQLaFJnpPVqdL/T2j+W nE3T7Vis1H2+nLxQRz2EXPjcqqiKNYr9qjQFFkVWMdazxKqNkX3b69YuFU3smuWlKsUx KwKkJkHAaUCF5dYzyOLqqKk5YIHulbxsybL3CmTXmASpIZBeNQaguJDYcyvmX0UKrovV epdSed5yQ+tQm0PzLyr3u8D/skoJ1rEi3Ade8pYgZ88wZfVNY1L4mCwdFRjHWCRBItqi w/AE57HGHMVYxWa8wPP9FFIGtRYbYLss/o2TUlFyylyyE9C7WOaXLqYmo4qDcVabMScv SozQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HBdnerQA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si809859pgv.563.2018.03.09.06.52.53; Fri, 09 Mar 2018 06:52:53 -0800 (PST) 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=@linaro.org header.s=google header.b=HBdnerQA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932462AbeCIOwb (ORCPT + 28 others); Fri, 9 Mar 2018 09:52:31 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:32984 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932258AbeCIOur (ORCPT ); Fri, 9 Mar 2018 09:50:47 -0500 Received: by mail-wr0-f193.google.com with SMTP id v18so9275131wrv.0 for ; Fri, 09 Mar 2018 06:50:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GD6bLYBRCS/d7tbmXKvDegmT5vCtX9uh12GfjuFtTG4=; b=HBdnerQAN3IbHLGh1g6kz91f3RZMLDM8IWXFBlgodl6+Syx7SUlngOb08KmYOaxwuY xrzkbK+JHC6YB3XSojlEhJyfH2Fh1cSH6XMTrrDNjDBGVgH7QcUoVDetDyNlmue/vNkH GvixbopwrQLUmo02m7mZnHUv88QFDloOU6scc= 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:in-reply-to :references; bh=GD6bLYBRCS/d7tbmXKvDegmT5vCtX9uh12GfjuFtTG4=; b=gkIoY0dqxvOh9qNf9hUILN6eTKzAf2S87f7wi1HBxdeyeHR1LLgXV3+sa98G2ZKtMk JWZX2hFyF6g/ZaqJ5cbaLLx7TlKx4Gm5p6S5B9ipM2nV4a0RvDS/V6LPsr994zpu75yZ ReaslBWgiaDvk+m/1KB1jFODC3sE+OtzeOaWFecyVTV5+U4nDJizwYHmM8hY/35TIMdZ sEfZH3MBNEKI4yieOijl7OBHymdQ3bvPIlZFzyDF8PWoGyjjLAKQCp/lzPyDRMIx3t7M hSpgJYXFimOwr7Xs7x5PmC2mQNsb9QEPBXvcrPEEYnzSabGsPSsQAEh46rY3/yn0YwmD 3zFg== X-Gm-Message-State: AElRT7HSm46TFwxxGIza2N+8dWfC+Eliq48B7p2B25oxEmOn1lAbWanr SY5nOXJWhHCaa61SE05jkSqxHA== X-Received: by 10.223.176.171 with SMTP id i40mr10065710wra.57.1520607046582; Fri, 09 Mar 2018 06:50:46 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:46 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 18/25] nvmem: vf610-ocotp: Do not use "&pdev->dev" explicitly Date: Fri, 9 Mar 2018 14:47:12 +0000 Message-Id: <20180309144719.29904-19-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov There already a "dev" variable for that. Use it. Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/vf610-ocotp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.15.1 diff --git a/drivers/nvmem/vf610-ocotp.c b/drivers/nvmem/vf610-ocotp.c index 5a395ffb2ca8..4662309489db 100644 --- a/drivers/nvmem/vf610-ocotp.c +++ b/drivers/nvmem/vf610-ocotp.c @@ -223,8 +223,7 @@ static int vf610_ocotp_probe(struct platform_device *pdev) struct resource *res; struct vf610_ocotp *ocotp_dev; - ocotp_dev = devm_kzalloc(&pdev->dev, - sizeof(struct vf610_ocotp), GFP_KERNEL); + ocotp_dev = devm_kzalloc(dev, sizeof(struct vf610_ocotp), GFP_KERNEL); if (!ocotp_dev) return -ENOMEM; From patchwork Fri Mar 9 14:47:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131122 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1079069lja; Fri, 9 Mar 2018 06:52:14 -0800 (PST) X-Google-Smtp-Source: AG47ELvxaDl/lE9lD69flb+BwKXbuxpSYVzwmnZXAW4SYt4KtXzbZ41+y6qJ/hZlv7nned2uAjDC X-Received: by 10.99.121.140 with SMTP id u134mr24030767pgc.89.1520607134381; Fri, 09 Mar 2018 06:52:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607134; cv=none; d=google.com; s=arc-20160816; b=qyRLzhgDYwmuuiP0JX9Se3elozbHahd+j3RX3GlQ9hvb7fsKDKIidC+RvBA0VFyLBm g51e1QRwzOSQtLGeG25g/A6pqSaLzJsyQ00yTgEMG7jnlBBIOtE/nosTC6uGvrqBGaXy 26LSa3SMsfDTj7qXvssyegQENJ0XZIlZtVA+ExEn5FmsZQ5XySOldWAHtrkKXyhunT/O OzFNgHjMgJuJ/dqd8fTUiWnWQdQ2WPsXNlKlkjWHbhRBgiXt4wPLlrz80NG1fsHtU1FJ AfIJ8MlzT6WcvCLEwIwPACTk73UiljHFAhWRb4VPOsY4gEiAYYgCpoI9uQq+Fy7Dt1Rm C4YA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=eAnGeza+RiSlIVu+0c9b5tCUTCvMOkR19d39VJCDXNg=; b=aVEbSID99YCxvuS6IcXlV7rI4OEB2FjlhWUt/WBI1wzMwgi8YTN6K/2qXyo0QbzYN1 WsArLU/Zo0Wj4S1re/OQEEoIAnmx5+y5Cpsh3FWfN8RvssN0wsTcEl3/FHnAAeukEBUn BTFqx4+YpD653akJG1GwVH/ykNJrW5EFgqpBRMayF8xifWYlyvNKKVARtKaXt8mCXbOG /8XDFUTsxATD5tD2ZSBlyLqlp6KIrZA97d4AQhAr7af28qgtLH4vGGX/6x8sd9eADA04 pvMxpPuNcCzyG4kSpBqfXVnW5T76GZCi1wVzb3lIOBcH6eJWVUaibh/A7u3ndM6TXanE +k8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ANbYRZ/K; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o22si829672pgv.232.2018.03.09.06.52.14; Fri, 09 Mar 2018 06:52:14 -0800 (PST) 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=@linaro.org header.s=google header.b=ANbYRZ/K; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932433AbeCIOwK (ORCPT + 28 others); Fri, 9 Mar 2018 09:52:10 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34809 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932371AbeCIOus (ORCPT ); Fri, 9 Mar 2018 09:50:48 -0500 Received: by mail-wm0-f65.google.com with SMTP id a20so3781010wmd.1 for ; Fri, 09 Mar 2018 06:50:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=eAnGeza+RiSlIVu+0c9b5tCUTCvMOkR19d39VJCDXNg=; b=ANbYRZ/Kc2HAKrwBbMM0PHDnWlZ2sjGcZRPvR4xxUYpZfGZvfZSQaMHFydeM52wvN6 yrvI01HthGWkMjq0GAoY8ca+aWWjZNEjis6CJX02YKkiZS1lwVhxqwfWGitzuqAM/tka 6WW77xL45pQ3OMz4E5yIbQElWaRb5bXIV/Do8= 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:in-reply-to :references; bh=eAnGeza+RiSlIVu+0c9b5tCUTCvMOkR19d39VJCDXNg=; b=hqntVCzEsAdGpWk+4Y/mnDwvPO2eRaGehqjCssaXBjlzRJovTq2B4JhDZrJFnv+wDc uEOppTLVsWruaJ2iKcix1SV1mcdnCmjrpOvF6+2FJqdapdf0p36RTyHrqEn4fNoU3BZJ pOCXkhOzHIDsx8V959LTWFI1AuBnPf1crC60coiBXdrEdweI0Hthkrxb8DMjs9fnIILM lpPjgVoKywnFXmhd/vb3Oxl/0SX7yHRTPZHNbNrfHv/fRCPRvf97CS1UQdij3yX44z6S CJ4w6psvbjfG9AczHqWgpWibqWc8tGCMRa612qVt3rVVwBrFrKfFJ2O8E8lIiG9PINPB NPrA== X-Gm-Message-State: AElRT7G2WfL7/FexIgbgZovtgFvLn/INfiH/dLoFmJMkButruNLr+oV3 vY9wIrPZuH52fz8uTpnEgJOJ5A== X-Received: by 10.28.85.7 with SMTP id j7mr2101620wmb.38.1520607047715; Fri, 09 Mar 2018 06:50:47 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:47 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 19/25] nvmem: rockchip-efuse: Do not use "&pdev->dev" explicitly Date: Fri, 9 Mar 2018 14:47:13 +0000 Message-Id: <20180309144719.29904-20-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov There's "dev" variable for this already. Use it. Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/rockchip-efuse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.15.1 diff --git a/drivers/nvmem/rockchip-efuse.c b/drivers/nvmem/rockchip-efuse.c index ade8848adf82..b3b0b648be62 100644 --- a/drivers/nvmem/rockchip-efuse.c +++ b/drivers/nvmem/rockchip-efuse.c @@ -268,21 +268,21 @@ static int rockchip_efuse_probe(struct platform_device *pdev) return -EINVAL; } - efuse = devm_kzalloc(&pdev->dev, sizeof(struct rockchip_efuse_chip), + efuse = devm_kzalloc(dev, sizeof(struct rockchip_efuse_chip), GFP_KERNEL); if (!efuse) return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - efuse->base = devm_ioremap_resource(&pdev->dev, res); + efuse->base = devm_ioremap_resource(dev, res); if (IS_ERR(efuse->base)) return PTR_ERR(efuse->base); - efuse->clk = devm_clk_get(&pdev->dev, "pclk_efuse"); + efuse->clk = devm_clk_get(dev, "pclk_efuse"); if (IS_ERR(efuse->clk)) return PTR_ERR(efuse->clk); - efuse->dev = &pdev->dev; + efuse->dev = dev; if (of_property_read_u32(dev->of_node, "rockchip,efuse-size", &econfig.size)) econfig.size = resource_size(res); From patchwork Fri Mar 9 14:47:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131116 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1077803lja; Fri, 9 Mar 2018 06:50:58 -0800 (PST) X-Google-Smtp-Source: AG47ELtCFTq5OxG58MqBM7KCt9JveUkNaeKziyDP9bid09JSf+amc+wVZg2RVybvxFIjOtckA/v0 X-Received: by 2002:a17:902:52a6:: with SMTP id a35-v6mr22603706pli.179.1520607057971; Fri, 09 Mar 2018 06:50:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607057; cv=none; d=google.com; s=arc-20160816; b=fKu/CfGMYtYVQTN932CCLe+/T96yBAdPXmufoQaFFOvoxh2AbRY2HQzSS4ycuo5F+K gPgDdPPdhyjckpZUiobBABUflEB7sbiPAuBZsxXeI1C3AkVvk3jAoNO6kfrv3Wkt9R3c 5SAgQM3v68PPPodUobpgZY5/PJgX8kCREMiO/mbYOQL0EGknV7W3hyEWc8gzzYGiit5V vVeGYPmby7IAiEKPGRJvk+nFY+cwLnsaqAQ9GMKmQ2GOjqYIE2zDlgiG28ZlcDV6Geu4 QYI83m77HfI8hYBoVRBa5Ioi7M2SbEUtLmjD7RHM+cVkXlp2IFldZf72scdctrZu93SW ERQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=l9nZCCAVM1Rm7EuPYppwHmZpGtMEgQGRKkW0EU0xWNE=; b=MZ6ibgSENoWZRfIuq3DTtoNOwOWzzyJHOxOC/m5xuMGINUBgoT7g1LKWXUnduG1PU2 KwII6mrlCtXOzCOb9xzCWI7xAR9Va2evc2Ib4kWsA2IYU2CemsGM46cSILPJ5OtPRhVR bdf6JFMzAe6O6R+BmSg89yzo6Ld8en3dyoYjxMU0/oSH1dcxPQ4rpJsO03M7UTm3+LsV v74hpoLOxiUTA5VaTfnZ5+B9VeyCP+D1RSsQ2AFZStlLbREkQUjxMnV9I616AoyWZNkZ 42fM7joog/eXmf5tQoUt/G5tecZTdeqyAiUrhcBUI9to/r8wlCQ1h3jq0x73Z4iVPG8u TJAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O+80t8Ec; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b1si827525pgn.191.2018.03.09.06.50.57; Fri, 09 Mar 2018 06:50:57 -0800 (PST) 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=@linaro.org header.s=google header.b=O+80t8Ec; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932399AbeCIOuw (ORCPT + 28 others); Fri, 9 Mar 2018 09:50:52 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:44507 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932251AbeCIOuu (ORCPT ); Fri, 9 Mar 2018 09:50:50 -0500 Received: by mail-wr0-f196.google.com with SMTP id v65so9265165wrc.11 for ; Fri, 09 Mar 2018 06:50:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=l9nZCCAVM1Rm7EuPYppwHmZpGtMEgQGRKkW0EU0xWNE=; b=O+80t8EcpatgLQOe6Ctg40opt3h8EWGuM+n7tJQ23Q7QeT9ASbZ3l2I19BdvY/0ktd bQ9s1OI8VewEmpOPEZmHy51YgDdbdkopl45U83z+4KcZiBrB2rEEzEiKQzbb89NQOBdU 3lrcFMeJKVaX4udK/FozOCPX99EhWWE9Og80o= 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:in-reply-to :references; bh=l9nZCCAVM1Rm7EuPYppwHmZpGtMEgQGRKkW0EU0xWNE=; b=l9PTBQRGxJ3EDTD4HtLe6c80BR+m5Q1HFO5mh47gg1o+kC5OEfaKuSfnviqvTg6sX+ FnkTE178xb0A7/eM3mczkrG6Pd47dNzsjULXgu+gFuk4r1JEGqni1RdZb2zzoD6agL/U wVi0/mHvqjcFHtS+k4TejHpzDTtwEHZTEV4uYygyNll1tcXwSJlWKUlqCdzzVE8RTj0I tSlNdCMeQpfBZ5Bl/5RPAyOFgZFMBv/AnKBAGnjoXWtNJTnS3bvYHlu8uMP12rpwVW1S iKZ/Y9vwRDo7f0ETSrXkZq0MnRTzr2gzRsL5Vib+vE4wdh0sJa/rHG5kAAomrdYHkwC7 vDrQ== X-Gm-Message-State: APf1xPBsIr9OhDJ0BjibV0O659IculM/nT5Zxafj1fnxEFkpvEkwQsfe DJxZY+5mjI/8tQqC3bN03gjcqQ== X-Received: by 10.223.155.142 with SMTP id d14mr27164104wrc.93.1520607048968; Fri, 09 Mar 2018 06:50:48 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:48 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 20/25] nvmem: imx-iim: Do not use "&pdev->dev" explicitly Date: Fri, 9 Mar 2018 14:47:14 +0000 Message-Id: <20180309144719.29904-21-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov There's already "dev" variable for that. Use it. Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/imx-iim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.15.1 diff --git a/drivers/nvmem/imx-iim.c b/drivers/nvmem/imx-iim.c index b98d76ac7790..6651e4cdc002 100644 --- a/drivers/nvmem/imx-iim.c +++ b/drivers/nvmem/imx-iim.c @@ -125,7 +125,7 @@ static int imx_iim_probe(struct platform_device *pdev) drvdata = of_id->data; - iim->clk = devm_clk_get(&pdev->dev, NULL); + iim->clk = devm_clk_get(dev, NULL); if (IS_ERR(iim->clk)) return PTR_ERR(iim->clk); From patchwork Fri Mar 9 14:47:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131121 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1078849lja; Fri, 9 Mar 2018 06:52:01 -0800 (PST) X-Google-Smtp-Source: AG47ELulHf92oMxJYQYkAWEA4tXjAd4cUOV9OLCvqYwfIaydGzjFkzWUz9hag622HBF/Fpa9O/uP X-Received: by 10.101.98.149 with SMTP id f21mr1407510pgv.7.1520607121590; Fri, 09 Mar 2018 06:52:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607121; cv=none; d=google.com; s=arc-20160816; b=G6Mfv8nIUnCQu3JuEwJ3uLj1a0lBaSsdsmKLCUFzDCyKHft2metp1fCV6PPq4ormTs JMdOoWYleJgG4mGN7sWnCIkU9QzY53bPB6KDUo0dJNwraD3m+EF5wigQVqIeoKh2LZVp Lk8VeFFL6dlXwnZ6DFzIGQz0oSTSCPMwkfYtd29XC3MLvfkqoV+/LWjzOBREOgo2wf6G QhhfDEiaIHz5uWYFBYnKSAcFJmtmYd9UQN7z6DzaFE3oha4kWbTcF7kLADCtPLolVytx Qq0prpgGb0Zumh0LFt3J98tOYSnBFQpoPIDpkr3c8ojF+YkM6lc/tg199HLLb+Mgxdl9 Kusw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=3ZSCv8oSZg2owMLKNVQOSEpWttP2gkpTlAcGvmpr+DI=; b=ERO9tNYgk/ABvfHF0WS77JCAKaqu/3JkxIJXZqk22/NMfygaL47L4NSXGX2EauzguP qA5TwS6Dz7bAssP131/7ek8X2W6+OLajzkAzxNW5m9GcYfS5qNwXjf2yjRnqisxWRU42 btvVsEU56BmJdnQ1eQVpJwh0GI80dZuUiGUOKuiPhuBxVLxt5imL237AEKZQVFPXi4E0 2E9tn8spwfv0xbPsGBQZFzAmkLzlHBz9aeOwYagt1WtwDHg0DTwQyxbDNOMmf4WE6zik h32e7p/NYGw39N2U5eml9KdXAr1TkBUxAX8cIge46VXw8GrspxyKpRLDJUl/2SMSUEyM HaDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TqvcsK03; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o22si829672pgv.232.2018.03.09.06.52.00; Fri, 09 Mar 2018 06:52:01 -0800 (PST) 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=@linaro.org header.s=google header.b=TqvcsK03; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932193AbeCIOv4 (ORCPT + 28 others); Fri, 9 Mar 2018 09:51:56 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:54611 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932314AbeCIOuv (ORCPT ); Fri, 9 Mar 2018 09:50:51 -0500 Received: by mail-wm0-f65.google.com with SMTP id z81so4360276wmb.4 for ; Fri, 09 Mar 2018 06:50:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=3ZSCv8oSZg2owMLKNVQOSEpWttP2gkpTlAcGvmpr+DI=; b=TqvcsK03n6rJqF951H1HUlNq7FGnTsSuKL1fQx0p2oLzysdpPC4SgMGKoPswfLyTeX Ld5bq8zG2aIIQvsoKGQiDFu7yYBnDqTYdfYg5+AQQItxmsNpuuI15GkICdT308ZTCZb7 xajoxhnX1KOIsezeFSuULtYL6k5AMH/4TGPJw= 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:in-reply-to :references; bh=3ZSCv8oSZg2owMLKNVQOSEpWttP2gkpTlAcGvmpr+DI=; b=Wzgm+Rv8cgg1QP9LaxfBrz3YrTvCBNSLsiDPpQjOSzgKAgMC/Ri/LWWt7m+ZdITpMW j2u7f3XczXxRtft7v9QFTt6L7z6lds4yEiLdaTkXHfTdNWRhm4zdbJJdPTFru04NDzgX CPQ/xrSRrzL3AjI4+ktwx8Z0w1/ocfxPUU5UQGaiLyObNA94tLXe8gb2m7HBSJpZCKue BahhBm4EMFEejCG5IW4iFr+G6H77JxohLICWInflMyWOG9p2tiLh5jgIhiuOZYifNC+W jDs9H8jy2+bOfY13Mf5iau5cPZCvtbYxKSpHP8Ma2FE7+WKlvq17W9HYy6vYNFRMdIGe 9zIA== X-Gm-Message-State: AElRT7GG4BQDoi6kIdonLaaKRuZwbTo0797q9I3F0mhIGysrOk+SD/hr 32VCcXTfG85cIpHTckRu/sjLPg== X-Received: by 10.28.238.132 with SMTP id j4mr2395380wmi.73.1520607050262; Fri, 09 Mar 2018 06:50:50 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:49 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 21/25] nvmem: bcm-ocotp: Do not use "&pdev->dev" explicitly Date: Fri, 9 Mar 2018 14:47:15 +0000 Message-Id: <20180309144719.29904-22-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Smirnov There's "dev" variable for this already. Use it. Cc: Srinivas Kandagatla Cc: Heiko Stuebner Cc: Masahiro Yamada Cc: Carlo Caione Cc: Kevin Hilman Cc: Matthias Brugger Cc: cphealy@gmail.com Cc: linux-kernel@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Andrey Smirnov Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/bcm-ocotp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.15.1 diff --git a/drivers/nvmem/bcm-ocotp.c b/drivers/nvmem/bcm-ocotp.c index 24c30fa475cc..4159b3f41d79 100644 --- a/drivers/nvmem/bcm-ocotp.c +++ b/drivers/nvmem/bcm-ocotp.c @@ -262,8 +262,7 @@ static int bcm_otpc_probe(struct platform_device *pdev) else if (of_device_is_compatible(dev->of_node, "brcm,ocotp-v2")) priv->map = &otp_map_v2; else { - dev_err(&pdev->dev, - "%s otpc config map not defined\n", __func__); + dev_err(dev, "%s otpc config map not defined\n", __func__); return -EINVAL; } From patchwork Fri Mar 9 14:47:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131117 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1077874lja; Fri, 9 Mar 2018 06:51:02 -0800 (PST) X-Google-Smtp-Source: AG47ELtYD1ZAGVKZ4rrwGM7gED+1yO0SiBVtkIm2oDgSn4moG3COfMSncLlbv7O2TLM8HZuYq0pZ X-Received: by 2002:a17:902:5609:: with SMTP id h9-v6mr27878301pli.302.1520607062020; Fri, 09 Mar 2018 06:51:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607062; cv=none; d=google.com; s=arc-20160816; b=iByR1wbpIGHwb3Cjff+jWr8WUcC+n9MEqr4rC5yhGQ1uSWX+hLalO/eiJB9/WKlltg T9LGNj3KGAIZVQRBkUCZdkELY2ahGG8/h01Jep/2DaQtdM9fO+MqR4GrZHlBy/7PLbtW 98lhXAR6Qm/9mraIDH4lRJIiYoao2icV/xieYc+CZKArnEUr0ooQCWtP88mBkxSD/jge Mv0EZs+kG9hN9zaG7b956h+TOQWWCrIa4he0CX9L1mW4V3DZNQ40KtzPzxxiOGSTAQnh qvFclWl4Y8WYjiJGT23PDz8OoUdoo4hLXq86I3/tBlc3aLCD04mWCGlilQETIYkHUvXj dfhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=lpctMtysOcxf6hdrVzb3i/6ck+RlkwUyeipEi1tXQa4=; b=YU1UwNiPRvq3xM5MoUQdpEPKArcsZQVCszDrpYUFGFYaI0b4eVlZpBzRZUKyZFanvx pmTjwfbZ+kF2h7CDlKwvoUKaAr1MvxP2gJorPOUO1YH1IXT8bkcg7nARxQLVY5FJotF6 0Adj1X9a8jw4Krf/KxEaw2gWFrLzKKgAkfzDVJENPmIy3GLXc857abAP0oPlnfjchIpb NMvn9HHHkChYGDH37jwUIr79FqgvtbxWmyNMZrnKvDGaw6FrXNe4P5OQYF4v/hrlYlyE z8seJ0qx8v4rpdqkXWLZOBTbcaD7nZuBY+z82w78fl0JQ9bZZwOvUR2sdXBp9SHArquZ ZA1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=f9dlyP/U; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g11si976638pfd.272.2018.03.09.06.51.01; Fri, 09 Mar 2018 06:51:02 -0800 (PST) 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=@linaro.org header.s=google header.b=f9dlyP/U; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932408AbeCIOu6 (ORCPT + 28 others); Fri, 9 Mar 2018 09:50:58 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:40651 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932251AbeCIOux (ORCPT ); Fri, 9 Mar 2018 09:50:53 -0500 Received: by mail-wr0-f196.google.com with SMTP id o76so9267286wrb.7 for ; Fri, 09 Mar 2018 06:50:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lpctMtysOcxf6hdrVzb3i/6ck+RlkwUyeipEi1tXQa4=; b=f9dlyP/U1blWtHun8zcV5qFF3zFMBjRAwtpjzDZ4DurzBuhRIa2TOI5YywcXKCioTB znTQpnvQsI5c279THiYNrDkHfRZJ99wRSIT24WVxHg0Kwu30RhCjRiMl9EECROGRXhdD 22F4BNc9Z1dxJ5GkfPNEITnBqzpxZzflc9Qbo= 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:in-reply-to :references; bh=lpctMtysOcxf6hdrVzb3i/6ck+RlkwUyeipEi1tXQa4=; b=MbEoWqwdRtumbsMF9eIOse+ZmVtWadKQJMipJQyQtgI3UNilVLJUhlr5i2Vsrjky9O +9mPN9A2gMUuguQPwCCf1UA+BPNCY8EyxDXO6MVh23G4wvGSr9ORCyh2vOmH+TfIskD2 oXcEP7TROyKsLzLor5wzghjyZPsEiaUKRA1BPZgLRskXQgkoh6vhrRpFUAnyDz19XhJ4 bhtTuo0eoshti79Av2nnTjI3OnPOW55iHXQhyOlQPSrywu7CZ6LST4BcXDwnt+hs3COu Cb7nOr+ZzAA2/UnqPdL84RdDe+/zSChyRI/VAPMeGPgXj0TqmkU/LHzmFzSeLPNxtqI9 YUMg== X-Gm-Message-State: APf1xPDpmE6Hrg45e1cSu6t6dvTVmXJiOR0aGj5qwhR8b8h+bAF62qXN cOhMBRpBGGvE/ko4qXXykjqC/w== X-Received: by 10.223.151.129 with SMTP id s1mr27283133wrb.206.1520607051778; Fri, 09 Mar 2018 06:50:51 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:50 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Andrey Yurovsky Subject: [PATCH 22/25] nvmem: add i.MX7 support to snvs-lpgpr Date: Fri, 9 Mar 2018 14:47:16 +0000 Message-Id: <20180309144719.29904-23-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Yurovsky The i.MX7 family has similar SNVS hardware so make the snvs-lpgpr support it along with the i.MX6 family. The register interface is the same except for the number and offset of the general purpose registers. Signed-off-by: Andrey Yurovsky Reviewed-by: Oleksij Rempel Signed-off-by: Srinivas Kandagatla --- .../devicetree/bindings/nvmem/snvs-lpgpr.txt | 3 ++- drivers/nvmem/Kconfig | 4 ++-- drivers/nvmem/snvs_lpgpr.c | 27 +++++++++++++++++----- 3 files changed, 25 insertions(+), 9 deletions(-) -- 2.15.1 diff --git a/Documentation/devicetree/bindings/nvmem/snvs-lpgpr.txt b/Documentation/devicetree/bindings/nvmem/snvs-lpgpr.txt index 20bc49b49799..3cb170896658 100644 --- a/Documentation/devicetree/bindings/nvmem/snvs-lpgpr.txt +++ b/Documentation/devicetree/bindings/nvmem/snvs-lpgpr.txt @@ -1,5 +1,5 @@ Device tree bindings for Low Power General Purpose Register found in i.MX6Q/D -Secure Non-Volatile Storage. +and i.MX7 Secure Non-Volatile Storage. This DT node should be represented as a sub-node of a "syscon", "simple-mfd" node. @@ -8,6 +8,7 @@ Required properties: - compatible: should be one of the fallowing variants: "fsl,imx6q-snvs-lpgpr" for Freescale i.MX6Q/D/DL/S "fsl,imx6ul-snvs-lpgpr" for Freescale i.MX6UL + "fsl,imx7d-snvs-lpgpr" for Freescale i.MX7D/S Example: snvs: snvs@020cc000 { diff --git a/drivers/nvmem/Kconfig b/drivers/nvmem/Kconfig index ff505af064ba..5f9bc787d634 100644 --- a/drivers/nvmem/Kconfig +++ b/drivers/nvmem/Kconfig @@ -167,10 +167,10 @@ config MESON_MX_EFUSE config NVMEM_SNVS_LPGPR tristate "Support for Low Power General Purpose Register" - depends on SOC_IMX6 || COMPILE_TEST + depends on SOC_IMX6 || SOC_IMX7D || COMPILE_TEST help This is a driver for Low Power General Purpose Register (LPGPR) available on - i.MX6 SoCs in Secure Non-Volatile Storage (SNVS) of this chip. + i.MX6 and i.MX7 SoCs in Secure Non-Volatile Storage (SNVS) of this chip. This driver can also be built as a module. If so, the module will be called nvmem-snvs-lpgpr. diff --git a/drivers/nvmem/snvs_lpgpr.c b/drivers/nvmem/snvs_lpgpr.c index 92e1e41d128e..c050a23a9f2b 100644 --- a/drivers/nvmem/snvs_lpgpr.c +++ b/drivers/nvmem/snvs_lpgpr.c @@ -14,15 +14,21 @@ #include #define IMX6Q_SNVS_HPLR 0x00 -#define IMX6Q_GPR_SL BIT(5) #define IMX6Q_SNVS_LPLR 0x34 -#define IMX6Q_GPR_HL BIT(5) #define IMX6Q_SNVS_LPGPR 0x68 +#define IMX7D_SNVS_HPLR 0x00 +#define IMX7D_SNVS_LPLR 0x34 +#define IMX7D_SNVS_LPGPR 0x90 + +#define IMX_GPR_SL BIT(5) +#define IMX_GPR_HL BIT(5) + struct snvs_lpgpr_cfg { int offset; int offset_hplr; int offset_lplr; + int size; }; struct snvs_lpgpr_priv { @@ -36,6 +42,14 @@ static const struct snvs_lpgpr_cfg snvs_lpgpr_cfg_imx6q = { .offset = IMX6Q_SNVS_LPGPR, .offset_hplr = IMX6Q_SNVS_HPLR, .offset_lplr = IMX6Q_SNVS_LPLR, + .size = 4, +}; + +static const struct snvs_lpgpr_cfg snvs_lpgpr_cfg_imx7d = { + .offset = IMX7D_SNVS_LPGPR, + .offset_hplr = IMX7D_SNVS_HPLR, + .offset_lplr = IMX7D_SNVS_LPLR, + .size = 16, }; static int snvs_lpgpr_write(void *context, unsigned int offset, void *val, @@ -50,14 +64,14 @@ static int snvs_lpgpr_write(void *context, unsigned int offset, void *val, if (ret < 0) return ret; - if (lock_reg & IMX6Q_GPR_SL) + if (lock_reg & IMX_GPR_SL) return -EPERM; ret = regmap_read(priv->regmap, dcfg->offset_lplr, &lock_reg); if (ret < 0) return ret; - if (lock_reg & IMX6Q_GPR_HL) + if (lock_reg & IMX_GPR_HL) return -EPERM; return regmap_bulk_write(priv->regmap, dcfg->offset + offset, val, @@ -112,7 +126,7 @@ static int snvs_lpgpr_probe(struct platform_device *pdev) cfg->dev = dev; cfg->stride = 4; cfg->word_size = 4; - cfg->size = 4; + cfg->size = dcfg->size, cfg->owner = THIS_MODULE; cfg->reg_read = snvs_lpgpr_read; cfg->reg_write = snvs_lpgpr_write; @@ -126,6 +140,7 @@ static const struct of_device_id snvs_lpgpr_dt_ids[] = { { .compatible = "fsl,imx6q-snvs-lpgpr", .data = &snvs_lpgpr_cfg_imx6q }, { .compatible = "fsl,imx6ul-snvs-lpgpr", .data = &snvs_lpgpr_cfg_imx6q }, + { .compatible = "fsl,imx7d-snvs-lpgpr", .data = &snvs_lpgpr_cfg_imx7d }, { }, }; MODULE_DEVICE_TABLE(of, snvs_lpgpr_dt_ids); @@ -140,5 +155,5 @@ static struct platform_driver snvs_lpgpr_driver = { module_platform_driver(snvs_lpgpr_driver); MODULE_AUTHOR("Oleksij Rempel "); -MODULE_DESCRIPTION("Low Power General Purpose Register in i.MX6 Secure Non-Volatile Storage"); +MODULE_DESCRIPTION("Low Power General Purpose Register in i.MX6 and i.MX7 Secure Non-Volatile Storage"); MODULE_LICENSE("GPL v2"); From patchwork Fri Mar 9 14:47:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131119 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1078372lja; Fri, 9 Mar 2018 06:51:31 -0800 (PST) X-Google-Smtp-Source: AG47ELswE2F/gbHVmMdXPI9NIGSidMcUsIqUmt3icv2N67XYyh1Ps6xCIAPYcmIKmnqjjlDwnP/g X-Received: by 10.98.35.195 with SMTP id q64mr30003784pfj.161.1520607091178; Fri, 09 Mar 2018 06:51:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607091; cv=none; d=google.com; s=arc-20160816; b=UxM+Buz7nFGj24NLe7lZi9pipM4AbZZBFfSO0k2zJl1yuZUsGCzLpDXc79vavhdUi0 Dt5dHvtzDMiievVDTsc5aIyCf+uvy4JIkRe90vk+Dc+xTYwRFmbQgFqid+dBuCfpMMOz 27zAQijQO0l23chW8El0dQpaVJbbY19+Xwp7k0ZooIu14YM9LwGEkuzCwIGBDVTO898V Oe3nvsIoFfIT9tAYPs1maoGFczJS7fqJgBZn5HtjXNZJgwBjInuoBbBK/An6YyL7cEc4 R/ptRcCWpnvUwdl/JrJDoVK5pOvZSYRU7GKqKTMWLT0xcV0FnLlV6t56simLJg+ponMk 9ERQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=Ufwf7qBywoUhGsTDixw/ddKEjV907Zte7g3Yg4PGjmw=; b=NWYN7eWU/PVRtsvxAqkRjJI4LLuB0Icz2UpDS8EvfDkYO3eMtsmFWmNWnKRfq8F4Pd DdA25Xt/gixxxnXEHPa8C6+J0Ap5w6t3iOLHYznMjjiRieZjftaU5/I1QGulsd+EPLoz zgUjTbRea5mBc8VtKlX2r/5iIyezdkdG0Wv1zkZwCZrSvCMp7CbQ8lrQn1gr6DLnQ6m4 6blvrGxKuRTsRLS20p8cxUVPJBnk2EpggO8C6VznvRM8wNYWir1rcqgjP+/sfeaQtyek GYMG0ryXDnS3qLl/fgIUkK3Lp21zWLPiICblZQOwXlNwmoFVatds/dcTLADiP0pEKRKO XE6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HjvFaFKH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 70-v6si988887ple.147.2018.03.09.06.51.30; Fri, 09 Mar 2018 06:51:31 -0800 (PST) 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=@linaro.org header.s=google header.b=HjvFaFKH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932450AbeCIOv0 (ORCPT + 28 others); Fri, 9 Mar 2018 09:51:26 -0500 Received: from mail-wm0-f65.google.com ([74.125.82.65]:33292 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932368AbeCIOuy (ORCPT ); Fri, 9 Mar 2018 09:50:54 -0500 Received: by mail-wm0-f65.google.com with SMTP id s206so3794803wme.0 for ; Fri, 09 Mar 2018 06:50:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ufwf7qBywoUhGsTDixw/ddKEjV907Zte7g3Yg4PGjmw=; b=HjvFaFKHTrCOlqm3+hTvyp/+97ii/y8FzmhpPR1F/CC2nIhHYtI+YdnGrUQIPOxGOP 5NqdUA2tt6SQ2vctfPRBVjWjOqhkLpnhPdO8Um5csTtxKknP+wcVHFKMX+HjKlsoeH0l QBi1io99dazpyeI/09VbfHGTyzv0H1LRcOmyM= 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:in-reply-to :references; bh=Ufwf7qBywoUhGsTDixw/ddKEjV907Zte7g3Yg4PGjmw=; b=cjCinmfkfXT79gMPI8Bq0yWznaKDG9zir530poRcLoLuV8OmTa581/bNr8qRYkdTL9 Xtr0jK9eyNc/oSgLFhW0cqsx99D+eHhOWjbxOJl0hQhwZjvalt2+ws4DjK+HhDTUJWsk aHSzHayfx+MVxiXGu7ueKHVrGcOdKTdj859EcDRaIoM28PshhpQ7ptEAXlak+hhMyw0E xFVJRqVXaAGCzUXkpcz+BU6Bt2UUn6WfO7FHdMJVgYcMg1g5JyeZoW5kl0wNFr96XYuH DyrCvhxGXxVPIwnBVh6BlwGg7O/IS8fJJlNj9My0bcW7HSdc4qKcEEdSCKH97tlR5A8H f2Zg== X-Gm-Message-State: AElRT7GNVodXXYz9JEMztnVRI65KabTHCnO+dmGPyns3p5++Mdq0ZCO0 G7gpTWk8Oc9VO1j4l+fX959VsBgF5WI= X-Received: by 10.28.94.11 with SMTP id s11mr2201448wmb.159.1520607053501; Fri, 09 Mar 2018 06:50:53 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:52 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Icenowy Zheng Subject: [PATCH 23/25] nvmem: sunxi-sid: fix H3 SID controller support Date: Fri, 9 Mar 2018 14:47:17 +0000 Message-Id: <20180309144719.29904-24-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Icenowy Zheng It seems that doing some operation will make the value pre-read on H3 SID controller wrong again, so all operation should be performed by register. Change the SID reading to use register only. Signed-off-by: Icenowy Zheng Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/sunxi_sid.c | 71 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 50 insertions(+), 21 deletions(-) -- 2.15.1 diff --git a/drivers/nvmem/sunxi_sid.c b/drivers/nvmem/sunxi_sid.c index 99bd54d85fcb..26bb637afe92 100644 --- a/drivers/nvmem/sunxi_sid.c +++ b/drivers/nvmem/sunxi_sid.c @@ -85,13 +85,14 @@ static int sunxi_sid_read(void *context, unsigned int offset, } static int sun8i_sid_register_readout(const struct sunxi_sid *sid, - const unsigned int word) + const unsigned int offset, + u32 *out) { u32 reg_val; int ret; /* Set word, lock access, and set read command */ - reg_val = (word & SUN8I_SID_OFFSET_MASK) + reg_val = (offset & SUN8I_SID_OFFSET_MASK) << SUN8I_SID_OFFSET_SHIFT; reg_val |= SUN8I_SID_OP_LOCK | SUN8I_SID_READ; writel(reg_val, sid->base + SUN8I_SID_PRCTL); @@ -101,7 +102,49 @@ static int sun8i_sid_register_readout(const struct sunxi_sid *sid, if (ret) return ret; + if (out) + *out = readl(sid->base + SUN8I_SID_RDKEY); + writel(0, sid->base + SUN8I_SID_PRCTL); + + return 0; +} + +/* + * On Allwinner H3, the value on the 0x200 offset of the SID controller seems + * to be not reliable at all. + * Read by the registers instead. + */ +static int sun8i_sid_read_byte_by_reg(const struct sunxi_sid *sid, + const unsigned int offset, + u8 *out) +{ + u32 word; + int ret; + + ret = sun8i_sid_register_readout(sid, offset & ~0x03, &word); + + if (ret) + return ret; + + *out = (word >> ((offset & 0x3) * 8)) & 0xff; + + return 0; +} + +static int sun8i_sid_read_by_reg(void *context, unsigned int offset, + void *val, size_t bytes) +{ + struct sunxi_sid *sid = context; + u8 *buf = val; + int ret; + + while (bytes--) { + ret = sun8i_sid_read_byte_by_reg(sid, offset++, buf++); + if (ret) + return ret; + } + return 0; } @@ -131,26 +174,12 @@ static int sunxi_sid_probe(struct platform_device *pdev) size = cfg->size; - if (cfg->need_register_readout) { - /* - * H3's SID controller have a bug that the value at 0x200 - * offset is not the correct value when the hardware is reseted. - * However, after doing a register-based read operation, the - * value become right. - * Do a full read operation here, but ignore its value - * (as it's more fast to read by direct MMIO value than - * with registers) - */ - for (i = 0; i < (size >> 2); i++) { - ret = sun8i_sid_register_readout(sid, i); - if (ret) - return ret; - } - } - econfig.size = size; econfig.dev = dev; - econfig.reg_read = sunxi_sid_read; + if (cfg->need_register_readout) + econfig.reg_read = sun8i_sid_read_by_reg; + else + econfig.reg_read = sunxi_sid_read; econfig.priv = sid; nvmem = nvmem_register(&econfig); if (IS_ERR(nvmem)) @@ -163,7 +192,7 @@ static int sunxi_sid_probe(struct platform_device *pdev) } for (i = 0; i < size; i++) - randomness[i] = sunxi_sid_read_byte(sid, i); + econfig.reg_read(sid, i, &randomness[i], 1); add_device_randomness(randomness, size); kfree(randomness); From patchwork Fri Mar 9 14:47:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131120 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1078502lja; Fri, 9 Mar 2018 06:51:40 -0800 (PST) X-Google-Smtp-Source: AG47ELvokrtVNtgZvjuDPokAW7RjNGBYwP/1BBqUo/Pjt7jZMzvcQ+ypgezQl3Wpucb7tWWrC4yv X-Received: by 2002:a17:902:9a4a:: with SMTP id x10-v6mr20374600plv.256.1520607100038; Fri, 09 Mar 2018 06:51:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607100; cv=none; d=google.com; s=arc-20160816; b=GHZcyL+hTW1LIzIXiXz46g7mlgM1dDAxY9Xyn3VXL1Vp17OFMrpIiVGXbNaoXvrE5+ 2jcTL9lnTQ8LeggTHgUipXRo+DQfoHWQszcvI3EHByk1yYS9m/VtM6ieiLuVtku+Tb6a dg2oYPzW7teIhAN8lOzM7U5AaTczKKmrjarlcmUj5DurK6EnY94f/iEyma6Ljk5WKVDd ZHmIpwzUYGryu7yZb3UUjiHCjmdiZPlg/+S2pbukMGkFP/LfiBRtrtSWCA9pU9mwy8Wq fJ3wVE9AaYKXde9PQcLKRwJQB/74grdzBS5O56JtH6BFrHleCzSYt9ZKm5/yspwzevc0 XmlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=qpEYox52IfOO1r/zjGnj1eWI1ORkVK2L+qDQ0Z1/bM8=; b=iIemInwoIzem3g6sxhDnBfZcYOSjji+RtNrYR6HORGHdFWoLaPJUGkMtwWEFDQPRCN 4g9Qhq8Dj+xnqpgEKe8MUioaY6VOBQV+j0pzSYNkBEyIXlNBVZEsw/VoPTHgJ1DIZq00 ahjuq1KGZ0typjvrFmO4gpOCw41Qjmg1UUh/xQYHYo1z2a/mTJcDKLcOUGcCyf60YEvl S8Aso5HoP5b+MvOr7H3RxORvPkehYfq7Sw8e+O+yrGuur4BjAyntQE70mP+9VC2P7x8J AjvbUjEUAQA3+XEMyxtEpMqmp8DORz1P1iCRcITJq+Nvj/B1WYopLdSHNKMSSvEKexWI c+Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EM+F+jf4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 70-v6si988887ple.147.2018.03.09.06.51.39; Fri, 09 Mar 2018 06:51:40 -0800 (PST) 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=@linaro.org header.s=google header.b=EM+F+jf4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932432AbeCIOvZ (ORCPT + 28 others); Fri, 9 Mar 2018 09:51:25 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:40656 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751161AbeCIOuz (ORCPT ); Fri, 9 Mar 2018 09:50:55 -0500 Received: by mail-wr0-f195.google.com with SMTP id o76so9267431wrb.7 for ; Fri, 09 Mar 2018 06:50:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qpEYox52IfOO1r/zjGnj1eWI1ORkVK2L+qDQ0Z1/bM8=; b=EM+F+jf4OA/j4WoisCl+1VD0dcPfJx+RBwgvAnKp2JFBi2fW7c2DGMqIiUrs80tCIp rbUsVARGF/9HXxpqZFlusTB+lTwsbb+r6G+77D0l+FB3/MdfQir3XvOlb9eAR3YCdRnb GZI50Txq/A61eX6ZbO/XHztwqAwBlmGOEec0Y= 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:in-reply-to :references; bh=qpEYox52IfOO1r/zjGnj1eWI1ORkVK2L+qDQ0Z1/bM8=; b=m+D9nZqRwy6efclS7YqOmhNPN2QddqKuaJSvd336m6pEgmFKws97uqY60UF31k9Ziy nwxuekFNGKl8gdbbKhCjaE0kXBOI0GYK765weVPj82VQkpfSFNMvOtpAkSanyQefA3d/ jenkBQX+eEA+3dn+kqzjNvgLmuLNcOWrB0ZV9QAarDvJaJrNNpha121Ifipf+K+VAU1H JqcpxIpdpvth11lMQnt7vsYO3Se3hUnWO1iUDguCsYJUM/Ifxmn3tYiJYpw+/xyOGFDw mPU+OUmAqzMYab+lutJgUkS1waZHTeDM7lA19CVCQnt4ItavA726tzp1UxihU8QgBNjx 2WXQ== X-Gm-Message-State: APf1xPC2BZ4rWHahjKg94MI3J6QVImr3wdKjBZwrRFBsjTFqkFOc40Zj Rp9JP1euqZEEoU7hMHa+SqFDS3HGWTc= X-Received: by 10.223.209.197 with SMTP id m5mr26277278wri.121.1520607054833; Fri, 09 Mar 2018 06:50:54 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:54 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Dong Aisheng , Rob Herring , Mark Rutland , Shawn Guo Subject: [PATCH 24/25] dt-bindings: nvmem: imx-ocotp: update the binding to reflect data cells Date: Fri, 9 Mar 2018 14:47:18 +0000 Message-Id: <20180309144719.29904-25-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dong Aisheng imx-ocotp is implemented based on nvmem which can have data cells as child node. Update the binding doc to reflect it to be more easily understood by users. Cc: Srinivas Kandagatla Cc: Rob Herring Cc: Mark Rutland Cc: Shawn Guo Signed-off-by: Dong Aisheng Acked-by: Shawn Guo Reviewed-by: Rob Herring Signed-off-by: Srinivas Kandagatla --- .../devicetree/bindings/nvmem/imx-ocotp.txt | 23 ++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) -- 2.15.1 diff --git a/Documentation/devicetree/bindings/nvmem/imx-ocotp.txt b/Documentation/devicetree/bindings/nvmem/imx-ocotp.txt index f162c72b4e36..729f6747813b 100644 --- a/Documentation/devicetree/bindings/nvmem/imx-ocotp.txt +++ b/Documentation/devicetree/bindings/nvmem/imx-ocotp.txt @@ -11,17 +11,32 @@ Required properties: "fsl,imx6ul-ocotp" (i.MX6UL), "fsl,imx7d-ocotp" (i.MX7D/S), followed by "syscon". +- #address-cells : Should be 1 +- #size-cells : Should be 1 - reg: Should contain the register base and length. - clocks: Should contain a phandle pointing to the gated peripheral clock. Optional properties: - read-only: disable write access -Example: +Optional Child nodes: + +- Data cells of ocotp: + Detailed bindings are described in bindings/nvmem/nvmem.txt +Example: ocotp: ocotp@21bc000 { - compatible = "fsl,imx6q-ocotp", "syscon"; + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,imx6sx-ocotp", "syscon"; reg = <0x021bc000 0x4000>; - clocks = <&clks IMX6QDL_CLK_IIM>; - read-only; + clocks = <&clks IMX6SX_CLK_OCOTP>; + + tempmon_calib: calib@38 { + reg = <0x38 4>; + }; + + tempmon_temp_grade: temp-grade@20 { + reg = <0x20 4>; + }; }; From patchwork Fri Mar 9 14:47:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 131118 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp1078060lja; Fri, 9 Mar 2018 06:51:12 -0800 (PST) X-Google-Smtp-Source: AG47ELsr3stL52R1/xHv86qI5BQvQco6lMEsBeA1SuIo+xORzE8WwgaLJa4hmYtw+YjoXVScy2Wj X-Received: by 2002:a17:902:6582:: with SMTP id c2-v6mr868809plk.189.1520607071836; Fri, 09 Mar 2018 06:51:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520607071; cv=none; d=google.com; s=arc-20160816; b=VnAC22y+A0Vw8SZcuaHqhNXE7pQqoTi4AQmHptUhRLlREPlXezEvMy+RAjHNO37MzT 1P7+e9iNN2AURbHWEXa38tkj6GQIX6R6cVV1nEaUrYqoQfHu6zn1xZKsaTTNCpxEhUQt 7EI+HOzqQ8aPMtTNlSKu0uOujNQyOY5X1B6JDpqLYCmhYq7POylE2qR13DHpyLquDEpZ eXISdlafz/KrbY6TiRXZ94m9QVIW2N0RMfTupWPm8GdORtwRJ/VKBwTjGN2LNDy6givJ TvfLgEGe43ZEHgSllr22Qpnto6bOjzqM2Fbq+fZn43b7Y6dcxNYc0fonO0S1u4r6PCL2 DS4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=1xqCUxyI79DAmSeIUQbewmE0e3acBTiWN2U03OuSA80=; b=XD1+N3hH8ymO0s9eaoXC0F12bt7g49HEcPX+brzkXEAntvcRMVDkR+nt7+wHvG/ldO BGdjPoH4gXp2gey92mwjjgq0NNYPun+FKzLqcFMGnvE7hSvKFxBxCc3dMAozZbrNZszW AyVKP3RbudWQzYPjUthdtETstvmjunXL3VqxGfWAkoYYrJzDmKB5yrB/5cWQAha/7qjV nCNc8/WDOgS1aOE9PlDAKB/31ju1sNx3I1xtUcQFSD5GZAL6PpJFhFfdqP5xjuiJ3t/F BvFdRz14R3WILOW+r1KOKi0LUWRwOZpKR5h0lk0nKwqgmvNlZUQso+nYR0bcB7H2IYfp RdGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Yzlc/oc2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g11si976638pfd.272.2018.03.09.06.51.11; Fri, 09 Mar 2018 06:51:11 -0800 (PST) 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=@linaro.org header.s=google header.b=Yzlc/oc2; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932420AbeCIOvJ (ORCPT + 28 others); Fri, 9 Mar 2018 09:51:09 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:37468 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751244AbeCIOu5 (ORCPT ); Fri, 9 Mar 2018 09:50:57 -0500 Received: by mail-wr0-f193.google.com with SMTP id z12so9267658wrg.4 for ; Fri, 09 Mar 2018 06:50:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1xqCUxyI79DAmSeIUQbewmE0e3acBTiWN2U03OuSA80=; b=Yzlc/oc2h6nKFFUwYT/obQ/asb2ou+AyoueXiDQrIBtnyp80hihq3Y42aAE3/GHnvO zqRbdUbtnlc9ZLpR8jBZqSP/YS5L2IOnPa16PHj6g8oh16tFwesYxUKZ8+n3fBv+6yp3 3GZj9GNSvLZLfz4GHxcUhy5Y8ZVWjxaYvHKDw= 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:in-reply-to :references; bh=1xqCUxyI79DAmSeIUQbewmE0e3acBTiWN2U03OuSA80=; b=jaLebHheszrpda1bPClE5EqaSuCqY4VBxnNfCrSfJLXV9ZIZwhi3eeCFoeedIHFKxV +Xuy0HKeZ8Ghc7+4NLU9f45rNCqt3YLeDyomDrNiUuvmRNis6Xs1wQ28d0atDXKmQe1L ed042KR1ngf2TeD3GuLQzQ4KPE66898Q8IZckEM84i8E0NmCW5lh0iQX0Gm0utt6Qukj gdmpkdObOYNfJWqxmPIMFMdixmUyv4ZlJpLgJvrNbn2LS9cR+nNbVMVzirmvJC2zEK2G EXXVGgIXCjof5stBpbpWPKXhNaqW+96UsMIYjBywnZzQVgqk7u3UeETSW887vZMbHS+u cGkA== X-Gm-Message-State: APf1xPCKTSk/TE56OAyUrsBYKcTJ7UiIUL/7eWxhEaO0LVIUmNq4BUnv Q24dKM6j2U1kJO/wZdls5S8ySQ== X-Received: by 10.223.138.153 with SMTP id y25mr25607094wry.257.1520607055881; Fri, 09 Mar 2018 06:50:55 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id u48sm1191901wrb.85.2018.03.09.06.50.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:55 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Dong Aisheng , Shawn Guo Subject: [PATCH 25/25] nvmem: imx-ocotp: remove unused dead code Date: Fri, 9 Mar 2018 14:47:19 +0000 Message-Id: <20180309144719.29904-26-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> References: <20180309144719.29904-1-srinivas.kandagatla@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dong Aisheng remove unused dead code Cc: Srinivas Kandagatla Cc: Shawn Guo Signed-off-by: Dong Aisheng Acked-by: Shawn Guo Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/imx-ocotp.c | 2 -- 1 file changed, 2 deletions(-) -- 2.15.1 diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c index f1482c664b19..60816c856dd6 100644 --- a/drivers/nvmem/imx-ocotp.c +++ b/drivers/nvmem/imx-ocotp.c @@ -439,7 +439,6 @@ MODULE_DEVICE_TABLE(of, imx_ocotp_dt_ids); static int imx_ocotp_probe(struct platform_device *pdev) { - const struct of_device_id *of_id; struct device *dev = &pdev->dev; struct resource *res; struct ocotp_priv *priv; @@ -460,7 +459,6 @@ static int imx_ocotp_probe(struct platform_device *pdev) if (IS_ERR(priv->clk)) return PTR_ERR(priv->clk); - of_id = of_match_device(imx_ocotp_dt_ids, dev); priv->params = of_device_get_match_data(&pdev->dev); imx_ocotp_nvmem_config.size = 4 * priv->params->nregs; imx_ocotp_nvmem_config.dev = dev;