From patchwork Fri Oct 20 16:57:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 116514 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1903809qgn; Fri, 20 Oct 2017 09:59:07 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Qze17A2MJfyClwKpqZwJnozL7QG9B9z+KPwylE9UkymVFfm2hZ7KxEBMY0awnlr89DNkz8 X-Received: by 10.98.53.1 with SMTP id c1mr5677641pfa.248.1508518747441; Fri, 20 Oct 2017 09:59:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508518747; cv=none; d=google.com; s=arc-20160816; b=iGsQ/CZdOqjaPhtpfxgdUyCeE/7dzBoDytBIB9HmekN//LO9Ru92kfeiv9s6dt0r3a l6v7l1EgLzcFrxdQ6qxJGqhhSZGbPtM9xA3FsAUkOOIh06aCtXLW2K0bTBXdBR8x+Viv 8WjgPwMHbiHd4Q34B1cowN5qScSeCskQb8gDjFtdtqo6O1GwvRutIfAQZ+q8FoRvvrSS +hMaqlKMhLQlg/ynEMKAWm1oqctwEO+fzPrR6s3EWZhcUfMpb26u8bCQaeDR0oy8us5R yuYKExHG7jTelhFxJ/Elsko5iBriUoOLejdtKtWOJ5Fohaux1ws2jpUO9qUWmdmHetq5 PKQA== 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:dkim-filter :arc-authentication-results; bh=ueNuoAFk4Pc4lNDsR86AXvbB/fri7i0Dzqywp3M7+6w=; b=pkbgUwevq8CvNm7i7jLdDVLGb/RJtg5JMMu0es28VWfDLmmH2womT3rVtp3vvjh2fy GxxRS8mw8J0C1sm8OLd2ACHNw9ETu6GZ8361k0NkyY0x3VwQZzzTvefn8zxXHn5OWPBv 76BSVnr9WIKLbEzINult5I4uidkEsHlXDOZvZH3OESoqOUs5SEc9cLM6XD0kCLo99RF+ 7IXteaaPBhJxB0a4TavbpqAiZUohViVonppJ4kynzs17+dYKfGt2ZVONDdb4peiEU6RA nM+x4lzGDr1z/pmq3ybSucu/JDHWwCqnTgbiIT/ljPOE5Er9kLAyNzVcX4+6ykjkTuBI m4vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=u1sHFIfF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d127si929819pgc.372.2017.10.20.09.59.07; Fri, 20 Oct 2017 09:59:07 -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=@nifty.com header.s=dec2015msa header.b=u1sHFIfF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753401AbdJTQ7G (ORCPT + 27 others); Fri, 20 Oct 2017 12:59:06 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:25126 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753226AbdJTQ64 (ORCPT ); Fri, 20 Oct 2017 12:58:56 -0400 Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-07.nifty.com with ESMTP id v9KGwC3Z005656; Sat, 21 Oct 2017 01:58:13 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com v9KGwC3Z005656 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1508518693; bh=ueNuoAFk4Pc4lNDsR86AXvbB/fri7i0Dzqywp3M7+6w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u1sHFIfFLM8e08EYitgocjlklyCmshAJJ5rWQFQ5bXgabhCz1loLkkaymhMGGlxfs NT0rLazWScR193G1cBJ3KkWvXN3ZOWi1uoREhki77deYrwHPuLTiXoatNx6LUyAzMt RB5xIIADnJfnqrW2Rsw4yp34F4DJ/2kv+DtlZVHs1GS/jTHuDCXJLv23nn3AwIpIIl CvBnvmF8t9R9EPTWDxPefGuO0PJ3MmHALek2GolYrBgiVbKpD3l5gjOohhbQoQuv+R Z2QOBBtuMl8mY2ldY4G6rjY7xuWvjuvSV4wUG92HJ5kcmbClibmq0WET36WK2Ji4sP 0ytrsxpD1L1IA== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: Srinivas Kandagatla , Masahiro Yamada Subject: [RESEND PATCH 1/5] nvmem: imx-iim: use stack for nvmem_config instead of malloc'ing it Date: Sat, 21 Oct 2017 01:57:38 +0900 Message-Id: <1508518662-8800-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508518662-8800-1-git-send-email-yamada.masahiro@socionext.com> References: <1508518662-8800-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org nvmem_register() copies all the members of nvmem_config to nvmem_device. So, nvmem_config is one-time use data during probing. There is no point to keep it until the driver detach. Using stack should be no problem because nvmem_config is pretty small. Signed-off-by: Masahiro Yamada Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/imx-iim.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) -- 2.7.4 diff --git a/drivers/nvmem/imx-iim.c b/drivers/nvmem/imx-iim.c index 52ff65e..a599260 100644 --- a/drivers/nvmem/imx-iim.c +++ b/drivers/nvmem/imx-iim.c @@ -34,7 +34,6 @@ struct imx_iim_drvdata { struct iim_priv { void __iomem *base; struct clk *clk; - struct nvmem_config nvmem; }; static int imx_iim_read(void *context, unsigned int offset, @@ -108,7 +107,7 @@ static int imx_iim_probe(struct platform_device *pdev) struct resource *res; struct iim_priv *iim; struct nvmem_device *nvmem; - struct nvmem_config *cfg; + struct nvmem_config cfg = {}; const struct imx_iim_drvdata *drvdata = NULL; iim = devm_kzalloc(dev, sizeof(*iim), GFP_KERNEL); @@ -130,19 +129,17 @@ static int imx_iim_probe(struct platform_device *pdev) if (IS_ERR(iim->clk)) return PTR_ERR(iim->clk); - cfg = &iim->nvmem; - - cfg->name = "imx-iim", - 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; - cfg->priv = iim; - - nvmem = nvmem_register(cfg); + cfg.name = "imx-iim", + 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; + cfg.priv = iim; + + nvmem = nvmem_register(&cfg); if (IS_ERR(nvmem)) return PTR_ERR(nvmem); From patchwork Fri Oct 20 16:57:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 116519 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1907790qgn; Fri, 20 Oct 2017 10:02:25 -0700 (PDT) X-Google-Smtp-Source: ABhQp+SekZOqzo6+W1MT5j5p8p+XfwyOhFha6JYKnDWZvyNr3rG5Fyfl019+JfxI7LpjMgzyG9Z/ X-Received: by 10.159.203.140 with SMTP id ay12mr4753942plb.143.1508518945085; Fri, 20 Oct 2017 10:02:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508518945; cv=none; d=google.com; s=arc-20160816; b=GToFi6HQHTNGvCq1tX4IHqdWv39Ql8+5Lez4Ec1xs/AOctUuZ3cuLn397uko/ogO7H j8JXcCZYp73cul0J+nx6tYGALMGuoeQwlzEIhVUOFxY0vKtJDdZkVHlPoR6Osy31PVub ZREu7miev/xfR/FrM2Ohu2TJUVGumEjTSShShIP099YljtPGYLPZeSUR0Boq8QFRPMjU sAaF6kr1j846Q5JvSI/Vtl4xxIrFQuDFneXM3J9rMlXVCVtI0h/gvWPoMyLJPvLzRgpk HC0v04pdrw+y403VxntrvMCTZjeev6SbwoyO4ctFTi5kASnxZdpXO0zwfvSVczKwaMnf nzIw== 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:dkim-filter :arc-authentication-results; bh=/6LPxfNB1Fz9oVolwWQBnNbnkyfC7E3dbGAEJl7KMnw=; b=ANc1qUYgWQwqj5OxOwHR9G7xdb2aBnLAUBd1ZZ+TQBb5fomNy03BcpstoJ7/PXZwT0 yGK249tb18xXZ38dW+oJVQ7Q5eVI5pnVSAoaJs1wExhNnzqH2IkL6piL2wu0QsO15B5z 7UVusIPhqRk7EFa62fnYf8+AnMtkkAcB3lj7NuMP2hQ7YdpTHgSTmayujD/DAeIOQ7JH w3uN6ZHkSgcWis1ijPo9YP7pv0X/lkcW7ppG6h54+DIlfnB9fj9+1ciFHO0fgxwf2kcS sOHcMECML86EJoTcxqTf8CQYzJVde8MhtNllF12O+Fu6zNAJrSSecdGXoayyIpk/DB0v W4ew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=r4Z/QvEy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o61si790217pld.490.2017.10.20.10.02.24; Fri, 20 Oct 2017 10:02:25 -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=@nifty.com header.s=dec2015msa header.b=r4Z/QvEy; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753306AbdJTQ66 (ORCPT + 27 others); Fri, 20 Oct 2017 12:58:58 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:25133 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753275AbdJTQ65 (ORCPT ); Fri, 20 Oct 2017 12:58:57 -0400 Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-07.nifty.com with ESMTP id v9KGwC3a005656; Sat, 21 Oct 2017 01:58:13 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com v9KGwC3a005656 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1508518694; bh=/6LPxfNB1Fz9oVolwWQBnNbnkyfC7E3dbGAEJl7KMnw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r4Z/QvEyEsm+1FgJtRqt7nKIxD5eyTTW5kpXqAdpU1Cvh/7WRBrVJxtgeZGGyqjXt 6SjNlWGUiHn+9tDoUV1I0qJzXOHAZwqaq9b/A/kJyq0ilf9Y0vZoRzWUUYrkB+gJao 5qDLWzbiv87IMt2fLkOvW/RL+TpPGHyv6wjN4BooAoCNVYeDufzlqk2Pi/nUEEK7Sr 89d9QaqMpJKc6Qni35QpaexUnJCnKvCJuByphDbTTZoxFQG0knUeU0WL5UCUkyjUP/ bSqW3nWwqw86Ehw/Su/0OdQ5JJ504yWepjAS/RAmKhxFJuVOJw6j/Mb5orWWAjs9cq BiBJfaRgGC5Mw== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: Srinivas Kandagatla , Masahiro Yamada Subject: [RESEND PATCH 2/5] nvmem: mtk-efuse: use stack for nvmem_config instead of malloc'ing it Date: Sat, 21 Oct 2017 01:57:39 +0900 Message-Id: <1508518662-8800-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508518662-8800-1-git-send-email-yamada.masahiro@socionext.com> References: <1508518662-8800-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org nvmem_register() copies all the members of nvmem_config to nvmem_device. So, nvmem_config is one-time use data during probing. There is no point to keep it until the driver detach. Using stack should be no problem because nvmem_config is pretty small. Signed-off-by: Masahiro Yamada Acked-by: Sean Wang Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/mtk-efuse.c | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) -- 2.7.4 diff --git a/drivers/nvmem/mtk-efuse.c b/drivers/nvmem/mtk-efuse.c index 32fd572..fa7a0f6 100644 --- a/drivers/nvmem/mtk-efuse.c +++ b/drivers/nvmem/mtk-efuse.c @@ -49,7 +49,7 @@ static int mtk_efuse_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct resource *res; struct nvmem_device *nvmem; - struct nvmem_config *econfig; + struct nvmem_config econfig = {}; void __iomem *base; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -57,19 +57,15 @@ static int mtk_efuse_probe(struct platform_device *pdev) if (IS_ERR(base)) return PTR_ERR(base); - econfig = devm_kzalloc(dev, sizeof(*econfig), GFP_KERNEL); - if (!econfig) - return -ENOMEM; - - econfig->stride = 4; - econfig->word_size = 4; - econfig->reg_read = mtk_reg_read; - econfig->reg_write = mtk_reg_write; - econfig->size = resource_size(res); - econfig->priv = base; - econfig->dev = dev; - econfig->owner = THIS_MODULE; - nvmem = nvmem_register(econfig); + econfig.stride = 4; + econfig.word_size = 4; + econfig.reg_read = mtk_reg_read; + econfig.reg_write = mtk_reg_write; + econfig.size = resource_size(res); + econfig.priv = base; + econfig.dev = dev; + econfig.owner = THIS_MODULE; + nvmem = nvmem_register(&econfig); if (IS_ERR(nvmem)) return PTR_ERR(nvmem); From patchwork Fri Oct 20 16:57:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 116518 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1907082qgn; Fri, 20 Oct 2017 10:01:52 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RVuyZoo5QZzC1EbuB3Mahk30Hxno7a4v1RtYKPH7WTcSL3KMMwnDyZBQfJUEJCaalBWUxc X-Received: by 10.98.201.207 with SMTP id l76mr5686825pfk.337.1508518912047; Fri, 20 Oct 2017 10:01:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508518912; cv=none; d=google.com; s=arc-20160816; b=OO/GJjh69L6yfORgQWctyfKb0qfmFMa7kFR/06sc7z+/0GpXXIcQsgDBZJSeBxpXEz hDsOphUmbqDc5nbvA7eEhUwPK1XItddH/TveDYitEsjRLgeTmwDfhqL5PMuXpDvtZ4g0 agoMLV1dgRsjXWswEY0I6JGRlrk+KExbdrC0C/mRk5Ck93mhgWjGVNV7BUwYSSDlbA37 etxIQAgCF6Q9c6R3WY5NP5g/9Rx3sT/HzFWRUxXrgyPPlrzvShrnBiFUYzY7nJ2eoHUJ ZEEgzTfeOD4lyU8qPMOfzia4uCDrjy4aq1AQK9nCx6VTWQ1iuWho8KVhTg+Wfdrdh4DW TTXw== 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:dkim-filter :arc-authentication-results; bh=jhMSTQcQn5KFwxHLvoabjZDmH0r3qvgKX2jnM5bQ/jk=; b=eR1pn+4FYbpJhFpAvpBb4Db8C3B2vFBAy0qZcu13+KVSkLxrCk5Uw2OdZahQOYoBMn 8admzrK1AFCWo6R2NAZP/3sdr4Vv6OT6TkFLhBqHyhDEuP60JQ1rnw0PbxS0xC9nEl2R bI+kCHlF2p4QiCGbSY8XjXC9oe49YRwEaqbvmZB2Nb7mPhj43vIMNWoU2KE9Bt+G1CGS Dn+f+orutpEon7WYC8Yl43wb+Wn8ilBvW3C0HgJUbFxKrcOwfSgBNJUsWeRFkYuOvrxP 3E6VA2vraK3y08GU8xmAO8ajAjt9KZ3MK9f5ToAec25YevJCO5poph2QVLeLUdu+jI/k eA1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Rdeo8nTR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b26si933712pgf.731.2017.10.20.10.01.51; Fri, 20 Oct 2017 10:01:52 -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=@nifty.com header.s=dec2015msa header.b=Rdeo8nTR; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753362AbdJTQ7D (ORCPT + 27 others); Fri, 20 Oct 2017 12:59:03 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:25127 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753254AbdJTQ65 (ORCPT ); Fri, 20 Oct 2017 12:58:57 -0400 Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-07.nifty.com with ESMTP id v9KGwC3b005656; Sat, 21 Oct 2017 01:58:14 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com v9KGwC3b005656 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1508518694; bh=jhMSTQcQn5KFwxHLvoabjZDmH0r3qvgKX2jnM5bQ/jk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rdeo8nTRmyeLZorLEnoTdYMmfVIXhMqRhbj2Qgy11bVBwdalgOWMR08uRY5uFXg7k 4SOGveBRpEWv7gfm1cCu1iTMIjPsg6LEOq+gHKVmf/YlB9HRt7bjCsoQ/Ew/ugvWx5 lUWDqM8EOV6O/W4UqJT0n+vG75HkpGhZP4WXFaMcjggxealp737ECRJTf/y1ewxJBH PaPVj6j9ElR1eQVj3du8L4UY8c+MjrQmenGEsKNJRJcjm6U3MU6rDCM2yh+feGnnHX 4krGUDz+zzgGEJsqCwC9nesKFyHVYAIeLRDbYrMZUIwq5/afepit8em4g3tRMqCN+a ZSaosVacpIElQ== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: Srinivas Kandagatla , Masahiro Yamada Subject: [RESEND PATCH 3/5] nvmem: mtk-efuse: fix different address space warnings of sparse Date: Sat, 21 Oct 2017 01:57:40 +0900 Message-Id: <1508518662-8800-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508518662-8800-1-git-send-email-yamada.masahiro@socionext.com> References: <1508518662-8800-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following sparse warnings: drivers/nvmem/mtk-efuse.c:24:30: warning: incorrect type in initializer (different address spaces) drivers/nvmem/mtk-efuse.c:24:30: expected void [noderef] *base drivers/nvmem/mtk-efuse.c:24:30: got void *context drivers/nvmem/mtk-efuse.c:37:30: warning: incorrect type in initializer (different address spaces) drivers/nvmem/mtk-efuse.c:37:30: expected void [noderef] *base drivers/nvmem/mtk-efuse.c:37:30: got void *context drivers/nvmem/mtk-efuse.c:69:23: warning: incorrect type in assignment (different address spaces) drivers/nvmem/mtk-efuse.c:69:23: expected void *priv drivers/nvmem/mtk-efuse.c:69:23: got void [noderef] *[assigned] base The type of nvmem_config->priv is (void *), so sparse complains about assignment of the base address with (void __iomem *) type. Even if we cast it out, sparse still warns: warning: cast removes address space of expression Of course, we can shut up the sparse by marking __force, but a more correct way is to put the base address into driver private data. Signed-off-by: Masahiro Yamada Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/mtk-efuse.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) -- 2.7.4 diff --git a/drivers/nvmem/mtk-efuse.c b/drivers/nvmem/mtk-efuse.c index fa7a0f6..c4058b5 100644 --- a/drivers/nvmem/mtk-efuse.c +++ b/drivers/nvmem/mtk-efuse.c @@ -18,15 +18,19 @@ #include #include +struct mtk_efuse_priv { + void __iomem *base; +}; + static int mtk_reg_read(void *context, unsigned int reg, void *_val, size_t bytes) { - void __iomem *base = context; + struct mtk_efuse_priv *priv = context; u32 *val = _val; int i = 0, words = bytes / 4; while (words--) - *val++ = readl(base + reg + (i++ * 4)); + *val++ = readl(priv->base + reg + (i++ * 4)); return 0; } @@ -34,12 +38,12 @@ static int mtk_reg_read(void *context, static int mtk_reg_write(void *context, unsigned int reg, void *_val, size_t bytes) { - void __iomem *base = context; + struct mtk_efuse_priv *priv = context; u32 *val = _val; int i = 0, words = bytes / 4; while (words--) - writel(*val++, base + reg + (i++ * 4)); + writel(*val++, priv->base + reg + (i++ * 4)); return 0; } @@ -50,19 +54,23 @@ static int mtk_efuse_probe(struct platform_device *pdev) struct resource *res; struct nvmem_device *nvmem; struct nvmem_config econfig = {}; - void __iomem *base; + struct mtk_efuse_priv *priv; + + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - base = devm_ioremap_resource(dev, res); - if (IS_ERR(base)) - return PTR_ERR(base); + priv->base = devm_ioremap_resource(dev, res); + if (IS_ERR(priv->base)) + return PTR_ERR(priv->base); econfig.stride = 4; econfig.word_size = 4; econfig.reg_read = mtk_reg_read; econfig.reg_write = mtk_reg_write; econfig.size = resource_size(res); - econfig.priv = base; + econfig.priv = priv; econfig.dev = dev; econfig.owner = THIS_MODULE; nvmem = nvmem_register(&econfig); From patchwork Fri Oct 20 16:57:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 116512 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1903716qgn; Fri, 20 Oct 2017 09:59:01 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Qo1ogcoqOauN8imkhlATnllGaumYJh2mVoYbxQ8drKOOdal6Z9nAeYgXI/zaw7PHYc1qRG X-Received: by 10.99.1.129 with SMTP id 123mr5202480pgb.320.1508518741814; Fri, 20 Oct 2017 09:59:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508518741; cv=none; d=google.com; s=arc-20160816; b=mM2euWEepKNP5RD5kZ3SgMyTJRdLIdOdpMpBy4TbmCGo2ccCofeYI6FTYoIE8i314E 6/eWJFWr6u4/q/h59Ixm1eJeQcX3TtqrnFZzC25dSv/jax5VwF4KXdlJAazXDbkTx/JC ignvCvjslqjMguiyxU/fZkyXjJ8b3wBc1P74NUskATYL7/r66Y3Q7aU6asYL3mtkMCp6 NpdO398cXkRzoFtBvDwfORvKP1sS+NqrVlP/vdyTDnB16bwQ4j1odF9I3cMfTJgCvJSI 8EzpZNqdmgza19BS5I4q5+0tLbbGEGFEbP3Q+fwLnWO43DwamLc6zHc1wSM6AyvWOQDq 8UmA== 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:dkim-filter :arc-authentication-results; bh=NYABBeKjsd2WSunJC+/c4cX+0FHLr6Uv81WH48gqBBQ=; b=xZGnzsedO9T6/qDH4NQFrNzmg/YCE21ZWNjoWBMdCszIBdtQICrqKK7Z1VRD8rYejs oNNVshTPoM2Jdp1QJGWjcr+k5vmoR77yhZjZvkenzoxt7n8pRkH4RVoYEOKfyfA0CKhK MHLBHMLKdJy0QQEGfsoTxdEip9KAwgh3h4fxMAZGdEHCQ54ombzXowsVsKZ2NjgV7eo4 KGy3wdFuBIyCRJXV4p4w96ijt/F/hpGDD3JjKRp4oepfaV1mZ5ZyjnSmGApM5Duf2Ufr /B8J3bhwwdnEK18VmPySHuoa9oz4tpE0XNzEQElmen4/rdv/8p6KFaEaN7q1nTcve2Bb a76g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=aNWKZ+Ox; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d127si929819pgc.372.2017.10.20.09.59.01; Fri, 20 Oct 2017 09:59:01 -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=@nifty.com header.s=dec2015msa header.b=aNWKZ+Ox; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753325AbdJTQ67 (ORCPT + 27 others); Fri, 20 Oct 2017 12:58:59 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:25128 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753264AbdJTQ65 (ORCPT ); Fri, 20 Oct 2017 12:58:57 -0400 Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-07.nifty.com with ESMTP id v9KGwC3c005656; Sat, 21 Oct 2017 01:58:14 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com v9KGwC3c005656 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1508518695; bh=NYABBeKjsd2WSunJC+/c4cX+0FHLr6Uv81WH48gqBBQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aNWKZ+OxLj+Y/fLm3DD8xViIK08Ovi7qtn8StQ3IxtovOhVhAW1xvoe+9Oz7ObOkg HhjR8UzHdQjQcbQ+AHmyd0o4SzWribV+xPIVGMz0Z4GeJpkFci2AVMMisfTCttzVnL cJOuAgYWwfssG5axZTMiEmIc8XYXhZId3tX6JsXvzFmYhl4z1h9qsB3RJlCFq0tfNG 3UDfzxxTAzkuEXKSuUu/TIgeZAeNm4gfEQxxjZ+tFIpmup4B76F2vkzIYePG32XNG0 dxrhGO7XEVTuntNLZLvByfpBCaDii0psM5GazmDcFvWeuVVBvF6uQ5OLviY0wZG3Sh IL0v9Rwo3O5QQ== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: Srinivas Kandagatla , Masahiro Yamada Subject: [RESEND PATCH 4/5] nvmem: qfprom: fix different address space warnings of sparse Date: Sat, 21 Oct 2017 01:57:41 +0900 Message-Id: <1508518662-8800-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508518662-8800-1-git-send-email-yamada.masahiro@socionext.com> References: <1508518662-8800-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following sparse warnings: drivers/nvmem/qfprom.c:23:30: warning: incorrect type in initializer (different address spaces) drivers/nvmem/qfprom.c:23:30: expected void [noderef] *base drivers/nvmem/qfprom.c:23:30: got void *context drivers/nvmem/qfprom.c:36:30: warning: incorrect type in initializer (different address spaces) drivers/nvmem/qfprom.c:36:30: expected void [noderef] *base drivers/nvmem/qfprom.c:36:30: got void *context drivers/nvmem/qfprom.c:76:22: warning: incorrect type in assignment (different address spaces) drivers/nvmem/qfprom.c:76:22: expected void *static [toplevel] [assigned] priv drivers/nvmem/qfprom.c:76:22: got void [noderef] *[assigned] base The type of nvmem_config->priv is (void *), so sparse complains about assignment of the base address with (void __iomem *) type. Even if we cast it out, sparse still warns: warning: cast removes address space of expression Of course, we can shut up the sparse by marking __force, but a more correct way is to put the base address into driver private data. Signed-off-by: Masahiro Yamada Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/qfprom.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) -- 2.7.4 diff --git a/drivers/nvmem/qfprom.c b/drivers/nvmem/qfprom.c index 2bdb6c3..b96730e 100644 --- a/drivers/nvmem/qfprom.c +++ b/drivers/nvmem/qfprom.c @@ -17,15 +17,19 @@ #include #include +struct qfprom_priv { + void __iomem *base; +}; + static int qfprom_reg_read(void *context, unsigned int reg, void *_val, size_t bytes) { - void __iomem *base = context; + struct qfprom_priv *priv = context; u8 *val = _val; int i = 0, words = bytes; while (words--) - *val++ = readb(base + reg + i++); + *val++ = readb(priv->base + reg + i++); return 0; } @@ -33,12 +37,12 @@ static int qfprom_reg_read(void *context, static int qfprom_reg_write(void *context, unsigned int reg, void *_val, size_t bytes) { - void __iomem *base = context; + struct qfprom_priv *priv = context; u8 *val = _val; int i = 0, words = bytes; while (words--) - writeb(*val++, base + reg + i++); + writeb(*val++, priv->base + reg + i++); return 0; } @@ -64,16 +68,20 @@ static int qfprom_probe(struct platform_device *pdev) struct device *dev = &pdev->dev; struct resource *res; struct nvmem_device *nvmem; - void __iomem *base; + struct qfprom_priv *priv; + + priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - base = devm_ioremap_resource(dev, res); - if (IS_ERR(base)) - return PTR_ERR(base); + priv->base = devm_ioremap_resource(dev, res); + if (IS_ERR(priv->base)) + return PTR_ERR(priv->base); econfig.size = resource_size(res); econfig.dev = dev; - econfig.priv = base; + econfig.priv = priv; nvmem = nvmem_register(&econfig); if (IS_ERR(nvmem)) From patchwork Fri Oct 20 16:57:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 116516 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1906867qgn; Fri, 20 Oct 2017 10:01:41 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TjbI0cl0rdZUNUa6upJHU1LPgNzoNlIxvcuM62eXQdgbB9vYFpVXgPG4x29idpVqoVAigO X-Received: by 10.159.229.136 with SMTP id az8mr4677899plb.59.1508518901149; Fri, 20 Oct 2017 10:01:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508518901; cv=none; d=google.com; s=arc-20160816; b=vg2adW/7Cn3ZukA8w4SCjK8sGCQpb1igQoq0J/sJQGPfDv1Uhw0bekWIjmziu41Ygb 9inZ7JR8AwiLldUOIdOX2zbqv9fBtCpDgngHqwhANvzVzWNGbjpiWn+etXp5Cdb636Hu xydhT2WUxl3quq7bUgAnG7OH1RMpgsHIv0tEYOIRarvjY3jwAUclzVTDzcfzZuhcgyie uZEDMwjK+PX30AYAJU96v7SOoI7lV1Lt9ZSdJj+bciy/IKkL/a6DoBytxaDEfPzuHFk5 Bvs9xvqPUf5T7tB3BKvLPr5SAMyymChUCp/BD/kRL6z6W4ZG63wvSPyyX1dPtqdCZ2od xcWw== 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:dkim-filter :arc-authentication-results; bh=4Wf+g+uwk+HpGkW1M6tWZXSoAsWEQoPEcf3PXrAsDJo=; b=orY1IKiuqlzVnvRBmuN0uWLOS+A7X5IGmGhL69RSZ6qMkwe12LXcrcZOkhMj6DgZcY /GrR9Vbcd1o2mCjomgPRuPfUG77AAkLjE2Ml1lNPzWKxxD1XKdMlr77bOLXBcETh8JDG PvfmW2cvncRQApOUFgDzboMUW+E0Q80E3s4ulB2tY69+TVYB9FU76WOSyynzzTLxLfYQ v35JL0EWAGbSyDQjv82hRkYGgNaqO8/OrGB9EDhXa/5/G3Mbkf+t7sxqbLUi1PCftSyE GtN8Fmik02ES3EwgJXcg3pQVXGthrZjYJcIIC3Rw0ppWwyQsS57BXAvOtojVSnL/FEdE ZQ4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Iex8rcsb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x10si795874plm.259.2017.10.20.10.01.40; Fri, 20 Oct 2017 10:01:41 -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=@nifty.com header.s=dec2015msa header.b=Iex8rcsb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753376AbdJTQ7E (ORCPT + 27 others); Fri, 20 Oct 2017 12:59:04 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:25129 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753252AbdJTQ64 (ORCPT ); Fri, 20 Oct 2017 12:58:56 -0400 Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-07.nifty.com with ESMTP id v9KGwC3d005656; Sat, 21 Oct 2017 01:58:15 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com v9KGwC3d005656 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1508518695; bh=4Wf+g+uwk+HpGkW1M6tWZXSoAsWEQoPEcf3PXrAsDJo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Iex8rcsbSAcuSMYhp54HGracJADDCD8sEoObdn/WjAZnHUlizJ9P9kqGRZ7BY6qs3 Gv2Nv1igVmpHteh1qn0MOULoKgbT2BfyWDSunEmy4QzRxbtsdvK5AsfqUJjGjJBXJT Udg3doVeWxEQ2G7xrln8X7aJU82IKVdB6lgo4OX2L6QewxdC3iwstuQ26hJibOHe1q CQ5HDkuZxtlXnUdUO9mQCnQ4P/fS+BcrfolqniS1JP8MJybEyHRHVtkO5sqYFs3HKi ouivksa51aXyiUdVsq7HOYAzSNvN2sVdUA4DAtkdEdlaLaud8DuMfMxFiniXpq4GHb EDQEFuqy3kiNA== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: Srinivas Kandagatla , Masahiro Yamada Subject: [RESEND PATCH 5/5] nvmem: set nvmem->owner to nvmem->dev->driver->owner if unset Date: Sat, 21 Oct 2017 01:57:42 +0900 Message-Id: <1508518662-8800-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1508518662-8800-1-git-send-email-yamada.masahiro@socionext.com> References: <1508518662-8800-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.7.4 diff --git a/drivers/nvmem/bcm-ocotp.c b/drivers/nvmem/bcm-ocotp.c index 3c56e3b..5e9e324 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 8649045..5a5cefd 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 a599260..52cfe91d 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 193ca8f..e57e2a5 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 6c7e2c4..b1af966 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 be8d074..95268db 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 1ea3cd2..a43c68f 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 c4058b5..9ee3479 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 d26dd03..7018e2e 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 b96730e..cb3b48b 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 eb4c530..123de77 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 0d6648b..1c3b5cf 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 72e4faa..5ae9e00 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,