From patchwork Wed Dec 27 22:59:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Smirnov X-Patchwork-Id: 10134181 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 2252D60318 for ; Wed, 27 Dec 2017 23:03:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 154AC2CA80 for ; Wed, 27 Dec 2017 23:03:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A3B52D479; Wed, 27 Dec 2017 23:03:34 +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=unavailable 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 BFDBC2CA80 for ; Wed, 27 Dec 2017 23:03:33 +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=oKSdlcOTMbv11v0vNaG2Klr0Xoe//RHlRkUG34lhy/I=; b=S4TYD7QTDaTv85S08ljvzuwsl4 THk1+agl5XXZU42/y0RAAE+uM5AUhrsCWjJfyEa0mCMZq3oE2NAJvJBEcPk+xcb7q9WvAQ0oum5J+ ff2BhOe5RYgh8MplKnIAOb9FF0+tv9vcxIJ9aoaZM/EKFwjSi5SCf7FvJOuWadjLfJ3BspeLPoU6F J5S84h6X6FH2BpWyRICxCTcKTm0hf4udHgpoVHvV2lIZQ6heUGB02Tp4OcKzAjkSpx2mdQepjRQaf QRUPptQFspvr07jxRmjg1oj4bUQ+vs4CpYB+PGcuPMD3q4nSEtmWn4olYu/MlSMmx7Vq/rqVQnvlx tqmIRV0w==; 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 1eUKjM-0006Ge-Mx; Wed, 27 Dec 2017 23:03:24 +0000 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1eUKgW-0004RW-1C; Wed, 27 Dec 2017 23:00:42 +0000 Received: by mail-pf0-x241.google.com with SMTP id y89so20293194pfk.0; Wed, 27 Dec 2017 15:00:17 -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=eJGJgGnXyQF9zJRiN7Ish5TGpV154ISHRNHaKL0edwo=; b=XXGhoQjW0dbGJ3HTLSO7SOV80lJzDBSQngy6DiGMnhDi1Rsd0AVeF9N6UdbcyN2yXZ uv9CT8e+bL4wwgqH9O6yDNv0XmN8D9mPwgWovoZhXIVDVQeLml3ED6pMIqx2x3NA454D jx/54WzCPfWblHL/4neoIsdocCwfi5/eQ2XCK7JbLYxngcYf1oLoY94UhArfDaovTR29 QX+cMy7MKlAveh0l9KcTkswe56OKbQyOzF9S1+q5+6ftdxlFhFQhMxVIMEjDkC5QOlx4 TbjnZ78/Rsma3ojQR9ixq8pfgEQsSHVdPGXUupj59Q6VSdZ3C5sl/UgVrMkS/bpdPpag EMUQ== 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=eJGJgGnXyQF9zJRiN7Ish5TGpV154ISHRNHaKL0edwo=; b=KruF9DcYRrsPdK978RW1Ui7XFGx94zAm/SQhkBmfPFFwnRzY4dOIXaFhEpIHD2IkXu dyDsBZ84Eq1DTSV4MORqGk2j7INVQpFo6cuFewVRudopDA2k4aFEfFva4nJ5elSRzIFW opBMfxOBiTa76noS9dyMf55xGR3OD4gXCzdkHVIdCnL/YO7O+HSLIDFIzgpOcuwpjZUI TjplvMX94oznqLdSqMVVgkZEwyyd7KLKLIzkD9+xpvZJ8xMkibC3JuBTZu917Ru6Fesf G2eA8nApgnW9KK4mnOx1EGHTcyr4RWzK5dUoMxaV5WGHy7Hyxl0R9y4xxfYucqi2jM8h aplQ== X-Gm-Message-State: AKGB3mKUYrN75a0tCROEw7xD3WdbEmC4G3k3TOslM+1FW7P7ADv/srY6 ejHP7yJBwQXEao758OrQ4dk= X-Google-Smtp-Source: ACJfBouM1mZpHm2RSTPEW8DB36lqYRKEFHcnEEYRxerpOzxd1UCcA7fGz3iCytSsM1n1BpE4uvZRNw== X-Received: by 10.101.73.203 with SMTP id t11mr6565439pgs.18.1514415615984; Wed, 27 Dec 2017 15:00:15 -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.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Dec 2017 15:00:15 -0800 (PST) From: Andrey Smirnov To: Srinivas Kandagatla Subject: [PATCH 03/20] nvmem: vf610-ocotp: Convert to use devm_nvmem_register() Date: Wed, 27 Dec 2017 14:59:39 -0800 Message-Id: <20171227225956.14442-4-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_150028_461397_F920AD7D X-CRM114-Status: UNSURE ( 9.98 ) X-CRM114-Notice: Please train this message. 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 , 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-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=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/vf610-ocotp.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/nvmem/vf610-ocotp.c b/drivers/nvmem/vf610-ocotp.c index 5ae9e002f195..752a0983e7fb 100644 --- a/drivers/nvmem/vf610-ocotp.c +++ b/drivers/nvmem/vf610-ocotp.c @@ -217,13 +217,6 @@ static const struct of_device_id ocotp_of_match[] = { }; MODULE_DEVICE_TABLE(of, ocotp_of_match); -static int vf610_ocotp_remove(struct platform_device *pdev) -{ - struct vf610_ocotp *ocotp_dev = platform_get_drvdata(pdev); - - return nvmem_unregister(ocotp_dev->nvmem); -} - static int vf610_ocotp_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; @@ -251,13 +244,11 @@ static int vf610_ocotp_probe(struct platform_device *pdev) ocotp_config.priv = ocotp_dev; ocotp_config.dev = dev; - ocotp_dev->nvmem = nvmem_register(&ocotp_config); + ocotp_dev->nvmem = devm_nvmem_register(dev, &ocotp_config); if (IS_ERR(ocotp_dev->nvmem)) return PTR_ERR(ocotp_dev->nvmem); ocotp_dev->dev = dev; - platform_set_drvdata(pdev, ocotp_dev); - ocotp_dev->timing = vf610_ocotp_calculate_timing(ocotp_dev); return 0; @@ -265,7 +256,6 @@ static int vf610_ocotp_probe(struct platform_device *pdev) static struct platform_driver vf610_ocotp_driver = { .probe = vf610_ocotp_probe, - .remove = vf610_ocotp_remove, .driver = { .name = "vf610-ocotp", .of_match_table = ocotp_of_match,