Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1749864imm; Fri, 7 Sep 2018 05:40:42 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYlfU2GrrlsCbBwIpm7u90qmXS/bK3YyS4J4w4GIX1rD+XXC6ZPcCek1Dg00jAuzA4yJ1gr X-Received: by 2002:a17:902:aa05:: with SMTP id be5-v6mr7700256plb.313.1536324041955; Fri, 07 Sep 2018 05:40:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536324041; cv=none; d=google.com; s=arc-20160816; b=ivJzQ976gU2T2iT7CvfxhhXzBUCfxD6H0sjDLhRf9GfzqzD7gAQv1Orlwtb0X8FQ5c D5GSLHDO0tDtRd8EsOC/H0Jyx/xb0bscOkP+xX66Ej6PQZmyFQu7wKrmlUrCZIu4U8ao 4QM7u55raWvFdH+W/s3HvcjOW2BtAF4+j2oQsz+N7v+n4CcacaN8eEY0re1KQaA8EyqX gdP88uuaUhyMulAyXd50KxNDlRK1nZFRwLOAoPUF2HRKctaUQ8d0qZzmugeg0tYLhMwC PIWWt4xtUZRmQ7yq3XZwrquk2HgogEwhuQzP5JADl+4ZBWXt32VYPS3ePFuXWjmc+KAx khhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=874CbkmyKCyBfTs9WgjHeXXK4p9vYZrCF79UGreNijg=; b=PKISlb0b2X7SlKakxbjWlj7hOxRFciou2nK7nUewCno9fcdkXyjGnAxXyDltyUt1N4 zcCkCpdn/qCFHEwhGrghpUs7zRZPPe4lVrGn7PIvBel6nm9iBTiebMsz0VF2/O5csTZa azJt+hXMw1xWeqJ6JUKF1RsXjKe9E8jVPE0poJPsJuktceWkPhyGqm5aZfpfN6ezQjiy UPYMJLxKBModWjzQf4meISJYrM6WdvBL2vbxsmFEuIBm8tPa9zRJ/YNnmSMs26a/p+Ju GV/LwhzgkI5y3rVojq/uS9Ul6S0v0wSW9bJs+pFvrlPcaCdFBYNfUSqGqbkE3tDDXxEx V74g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=JtGi0E8E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l23-v6si8227802pgo.230.2018.09.07.05.40.26; Fri, 07 Sep 2018 05:40:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=JtGi0E8E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728714AbeIGOsl (ORCPT + 99 others); Fri, 7 Sep 2018 10:48:41 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:38074 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728371AbeIGOsj (ORCPT ); Fri, 7 Sep 2018 10:48:39 -0400 Received: by mail-wm0-f67.google.com with SMTP id t25-v6so14025182wmi.3 for ; Fri, 07 Sep 2018 03:08:25 -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=874CbkmyKCyBfTs9WgjHeXXK4p9vYZrCF79UGreNijg=; b=JtGi0E8EtyYudsIFL9qZFkG0FIwpMOaj9jFQI1/hi3wcuWuUVInGn/oVbgZUnC7r+/ ESIx8/2m8bMPfnhf3wfWY4zmhcIytQZMz5Btk9LDDq+fi+OSPsUad73nwbz49USeA0LS b4W85gi6o39gPDZGyXE4lmPycrCUtA/umJTTCXGTUJHcgCmByZ5EcEkPG7j25eIDAwie glIN3eQtm369yj3+FrAucFWz2OF4dFF0q7AoTbnklQD9gT0NsR2cQihAaV9WjAAppBnw c3I7nUdHo/dkCeBh/5Bl8R/Iv/3NoMV+/QtvU/fQ4xWQdfyHmf7xvkMHknvLHgJTpywG dZ+w== 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=874CbkmyKCyBfTs9WgjHeXXK4p9vYZrCF79UGreNijg=; b=K62sx3T0s/wtrJ6+gtjpmU0I0tz9FmUZm7cwfOQ3T6UgCMyEnDtMV0vo4+KXV1HGkS MTYX7MRGf9JcXkeOp+eXQsH1RDoYKWdG3yWL+gbdorKyIkaHVUf2ODVbNaOMfjjpDHqV 7sg2IkO0Ziz5O9CbCeIyfH9CK8OKjTm0WL5a6Xg5tqhjLJ7OtyJfnJLHP7zIdzN/KdJL FyrXkPyDBoo8wA6Xw+6gnTKU0Si3QDs0k+pGAJmW4eMNi7wYXBLBG50y55MYAhCCCL8P 0+eu26O56QFibLDrLsfDeK0P1Gkv7unrvh3NtAEo9ZEd+6zgmcvIKTnxbQQP9tc7xbqc eujg== X-Gm-Message-State: APzg51BBtSH9d86qOFUeUkzt6vUy1eCIiW/KfRAQmKSkOibfowMP9W+a kS4sxwq10V/L3TVy+5Gw3YC0Wg== X-Received: by 2002:a1c:2108:: with SMTP id h8-v6mr4519638wmh.108.1536314905081; Fri, 07 Sep 2018 03:08:25 -0700 (PDT) Received: from brgl-bgdev.baylibre.local (AStLambert-681-1-83-232.w90-86.abo.wanadoo.fr. [90.86.25.232]) by smtp.gmail.com with ESMTPSA id 72-v6sm6631619wrb.48.2018.09.07.03.08.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Sep 2018 03:08:24 -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 Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Bartosz Golaszewski Subject: [PATCH v2 05/16] nvmem: sunxi_sid: use devm_nvmem_register() Date: Fri, 7 Sep 2018 12:07:39 +0200 Message-Id: <20180907100750.14564-6-brgl@bgdev.pl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180907100750.14564-1-brgl@bgdev.pl> References: <20180907100750.14564-1-brgl@bgdev.pl> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 d020f89248fd..0296c23db322 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 = -EINVAL; - goto err_unreg_nvmem; - } + if (!randomness) + return PTR_ERR(-EINVAL); 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, -- 2.18.0