Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751576AbeACUBh (ORCPT + 1 other); Wed, 3 Jan 2018 15:01:37 -0500 Received: from mail-pl0-f66.google.com ([209.85.160.66]:44143 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751470AbeACUBf (ORCPT ); Wed, 3 Jan 2018 15:01:35 -0500 X-Google-Smtp-Source: ACJfBou9L5Ic08MQ+5qNF31/cDFONzkrOhB0ma/ah9g86bUl1YFDmRgxpzWV/v6qizJDcpfEnCsiaA== From: Andrey Smirnov To: Srinivas Kandagatla Cc: Andrey Smirnov , Heiko Stuebner , Masahiro Yamada , Carlo Caione , Kevin Hilman , Matthias Brugger , cphealy@gmail.com, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 13/22] nvmem: lpc18xx_otp: Convert to use devm_nvmem_register() Date: Wed, 3 Jan 2018 12:01:05 -0800 Message-Id: <20180103200114.23922-14-andrew.smirnov@gmail.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180103200114.23922-1-andrew.smirnov@gmail.com> References: <20180103200114.23922-1-andrew.smirnov@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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 --- drivers/nvmem/lpc18xx_otp.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/nvmem/lpc18xx_otp.c b/drivers/nvmem/lpc18xx_otp.c index 95268db155e9..74777bfe2dcd 100644 --- a/drivers/nvmem/lpc18xx_otp.c +++ b/drivers/nvmem/lpc18xx_otp.c @@ -86,22 +86,13 @@ static int lpc18xx_otp_probe(struct platform_device *pdev) lpc18xx_otp_nvmem_config.dev = &pdev->dev; lpc18xx_otp_nvmem_config.priv = otp; - nvmem = nvmem_register(&lpc18xx_otp_nvmem_config); + nvmem = devm_nvmem_register(&pdev->dev, &lpc18xx_otp_nvmem_config); if (IS_ERR(nvmem)) return PTR_ERR(nvmem); - platform_set_drvdata(pdev, nvmem); - return 0; } -static int lpc18xx_otp_remove(struct platform_device *pdev) -{ - struct nvmem_device *nvmem = platform_get_drvdata(pdev); - - return nvmem_unregister(nvmem); -} - static const struct of_device_id lpc18xx_otp_dt_ids[] = { { .compatible = "nxp,lpc1850-otp" }, { }, @@ -110,7 +101,6 @@ MODULE_DEVICE_TABLE(of, lpc18xx_otp_dt_ids); static struct platform_driver lpc18xx_otp_driver = { .probe = lpc18xx_otp_probe, - .remove = lpc18xx_otp_remove, .driver = { .name = "lpc18xx_otp", .of_match_table = lpc18xx_otp_dt_ids, -- 2.14.3