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: 10270903 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 BC0B560594 for ; Fri, 9 Mar 2018 15:08:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AEF2D287D4 for ; Fri, 9 Mar 2018 15:08:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A37D529E4D; Fri, 9 Mar 2018 15:08:45 +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 18444287D4 for ; Fri, 9 Mar 2018 15:08:45 +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=hKRhYq49LJFHJaCG5yFWNcrpfeZBXj5zE8ll04x1Ky0=; b=qcmS2jxoHO4KL6Js96SzG38oym LxecYuqtf1G/qyIOmq+ghkggEmhG22rJPAHZH9nHZNGQ4d/fvkClBkGLqE5GgcZ7QrmYHcmG2jPtX EBn7Uwvmok+IfRBxQkfhz0VjPffcQc7q3B0iMmuLQxEwKD4cRq9/rz6RXyqAY8EEFyEZ5BnYXx+wr LMVL8B8Cznz5P5s+kRVsJtM8Lv+6CqOc4EhHQ/oWPkyBiHNyzQckHnThtFjNcPfrpN0xQR00+DkKu 1X4ITmchjkYEJs6WxZrpCaDaL+AZdHE6F7Dmh5Bhufx+dFh73kBjYzjrfjK485e23zlDdnAXp99QN 4NXIaB2g==; 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 1euJdR-0003gT-OC; Fri, 09 Mar 2018 15:08:41 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1euJbU-00027T-Cw for linux-amlogic@bombadil.infradead.org; Fri, 09 Mar 2018 15:06:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=iwbfmImi6BY1sK40ria0J88daj3+9B9MGMgTb34A6WE=; b=DI0ROgalv8HlNsOS/Icrmajvk wjxg1K0LckWVpk38h8vagKggbWbZydOqgph8IhbNnFbaxhsb3+6GvKRBBWl+QeZr7hbonul/HKCt1 /J0JBOIGZgwj20NCCrvkaBtAkolmPb18kj6M++Q9KC7AXzBcuqvvFyhDdqGxy+i5Hkf8Fe0bqSJ74 Dm7t97k1AWHSw29778JsnEIIMVQXhrhKg5nXUKk5pZKiF05KsID18Oc8Kf+0EtnttEJyYRjN448zE oYs5kqsqAn0ikHpSoBcrdfbTJCIPhPvZd5z1ALpRIZUYS96dDXEZT/8TU9rg61IDnERiavvImkcqw ZEsfRk7mQ==; Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1euJM4-0005Yd-UR for linux-amlogic@lists.infradead.org; Fri, 09 Mar 2018 14:50:54 +0000 Received: by mail-wr0-x241.google.com with SMTP id o76so9266383wrb.7 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=AzFJGym8oR/klhn01Qrq20xMY+3E1i9iZVmGFm1Yhgr1YcGwRglm5s1T/fZ44jGzeZ Ayrawor4MMkuyxDz9/RgOYUHddfFYiXYRv3H7IyiaKXMJFpDSU0XgAE71PUn5iN1SPXS V5DsmLrzbFkzALQlpaSFUiVZaC2/6pY5uQkaTomnV+2h9c/QaFaJHMVvaNv89v3SMVRf /L8R83xOd/hbgPVDa+U9fl/5q6Tprk34r/VYNWAh150UGEBbZp4XROaj8LyC/tb+hp9B i9zEUBr31Rz4dBUZt3OGtc6C2G6sowrhOfBoTKm5figh3TvJmOtIuGKlb/6+/rhJVdRl /z/g== X-Gm-Message-State: APf1xPCojSKQF/iWV/qJEE5eSSmJKfaAWDdLir9/BBG+NTY5zYfa+zP2 01Q6vCjnqywQiTU700VWD70UVA== X-Google-Smtp-Source: AG47ELvlbtk/szyqsVr9WP1vXWNclBPPWKh+hpCsnIioJiu8gfXw8jQ1mcPYnZnNbqtdAD4B4B1txQ== 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180309_145044_987652_22A9F41C X-CRM114-Status: GOOD ( 15.18 ) 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/snvs_lpgpr.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) 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,