From patchwork Fri Mar 9 14:47:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 10271259 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 1521560236 for ; Fri, 9 Mar 2018 16:47:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BC71289A3 for ; Fri, 9 Mar 2018 16:47:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 003F82888F; Fri, 9 Mar 2018 16:47:57 +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=unavailable 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 0E8F528907 for ; Fri, 9 Mar 2018 16:47:57 +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=MJUs1F0ERfaIoNBPEVihN5VdoZvvVUHklc4KfPg6udA=; b=SzqpTpFDZ1Cb9hkzf8fD+8Aqlx qCWCng/iXcmTtxYMu5D3rzdu2bHH4RxRZpTTwbJ4keXCNse3/o6lC9kneaf/W7mTh9OjYwA6qNguD 3ljtty3e3yMoazl3k4xlfWEeZE34OcLgFm58LMAR/VoJmHA21fa/GMNaBIl8/IhgxCDwRaMoizfx7 s2ZBb/opy3iCQ5THftvQh+p+RKfzNjrkSjbcna6kGVZh+7EgFnwqQBjcDk0zJ9BtTq/ayGnT4e7GL RRqnN2fbwH6MFE7Uvd8tTjI87SJyN6hxL2DGlo6V9kjEW0161cFYcYtEyAttPxHvLLov802TS2HgU 02P1ce0A==; 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 1euLBR-0003wi-GK; Fri, 09 Mar 2018 16:47:53 +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 1euL6R-0007Q8-4V for linux-amlogic@bombadil.infradead.org; Fri, 09 Mar 2018 16:42:43 +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=HNnsiLc9yf+W4lfxSi/47y81SkTcPUabpKQPBMCemyA=; b=oYgTYGo5BXboY+ovqgXn+sLCh Z2NtncbXNx7GNu5P/0VaYQsHbXv6t9ck5AND9geo2iQrczA4N1mM7p8PIGBWLomc2GVrQhStcMQPb fhEaZwo8lE4+CFJofBLLc1kX/bjHXLuWLVv7WdHhHpButogks2c38eFbOs3gp0wi95MfUaL6a6RCk EPT0RHShJt0ahYNCE3QYoJ5Z+F1LaSumCJFL2Ikq9gcwq2HqzCfU1qLKOTrUmLxJkQIPuNAYP0DFX 3NyqPGlpLeUO8KI8/A3tG4rwfo8OD3MiWIOweucXx1ANQ8nPbeDrvRg+akTfnbg98XAbeV7VmWhxf nWvWOcohw==; Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]) by merlin.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1euJM8-0005xt-5H for linux-amlogic@lists.infradead.org; Fri, 09 Mar 2018 14:50:50 +0000 Received: by mail-wr0-x243.google.com with SMTP id n7so9273361wrn.5 for ; Fri, 09 Mar 2018 06:50:44 -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=HNnsiLc9yf+W4lfxSi/47y81SkTcPUabpKQPBMCemyA=; b=F6DzIFCxcgjbfIyveTNjmhM+DK5vvmN1PiBLXl6c8gVI4HiO6pseaVXgXCN5STn4je QUGkG6d17uLBANgK139xyXyhUkdB1DHYjocHyj1L+TujdNu18ND+p+FYvL7AqR+cr/+M AT7Eb2dkQ7qX/OM3LnDlS15j/kMrvT7lp6PS8= 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=HNnsiLc9yf+W4lfxSi/47y81SkTcPUabpKQPBMCemyA=; b=QRKeOFVLcM52COWHJ7tuFVjBQSLNc14nrKwVFBmAhbu1Aa0jD875y5hjRPxqVH6fak CKaX289WBz1dMm71DVkEWFzN5Nv8knwCyy47oFMdA6ya3F8PW4KG5trmF1xcXAqHq2q8 HyTPhDeajhxM3GOr2L8IDCRCjoa012LiN6FAcZo4/B7DSD4AT8DUaVpqNqZIvnfMOuqx WMNRjM23CiBf1UAMdLxSACs/r2Fac7jMLnh9SgxkjkPDEhRgUA4wy7Egl4byoSgZ9EC5 FIPhtFQKX+qxCyQtLby3AdFI9Rgfqp2YpdAfoW114sjbTwVq1FVHRqYKxNlyRXrdQ0gL EUkg== X-Gm-Message-State: APf1xPAh8hZz/Qgb/3gEhlaOLiG4mjNWlY63XBb/dAkC4jSfEAWZe9LO 7LD9H/ZdvgEv4r9d8OSjEhrOug== X-Google-Smtp-Source: AG47ELtuIESYIgAX5LWoyoYbj2UHrLn2/fJjnTyLjgbY3+H/9c3cnX1mya1h6OWVqHuaFkfNv7NYcg== X-Received: by 10.223.184.124 with SMTP id u57mr26113324wrf.100.1520607043163; Fri, 09 Mar 2018 06:50:43 -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.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 09 Mar 2018 06:50:42 -0800 (PST) From: srinivas.kandagatla@linaro.org To: gregkh@linuxfoundation.org Subject: [PATCH 15/25] nvmem: qfprom: Convert to use devm_nvmem_register() Date: Fri, 9 Mar 2018 14:47:09 +0000 Message-Id: <20180309144719.29904-16-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_095048_268182_BCE1AB3E X-CRM114-Status: GOOD ( 15.79 ) 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/qfprom.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/nvmem/qfprom.c b/drivers/nvmem/qfprom.c index cb3b48b47d64..4f650baad983 100644 --- a/drivers/nvmem/qfprom.c +++ b/drivers/nvmem/qfprom.c @@ -47,13 +47,6 @@ static int qfprom_reg_write(void *context, return 0; } -static int qfprom_remove(struct platform_device *pdev) -{ - struct nvmem_device *nvmem = platform_get_drvdata(pdev); - - return nvmem_unregister(nvmem); -} - static struct nvmem_config econfig = { .name = "qfprom", .stride = 1, @@ -82,13 +75,9 @@ static int qfprom_probe(struct platform_device *pdev) econfig.dev = dev; econfig.priv = priv; - nvmem = nvmem_register(&econfig); - if (IS_ERR(nvmem)) - return PTR_ERR(nvmem); - - platform_set_drvdata(pdev, nvmem); + nvmem = devm_nvmem_register(dev, &econfig); - return 0; + return PTR_ERR_OR_ZERO(nvmem); } static const struct of_device_id qfprom_of_match[] = { @@ -99,7 +88,6 @@ MODULE_DEVICE_TABLE(of, qfprom_of_match); static struct platform_driver qfprom_driver = { .probe = qfprom_probe, - .remove = qfprom_remove, .driver = { .name = "qcom,qfprom", .of_match_table = qfprom_of_match,