From patchwork Fri Sep 21 07:29:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 10609213 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 015C4157B for ; Fri, 21 Sep 2018 07:37:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E19B528E70 for ; Fri, 21 Sep 2018 07:37:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D59572DD1C; Fri, 21 Sep 2018 07:37:24 +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 7098228E70 for ; Fri, 21 Sep 2018 07:37:24 +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=XOo29xaV2mqeS/0AeiXk3ICiKW duB8RMCmMgby233L+N+z1Iqg22T26ipx0F5GokX5xJJLgZrI34JkYusjPCnrJd4J3JD0VkGtmlJpM X4QMoIw5Efc76QoUk7IielEGGgSXmGzoyn0oNz3yi1cDc4u9zYvi42OE1bkk6sX2MXlAIuTv8Eyb1 bAMm1OxDWf3IpoJsXGUIm/92ptPw6PaF7OeJ/JslEdUNCgdB/aZab6DFOp/T60Ra6GAeJUVJbXz4X UXNEskguPxntFfnYubpe10BEBNfN3g1Gw1uQwcWYRUb5BBlDT4bimvVTzvdLmx6oqYd83uEXZW0Ev Ulu1hhQA==; 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 1g3G00-0002sZ-Px; Fri, 21 Sep 2018 07:37:12 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g3Fsr-00068D-8E for linux-arm-kernel@lists.infradead.org; Fri, 21 Sep 2018 07:29:59 +0000 Received: by mail-wm1-x341.google.com with SMTP id y2-v6so1961139wma.1 for ; Fri, 21 Sep 2018 00:29:38 -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=oCugQ6gwXvRsc2UIC+RG8MmONx3NUkjg4a/p0bGHG9TO/wdlEITqtJcK9Hf2hTGR8T uCo+rUvHzCpgb2AMs3g158285BvcIYIQgMoY3XIN912fAmqyn5oCHFhakNwfnDeK9VRR x7LHqwzjGm07f/UKA4Gnm24/3d6iQ1gUfQaM0qKWTnEiLH8FcCXqicnl1o/znySoL2tx Z8orQBxVbK9Rr8AlwCRLpR+xB/dziBlIcW2aZgibwBihaO80z0IhmuWmI3bKdbWkPSZU qpLbHvyKpCh0PwAp/RGouihpu60UwmgcwIIBZi3zhzAjmbCgzGRM2KQMVONI5VR7TnIR gA2g== 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=pHl1HpzQU/4NAmWMiO8r23vX4ZFgsZbPVAvu7WfGGyhi7DvKtegxaHoPpQHp209NuH H73JV5ZrgXAKeB9rCGVlZxJYfGWVrKp5Ym/K8CkcAXcu7soEN3Q6Dq7ul4Mi7yIyXL0J R7Vg5Cb3FjMfOSfAqZ4ZxyCgwb9mjHZOOUGhV4tVusjos/18a8z2aXlTm0eBwjdzLFgo AbWORW14rrYaTCPWAFAbKaGrj4/jB8k+Y7VxX3pDGzII3UZ03uKvIVHvxDEgQ+1YE8j0 vmRgNmhp20fli7Enov/agYYsjJQ9Zv84X0sNyx+E1c85l3lcw7luS9JJIq4svoZ3KI64 zCGw== X-Gm-Message-State: APzg51CcLVa6OOXSTdiTRNv5vpPEZX9PCEtc5KI5jcmSBpZN8C4HUQep a2VloE47u1+z9rsuSA0WY0vLAA== X-Google-Smtp-Source: ANB0VdZcGTpFp6UI558LMYBQU6ptf92xWFRytC5PU27p0YcZqQ+G9hvBW1PA29Jub+7tlVOJKqSXEg== X-Received: by 2002:a1c:5f82:: with SMTP id t124-v6mr5955726wmb.14.1537514977318; Fri, 21 Sep 2018 00:29:37 -0700 (PDT) Received: from brgl-bgdev.home ([2a01:cb1d:af:5b00:e837:b8d5:48c1:571b]) by smtp.gmail.com with ESMTPSA id d18-v6sm2841597wmb.33.2018.09.21.00.29.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 21 Sep 2018 00:29:36 -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 v5 08/22] nvmem: sunxi_sid: use devm_nvmem_register() Date: Fri, 21 Sep 2018 09:29:07 +0200 Message-Id: <20180921072921.19387-9-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180921072921.19387-1-brgl@bgdev.pl> References: <20180921072921.19387-1-brgl@bgdev.pl> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180921_002949_346565_16D68BB7 X-CRM114-Status: GOOD ( 15.41 ) 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,