From patchwork Mon Oct 9 13:26:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 115221 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp2558565qgn; Mon, 9 Oct 2017 06:27:12 -0700 (PDT) X-Received: by 10.99.111.5 with SMTP id k5mr9291119pgc.364.1507555632710; Mon, 09 Oct 2017 06:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507555632; cv=none; d=google.com; s=arc-20160816; b=O5KFCLr+OENhp+sOfjlrp9F7op0I9aM1b5neRnS0qr/jp+PQmm8ZJTg/A8WP/yh3vJ rTCzp3lvpBQw5P8XPOdKI4B3ulj79Q400HY6x5KHcosxOsJ1neZurKyXfDvf5wUvJoQt k6RHG/OqLPWZgb3MAwAj/8hiGLMV0IRAiNelXqEYHO6iRqYCdGPa+DAdsFuWdXQ3DBuZ iaLUHJQbIaM+09sgLPVoGD+0PVRKTqKMtdU5c6AHzaJvrWfMfIR1K8sunL1/53R3AS41 Ayy0Obgb8WnHuEjgwCg6dnqr2mXFE5e2JeWd8PefJLqxcf2yZa8UfIO8mgu43iPf2K/u PIMA== 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=Nmfd1BiRIL/4yNwiRgSXS41AxrndZZy2m4DfQUu3GMw=; b=mMwJz9KTwR7s7Fxm73D0KcrIXjaYWzUiroTzFL4va5NCquOs3iERTTIN2r4R8FpqTH SqG4jp6SR4ctL5zVJIbfWljtQ4BPg+dddIv0gih60by7qEiAhKpUvMR2y+FaG4otSC8r iFjCDz/c3+D0/wkjIG3IT2DOlGHjZ9CPIvSFMWUsmrqw74XeAYIpp4whH1+7WGbWxcr+ 0VhNNINFusfILtLVSV7TItoQB7vaLNPVL4fgKG1qCWgSp512VqNEQp6IhR2qtzUZTftv 7PjZZI+JGmimcLh3x1/2Yznz7U05PZX9Ws4FM8c5Ke0oT7bqLRcenxaCRyT5KUbJh1GK PTKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jWjqNsgR; 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 l30si6401586pgc.625.2017.10.09.06.27.12; Mon, 09 Oct 2017 06:27:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jWjqNsgR; 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 S1755475AbdJIN1J (ORCPT + 26 others); Mon, 9 Oct 2017 09:27:09 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:54762 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755409AbdJIN04 (ORCPT ); Mon, 9 Oct 2017 09:26:56 -0400 Received: by mail-wm0-f50.google.com with SMTP id i124so23437106wmf.3 for ; Mon, 09 Oct 2017 06:26:55 -0700 (PDT) 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=Nmfd1BiRIL/4yNwiRgSXS41AxrndZZy2m4DfQUu3GMw=; b=jWjqNsgRtj4nt9PZltfD2gDaebYe5Ukb90Y6971ma9fqvFQqB1maoZztmqfiW+K7uV gEiwBObqqvPUFaSSew1FXi2O4sDp8BYcOeUX7AHDxONkQptjrwnOn6TVeHuuOTSSvhgq LjWwgTHSShmVSXyAbcfe3MbQt65gIwrvhAOGs= 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=Nmfd1BiRIL/4yNwiRgSXS41AxrndZZy2m4DfQUu3GMw=; b=jGDKhm6bJFY+ciIa/oavDzCUahBoF94WmHkK2n23yMJkTVerlOWPlMYZTBrJY2ynIJ w8oUNk9zLl/D2AJ8cy/9dy0qouNMga/llLiwL8dGxYBYpgQS52Sxp8wLw2F4K4eixUxO 9t8zxSUzbbHJrfVaMXLNpTsBnj0pFS+Bl1hrjG+92FqsIU8ynig6LeBIlBGC/cZ5PnXI FtdDVGWhiPjl0mRPfw8t+natifI5ZohfWa4EzSLkszeEhH7KT+KETs+KaDcbZEwhJL0h w7O0eiudMsxqZK5O2dZO4yL7MsOUGl0fvLpQYkfzj0Ndvfy64NfC8e6wNB2FuDytyetM cvxQ== X-Gm-Message-State: AMCzsaVWC6EnfX1L8ePAnX4httrKAmHBM3p6DRvdP4sI11lSK0FqrY5C w6iNbsvDdfTw/Z6U7YbrYrAg6A== X-Google-Smtp-Source: AOwi7QBFjyZbx7o2Jk59elcRhabUz1Sv+uCK0OrtsAgn0q3RrdsV8peZZdhHlUCXZiEUNKlNmYB+jw== X-Received: by 10.28.216.143 with SMTP id p137mr9582356wmg.155.1507555614914; Mon, 09 Oct 2017 06:26:54 -0700 (PDT) Received: from localhost.localdomain (static.8.26.4.46.clients.your-server.de. [46.4.26.8]) by smtp.gmail.com with ESMTPSA id 31sm3775340wrm.0.2017.10.09.06.26.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Oct 2017 06:26:54 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, srinivas.kandagatla@linaro.org, Masahiro Yamada Subject: [PATCH 05/12] nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset Date: Mon, 9 Oct 2017 15:26:34 +0200 Message-Id: <20171009132641.27169-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171009132641.27169-1-srinivas.kandagatla@linaro.org> References: <20171009132641.27169-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: Masahiro Yamada All nvmem drivers are supposed to set the owner field of struct nvmem_config, but this matches nvmem->dev->driver->owner. As far as I see in drivers/nvmem/ directory, all the drivers are the case. So, make nvmem_register() set the nvmem's owner to the associated driver's owner unless nvmem_config sets otherwise. Remove .owner settings in the drivers that are now redundant. Signed-off-by: Masahiro Yamada Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/bcm-ocotp.c | 1 - drivers/nvmem/core.c | 2 ++ drivers/nvmem/imx-iim.c | 1 - drivers/nvmem/imx-ocotp.c | 1 - drivers/nvmem/lpc18xx_eeprom.c | 1 - drivers/nvmem/lpc18xx_otp.c | 1 - drivers/nvmem/meson-efuse.c | 1 - drivers/nvmem/mtk-efuse.c | 1 - drivers/nvmem/mxs-ocotp.c | 1 - drivers/nvmem/qfprom.c | 1 - drivers/nvmem/rockchip-efuse.c | 1 - drivers/nvmem/sunxi_sid.c | 1 - drivers/nvmem/vf610-ocotp.c | 1 - 13 files changed, 2 insertions(+), 12 deletions(-) -- 2.11.0 diff --git a/drivers/nvmem/bcm-ocotp.c b/drivers/nvmem/bcm-ocotp.c index 3c56e3b2bd65..5e9e324427f9 100644 --- a/drivers/nvmem/bcm-ocotp.c +++ b/drivers/nvmem/bcm-ocotp.c @@ -232,7 +232,6 @@ static struct nvmem_config bcm_otpc_nvmem_config = { .read_only = false, .word_size = 4, .stride = 4, - .owner = THIS_MODULE, .reg_read = bcm_otpc_read, .reg_write = bcm_otpc_write, }; diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 0a3464f647a4..e5f5df783898 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -462,6 +462,8 @@ struct nvmem_device *nvmem_register(const struct nvmem_config *config) nvmem->id = rval; nvmem->owner = config->owner; + if (!nvmem->owner && config->dev->driver) + nvmem->owner = config->dev->driver->owner; nvmem->stride = config->stride; nvmem->word_size = config->word_size; nvmem->size = config->size; diff --git a/drivers/nvmem/imx-iim.c b/drivers/nvmem/imx-iim.c index a5992602709a..52cfe91d9762 100644 --- a/drivers/nvmem/imx-iim.c +++ b/drivers/nvmem/imx-iim.c @@ -133,7 +133,6 @@ static int imx_iim_probe(struct platform_device *pdev) cfg.read_only = true, cfg.word_size = 1, cfg.stride = 1, - cfg.owner = THIS_MODULE, cfg.reg_read = imx_iim_read, cfg.dev = dev; cfg.size = drvdata->nregs; diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c index 193ca8fd350a..e57e2a57aa3f 100644 --- a/drivers/nvmem/imx-ocotp.c +++ b/drivers/nvmem/imx-ocotp.c @@ -303,7 +303,6 @@ static struct nvmem_config imx_ocotp_nvmem_config = { .read_only = false, .word_size = 4, .stride = 4, - .owner = THIS_MODULE, .reg_read = imx_ocotp_read, .reg_write = imx_ocotp_write, }; diff --git a/drivers/nvmem/lpc18xx_eeprom.c b/drivers/nvmem/lpc18xx_eeprom.c index 6c7e2c424a4e..b1af966206a6 100644 --- a/drivers/nvmem/lpc18xx_eeprom.c +++ b/drivers/nvmem/lpc18xx_eeprom.c @@ -159,7 +159,6 @@ static struct nvmem_config lpc18xx_nvmem_config = { .word_size = 4, .reg_read = lpc18xx_eeprom_read, .reg_write = lpc18xx_eeprom_gather_write, - .owner = THIS_MODULE, }; static int lpc18xx_eeprom_probe(struct platform_device *pdev) diff --git a/drivers/nvmem/lpc18xx_otp.c b/drivers/nvmem/lpc18xx_otp.c index be8d07403ffc..95268db155e9 100644 --- a/drivers/nvmem/lpc18xx_otp.c +++ b/drivers/nvmem/lpc18xx_otp.c @@ -64,7 +64,6 @@ static struct nvmem_config lpc18xx_otp_nvmem_config = { .read_only = true, .word_size = LPC18XX_OTP_WORD_SIZE, .stride = LPC18XX_OTP_WORD_SIZE, - .owner = THIS_MODULE, .reg_read = lpc18xx_otp_read, }; diff --git a/drivers/nvmem/meson-efuse.c b/drivers/nvmem/meson-efuse.c index 70bfc9839bb2..dbedfcea4e05 100644 --- a/drivers/nvmem/meson-efuse.c +++ b/drivers/nvmem/meson-efuse.c @@ -37,7 +37,6 @@ static int meson_efuse_read(void *context, unsigned int offset, static struct nvmem_config econfig = { .name = "meson-efuse", - .owner = THIS_MODULE, .stride = 1, .word_size = 1, .read_only = true, diff --git a/drivers/nvmem/mtk-efuse.c b/drivers/nvmem/mtk-efuse.c index c4058b598703..9ee3479cfc7b 100644 --- a/drivers/nvmem/mtk-efuse.c +++ b/drivers/nvmem/mtk-efuse.c @@ -72,7 +72,6 @@ static int mtk_efuse_probe(struct platform_device *pdev) econfig.size = resource_size(res); econfig.priv = priv; econfig.dev = dev; - econfig.owner = THIS_MODULE; nvmem = nvmem_register(&econfig); if (IS_ERR(nvmem)) return PTR_ERR(nvmem); diff --git a/drivers/nvmem/mxs-ocotp.c b/drivers/nvmem/mxs-ocotp.c index d26dd03cec80..7018e2ef5714 100644 --- a/drivers/nvmem/mxs-ocotp.c +++ b/drivers/nvmem/mxs-ocotp.c @@ -118,7 +118,6 @@ static struct nvmem_config ocotp_config = { .name = "mxs-ocotp", .stride = 16, .word_size = 4, - .owner = THIS_MODULE, .reg_read = mxs_ocotp_read, }; diff --git a/drivers/nvmem/qfprom.c b/drivers/nvmem/qfprom.c index b96730e99580..cb3b48b47d64 100644 --- a/drivers/nvmem/qfprom.c +++ b/drivers/nvmem/qfprom.c @@ -56,7 +56,6 @@ static int qfprom_remove(struct platform_device *pdev) static struct nvmem_config econfig = { .name = "qfprom", - .owner = THIS_MODULE, .stride = 1, .word_size = 1, .reg_read = qfprom_reg_read, diff --git a/drivers/nvmem/rockchip-efuse.c b/drivers/nvmem/rockchip-efuse.c index 63e3eb55f3ac..e292bbe6bb68 100644 --- a/drivers/nvmem/rockchip-efuse.c +++ b/drivers/nvmem/rockchip-efuse.c @@ -149,7 +149,6 @@ static int rockchip_rk3399_efuse_read(void *context, unsigned int offset, static struct nvmem_config econfig = { .name = "rockchip-efuse", - .owner = THIS_MODULE, .stride = 1, .word_size = 1, .read_only = true, diff --git a/drivers/nvmem/sunxi_sid.c b/drivers/nvmem/sunxi_sid.c index 0d6648be93b8..1c3b5cf89212 100644 --- a/drivers/nvmem/sunxi_sid.c +++ b/drivers/nvmem/sunxi_sid.c @@ -40,7 +40,6 @@ static struct nvmem_config econfig = { .read_only = true, .stride = 4, .word_size = 1, - .owner = THIS_MODULE, }; struct sunxi_sid_cfg { diff --git a/drivers/nvmem/vf610-ocotp.c b/drivers/nvmem/vf610-ocotp.c index 72e4faabce29..5ae9e002f195 100644 --- a/drivers/nvmem/vf610-ocotp.c +++ b/drivers/nvmem/vf610-ocotp.c @@ -206,7 +206,6 @@ static int vf610_ocotp_read(void *context, unsigned int offset, static struct nvmem_config ocotp_config = { .name = "ocotp", - .owner = THIS_MODULE, .stride = 4, .word_size = 4, .reg_read = vf610_ocotp_read,