From patchwork Fri Sep 14 14:39:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10600867 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A026314BD for ; Fri, 14 Sep 2018 14:46:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 80D692B897 for ; Fri, 14 Sep 2018 14:46:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 749432B89C; Fri, 14 Sep 2018 14:46: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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE 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 F063E2B897 for ; Fri, 14 Sep 2018 14:46:00 +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=QIHig6eAn3C7zWzy65C+r95ky0rJNy2GSO7hEMK7NCc=; b=EthYpRvqB1F6IUARAFoMbP+an0 OI72w5QalUYk5FhvA0QQOr7/y8o5MAUPa0yQCaNUjWaILDb++iW9FFqeBcZUJUCMlvLiWGdKyfysH ZBtU8sZV8zL920G09aE2/I8zV/qZdnXuS5Jgsv/UAjBDTPuuo9Mgzqjp0GUaXf5+qfAqEgSwZkpXf cHlmR487PRfT+MhT9Y8DaMuEnt8zfLHaOF9ShPN5LG/HmlfrmFrFTYTc3834sCxZrMe88imFxYZk5 1t52iG9Irnt1Wr+ymyteH+P/XVyiP+ZIOzIEu63IpeMybpeWzMBfgcTLuFBt642OXbAOu0uks1lcc Uvb5oLrQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0pM4-0005EC-Mw; Fri, 14 Sep 2018 14:45:56 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g0pGw-0000s2-5L for linux-arm-kernel@lists.infradead.org; Fri, 14 Sep 2018 14:40:41 +0000 Received: by mail-wr1-x442.google.com with SMTP id e1-v6so10901500wrt.3 for ; Fri, 14 Sep 2018 07:40:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=M9taBHuR1Z2o6Tp/6FUEDxrf8r9YUt6RGonYwMvTT5A=; b=ZV8OEDNLDzAqKYFT/h1fmNr0LGgc6hSRMKH8jwYkb7++Fs28jhjP94E6Z/qM2Zy+xf ZY+PbDG+gl4pECeSwdZ4u0IqwX6ZPTCn8RveRw5f5LyNV/wIk5EzJj3GODsSGFvESZrd T6YmQ1F2Yerk5/mPuhTtILw9vZSUSDLt+qBJh6zKFzxKjWcF4BHgoPiSgi1PpixweveU QayhwBH3VH6Elvm8sQkWhsB26OCqbTwO0HquS2DBwnWre6NJn3VPbbtEm3FqJKF12I3s KnhRtKqIr62H8VU/H/a2jPmMywAMRuTkF5JC0g2fcLdcGOQnam6td3eVHnm3YHFmd0my hQeA== 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=M9taBHuR1Z2o6Tp/6FUEDxrf8r9YUt6RGonYwMvTT5A=; b=EkpvGo/OgDU3kCsYDpQQjxDp8bbVRwEmpTNtI7ou96uU3ogTjdUgIIZHdif5ccJ935 YnzksXlXFnI8vSl9rbdY/IvIG2CCsCOCw3+q0AP9fStea26tLWrTx3QdBUCsoUfU8bvu s2Mbt/i0p/yT4JtICbY6cCfapW4r+5UdXFfAzRgbj8a2sibYvxUI484qGa/1fI8EHl9d mU4GRn2hqOELsYAbaKuWp/Sa0nAQVkzGU968RX5bQRXwkpHw75GG9OLNFQWWUIUsrIlA cfWi7anW60ygMt64fNGRqafpXBjHZlTm55FZ1kQR4F4U/fB1iaQbjgtEIbtKIZgvmaCu xt0w== X-Gm-Message-State: APzg51BMqVR0R89p4fgnaHmDulMit0+phXQFT/yVWd5X45YSuqFBhmLO PJbUqk1iFbLwQ56nNroxnw8VfDSHsoI= X-Google-Smtp-Source: ANB0VdYInIfM4MafDSF34HNDSpOlPYMYbsOmD+6s3esuwAMxaa9I90iHesl+qaV43/rVItBKNcBDMQ== X-Received: by 2002:a5d:4648:: with SMTP id j8-v6mr9722923wrs.52.1536936034233; Fri, 14 Sep 2018 07:40:34 -0700 (PDT) Received: from brgl-bgdev.home ([2a01:cb1d:af:5b00:e837:b8d5:48c1:571b]) by smtp.gmail.com with ESMTPSA id v46-v6sm10313526wrc.63.2018.09.14.07.40.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Sep 2018 07:40:33 -0700 (PDT) From: Bartosz Golaszewski To: Srinivas Kandagatla , "David S . Miller" , Mauro Carvalho Chehab , Greg Kroah-Hartman , Andrew Morton , Arnd Bergmann , Jonathan Corbet , Sekhar Nori , Kevin Hilman , David Lechner , Boris Brezillon , Andrew Lunn , Alban Bedel , Maxime Ripard , Chen-Yu Tsai Subject: [PATCH v4 08/22] nvmem: sunxi_sid: use devm_nvmem_register() Date: Fri, 14 Sep 2018 16:39:57 +0200 Message-Id: <20180914144011.27614-9-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180914144011.27614-1-brgl@bgdev.pl> References: <20180914144011.27614-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180914_074038_216407_77DB7F59 X-CRM114-Status: GOOD ( 15.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bartosz Golaszewski , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Bartosz Golaszewski Use the resource managed variant of nvmem_register(). Signed-off-by: Bartosz Golaszewski --- drivers/nvmem/sunxi_sid.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/drivers/nvmem/sunxi_sid.c b/drivers/nvmem/sunxi_sid.c index 4d0b7e72aa2e..1310f8af37f8 100644 --- a/drivers/nvmem/sunxi_sid.c +++ b/drivers/nvmem/sunxi_sid.c @@ -181,15 +181,13 @@ static int sunxi_sid_probe(struct platform_device *pdev) else econfig.reg_read = sunxi_sid_read; econfig.priv = sid; - nvmem = nvmem_register(&econfig); + nvmem = devm_nvmem_register(dev, &econfig); if (IS_ERR(nvmem)) return PTR_ERR(nvmem); randomness = kzalloc(size, GFP_KERNEL); - if (!randomness) { - ret = -ENOMEM; - goto err_unreg_nvmem; - } + if (!randomness) + return -ENOMEM; for (i = 0; i < size; i++) econfig.reg_read(sid, i, &randomness[i], 1); @@ -200,17 +198,6 @@ static int sunxi_sid_probe(struct platform_device *pdev) platform_set_drvdata(pdev, nvmem); return 0; - -err_unreg_nvmem: - nvmem_unregister(nvmem); - return ret; -} - -static int sunxi_sid_remove(struct platform_device *pdev) -{ - struct nvmem_device *nvmem = platform_get_drvdata(pdev); - - return nvmem_unregister(nvmem); } static const struct sunxi_sid_cfg sun4i_a10_cfg = { @@ -243,7 +230,6 @@ MODULE_DEVICE_TABLE(of, sunxi_sid_of_match); static struct platform_driver sunxi_sid_driver = { .probe = sunxi_sid_probe, - .remove = sunxi_sid_remove, .driver = { .name = "eeprom-sunxi-sid", .of_match_table = sunxi_sid_of_match,