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: 10271219 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CBF486016D for ; Fri, 9 Mar 2018 16:44:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF3E629B85 for ; Fri, 9 Mar 2018 16:44:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD9EB29E5B; Fri, 9 Mar 2018 16:44:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2878329EA7 for ; Fri, 9 Mar 2018 16:44:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=hE04MGQlcH1hJZitoxb6p3/jSJShpq62UHtGL3WrX60=; b=rbXaWBMpfYqpAXtg/TVGs6V4v4 q1B9liACyLiYDyzphJmasZ2EuGFT8dilu6A8ShTNpexBcfJvfdENRtk9PzTpkzgkUHKJ4IJwAAXiV PQpvT2df2Csmpsrpe13XJsAHZBgrdlPppf8uCZ4pXZAUmpFBj8zhu0x8mBCSIhcEVaMEy66ytaafk q5snaipozSi1azXhXXQ9rF5HPmZ//1SBpc3gL/WEQ39wZPXt1Ng4Xe2wNiLOzIyduxJSwu9mylHMn 815yAFk6+F6QibjNWXl9zhm9MuuuL5f/5zXmI5QKpoAKGVIVp3E6ksTKqSggRsCJ/mH6F1gUUSbOH C7QDCvUQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1euL7k-0000O3-8a; Fri, 09 Mar 2018 16:44:04 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1euL67-0007Q8-HA for linux-amlogic@bombadil.infradead.org; Fri, 09 Mar 2018 16:42:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/mYmlEklSxmgWb3ph/DuGZ98vAdv2XK271WMG5BcyN8=; b=Atn6VDHNneBZtntGZNi1rXcFT dbuJA3JQPng/5c9y4cxdLB0RlD18SRgFHVsLDHBiGcnG6ZEL701fWzwxThsgmFNAlXp5UbnvyybG/ zjStkpVjF57lrqUeZixgog9Pb5EUu/RTxrxxtgQbPv9SewQ+ymknZ7p3MAckBy77z+l8ddPPoy4U6 pgr/Bzxh6Bjx5/1SSLt2HzBYfucURn3GRmfJxujrhMmsNkVBOACKkRJxwloyb2JCG1+/w27LqrJ6z u2K6aSRAIWSSFNGciPjXVKEQu9eSxS5xH4KMxr/Pi2zO0fa4vFzb3/PaxIPHte6mDgGXhZ3MBStoL h8katvi5w==; Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by merlin.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1euJMB-0005xj-Hf for linux-amlogic@lists.infradead.org; Fri, 09 Mar 2018 14:50:54 +0000 Received: by mail-wm0-x244.google.com with SMTP id z9so4346373wmb.3 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=/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=f3iGt/s5EpOtFp9o+5DZtQ3rqrC9hmQ18yG/pyv80UwVQg4Lk+WT3wzvux3+aVuN7e EdpIPw6YwXUSdjpXkFT6Ns6l2B2huc1WlLhNj0Ivg56OYxUFOdGtOeMVgsG0dRaLorlz I5M8rE7dF1OieYjLdD+c6m/F6vI3EkhN8fwAnRNogyR6f3l07FoQ8zTw3d7DmlzjMbpN jW2MttLytR5H1dFlJ1EOp+4dF48+THBoVD4TbXeJQpZRtYoJeFp8tQQoMi3tpfQ+iFjT AZtCTBHNBM+pLbKifg+tW7CI6aAmdFyOLYB+4orpaZWTX4Fe9QJpTqRPo80L5oNAGCa2 XGcg== X-Gm-Message-State: AElRT7G79lMBfyoVdhhmsggQBOH4Dky/xQcNNPrjLTcnX5rRaRsx06Iy fmnPZOmKCjAqmNxhEuClIBSpiQ== X-Google-Smtp-Source: AG47ELtCVNRjMy7ThCecHPaVdNtm2cTA3STwkRoTP90VCRS/TCMBczIWbJfGUVudCYmAwakPMjtVqw== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180309_095051_819725_FD533F89 X-CRM114-Status: GOOD ( 14.87 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , linux-rockchip@lists.infradead.org, Andrey Smirnov , Kevin Hilman , linux-kernel@vger.kernel.org, Masahiro Yamada , srinivas.kandagatla@linaro.org, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, Carlo Caione , linux-mediatek@lists.infradead.org, cphealy@gmail.com, Matthias Brugger MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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,