From patchwork Wed Dec 27 22:59:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 10134221 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 E91576020A for ; Wed, 27 Dec 2017 23:06:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB8D12C62F for ; Wed, 27 Dec 2017 23:06:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D03262CF51; Wed, 27 Dec 2017 23:06:01 +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=-4.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 7AF692C62F for ; Wed, 27 Dec 2017 23:06:01 +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=emGDf6CEV9UowfdWvhQjm6E1yJmA9+13ZGHihTlXNhc=; b=Q4QZ3Jn/TVKk1fnILwqv9splmv r536sDko7z4PcdkP1A0S+LhttJlVZMC/U0coCfwexJPp3wDL3FuqfdCigXN4NmV26NzM26eSKWXAf 9S8pwHRQ5H0u+34EhwS5gn/RVi2uKGwjQ+Y8GvNXRbjTKr75rtUgdOaJn04TCaa539e+O0nEiZ8dG HfpSTlljZHmFBmqnm+hGDJOK3owo3cVjxTDFnB6gU0csuE0pVzY/i7uCkyGsEI0G6120/uCd0Gxbx EQejw+LSdSxLwHOvgwSMwb+wUTwtMlVv7zHSC+VUCqhBzPRz3KH9TgN3yTqUXIFITxloKhijwlzug Y+JrethA==; 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 1eUKlp-0008J5-Nq; Wed, 27 Dec 2017 23:05:57 +0000 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eUKgg-0004UX-9W; Wed, 27 Dec 2017 23:00:56 +0000 Received: by mail-pg0-x243.google.com with SMTP id f12so19244620pgo.5; Wed, 27 Dec 2017 15:00:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=GTRYA+7TW/uwZw5+QXbGx405UQxwpGOIBegzgeynago=; b=j33dkz+LJGKRl1aZF7Gyzgu/MNParR3KbFsXgHJgI04k0/UqTNA3vVLj9ve8C5w+ul zX4L+RwwCxHFFWl5wlhl/WsKFWH9QBpZoxxfY4YsVr4dIWS80Cp7xrmJC9Xm1WJMp94J xUA1wbFxWk4XB1LRlRB9bBxHvQeB3l1s+CDUiiFCpssnnB+nwi7Kgd8NohlLZwzvf5rC NdxsAO8bvXtN3w1BPgiKSU4qkAGMmBaCxdBLSKZnqnQj4COS6CYKfeO1T9n67MgbYPRK Rtrc2tMVYduEF1rpTofkFAjobL+aRYErO0+jh4xjl1f+p4RSCGvvuAAoiYUVd4I1ZMGv O9cQ== 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=GTRYA+7TW/uwZw5+QXbGx405UQxwpGOIBegzgeynago=; b=IqU2haiM2xLKKF8JOXvR68mhwQhK/j8dqU4XYp0ni+HF+xEZo7u1wPD3te2xOL739Q WzpreS0HfNRjHyp+lFg2ykvLKMBma2xlSAtYDk+mjMZGtFqUA/1n9yruZ0druBZVXAtF U+PAqq4Bf+TYVQPTZIXwWyYbVDHQriojZOJUkyOpWMNno4uRNS4U2mY1K3jqTe27s7nF K1XPcFVB2d/4l+dmsn3yHQv6HsuZ/xtqYDOrFAu1Q9/UTuWBJbpUNNzwTk9gV9Pl41ys K4lBQE2o2gfZqvZyv3aCB+H1pparthAeSKaiwfewgMiLp0nsjasUaryoP1wYOtjACnak lhVQ== X-Gm-Message-State: AKGB3mLjMjsIIDm7iEhLnIJ06TAfiMZditc5P6fm7e9dhZfIt5adk490 zFaY9RkM2qcAd7N5LzWuUT42PtAqVsU= X-Google-Smtp-Source: ACJfBouW2gmvxUmdJgw6ZrDCf8mJrvBi9Jc6V706P+CBJJfCw6ETlPDCVJWrA4SCC+DQGYO0FMtEHQ== X-Received: by 10.98.86.193 with SMTP id h62mr29758813pfj.109.1514415626742; Wed, 27 Dec 2017 15:00:26 -0800 (PST) Received: from squirtle.lan (c-24-22-235-96.hsd1.wa.comcast.net. [24.22.235.96]) by smtp.gmail.com with ESMTPSA id l19sm27810326pgc.57.2017.12.27.15.00.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Dec 2017 15:00:25 -0800 (PST) From: Andrey Smirnov To: Srinivas Kandagatla Subject: [PATCH 09/20] nvmem: mtk-efuse: Convert to use devm_nvmem_register() Date: Wed, 27 Dec 2017 14:59:45 -0800 Message-Id: <20171227225956.14442-10-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171227225956.14442-1-andrew.smirnov@gmail.com> References: <20171227225956.14442-1-andrew.smirnov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171227_150039_104391_46730D6B X-CRM114-Status: UNSURE ( 9.85 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , linux-rockchip@lists.infradead.org, Andrey Smirnov , Kevin Hilman , Joachim Eastwood , linux-kernel@vger.kernel.org, Masahiro Yamada , linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Matthias Brugger , linux-amlogic@lists.infradead.org, Carlo Caione , cphealy@gmail.com MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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: Joachim Eastwood 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 --- drivers/nvmem/mtk-efuse.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/nvmem/mtk-efuse.c b/drivers/nvmem/mtk-efuse.c index 9ee3479cfc7b..97ab7e6a4789 100644 --- a/drivers/nvmem/mtk-efuse.c +++ b/drivers/nvmem/mtk-efuse.c @@ -72,22 +72,13 @@ static int mtk_efuse_probe(struct platform_device *pdev) econfig.size = resource_size(res); econfig.priv = priv; econfig.dev = dev; - nvmem = nvmem_register(&econfig); + nvmem = devm_nvmem_register(dev, &econfig); if (IS_ERR(nvmem)) return PTR_ERR(nvmem); - 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); -} - static const struct of_device_id mtk_efuse_of_match[] = { { .compatible = "mediatek,mt8173-efuse",}, { .compatible = "mediatek,efuse",}, @@ -97,7 +88,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,