Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1604983imm; Fri, 7 Sep 2018 03:11:52 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbObVbJkIz7Vc/WrpacjOwKJUFe1GNHV5ICrmCrsrV3hJIJPmC+gXVTiO4h9F2EEtU+Lrd4 X-Received: by 2002:a17:902:6684:: with SMTP id e4-v6mr7287766plk.50.1536315112623; Fri, 07 Sep 2018 03:11:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536315112; cv=none; d=google.com; s=arc-20160816; b=BHdCbv+DniSH+g9aG1Iz3TYzbTPRavySXOnwo1Mz3M0PDV+5jsYCsGBH4oZ5tJ0pCk XNoHynSNNuL9tiUE8VXFPlbkXQJ4tKmINBgZOHjBeyj98ddmNyf00JFAby3WYnI9PyC0 g1l7fMHu0f4+/eNxdmTojLire0a612PeSHhJ05UK9Ffmnu38WRAb5yJ7pxG6v13PisKz 33ZKi6Dx/077CFtJhL1colkfW7ZRfFWIYOQODGtJdhwaTxy+PI17twI4vpHxr0XoYORM gWNWSmUWDGfco+DHL8zPPGoBzCj9dmzAR045B8a1E4pq/TPERyRB1HqVYSruV2w/ELRu 3LDQ== 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=KfLprIfJuLGiikb3NQ4jaXuB3vUOmbbQ5NtX8GENxrY=; b=Rv/ACv/ze93rLmdB0McA+6lMGfb08xuGgRPthKI16YGxrwPubeZONCBwoCNoyr34lw r0KrMmMEsbTt8Wa4s1KrUgPB+e6PWVF/aqxZe+2oM+quXTSKGY648r2YPMHPoQU8Kluj ZWO5ciVcDieD4SOWr5dV0yoqYHmNA7CVDNDnGUTEcL3bPuvmzpONHyl8IWrt94hSflAj xgqAte2265yRmWoHpx6Ei1AsjauIlo5CWQ1dPZ1/96uquHWouXvLwBx+Gh+OZJzhJXgu /+ktxGOJZo2IAYfDQCMqmWqJul+34SRMQUfQ0gHAfjt6QtuTh1CFR6vT2fE7AY/eFpjA HQNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b=dO4KNvUq; 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 g87-v6si8202670pfg.225.2018.09.07.03.11.37; Fri, 07 Sep 2018 03:11:52 -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=dO4KNvUq; 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 S1728577AbeIGOsm (ORCPT + 99 others); Fri, 7 Sep 2018 10:48:42 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:44428 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728690AbeIGOsm (ORCPT ); Fri, 7 Sep 2018 10:48:42 -0400 Received: by mail-wr1-f67.google.com with SMTP id v16-v6so14343058wro.11 for ; Fri, 07 Sep 2018 03:08:28 -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=KfLprIfJuLGiikb3NQ4jaXuB3vUOmbbQ5NtX8GENxrY=; b=dO4KNvUqz2aIxCjLfjhvE77hHxkUffpT/Vay5uCjP+ZFbvi/dvLUPdKTf9UWESwTfZ 4/jbKTykpco+qBPXvr/0uGIwk4404XTFWhM5Y//VXplxG2QGA661QC8spnd/EhEFXu8E m7PbrqktMofdmCw7G2N7HSRpWoI9w37HUimtR5Cvxcml6TNmhL2H9rsSG6qhcA6Om+ra +lnHuhqohMvYegZS4UuZMFSF9BhxFwr0o3qWgNVZ+rS9jO4CktTxULJ03Wgb8NytupTI Xz8V/IrDju3TRKZ11YYikItkH/JnwGMcQ494vA7zeL5GrHOVno/HSuS1mUV6/hTsPG3d cw2g== 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=KfLprIfJuLGiikb3NQ4jaXuB3vUOmbbQ5NtX8GENxrY=; b=CLIrThb+2WNtJR/UratUBBMTb3G5x8plfrj1150AuaR1CfKfCBi/8z3O9tqClY7A6g FBFUm3dcQkXHu0KYUH6uQnBOgN6Ji101iPWlAiRkfOgGZwE0+nax+i5Z60I5+eHVG87k EYUCiU5uxFQyn52FpXcbv7/3TCD0+oyPoTC59iW0Hwcgo60v7PVaQuc2UYdenz4ASqiV yeB5sh9BADNVq+kQpRZKZjyYnrcf4eN8ZvktvOx0q70zL3NffS6dPo4jXhk9Oh44X54u lNYBpO3tYt2pyEjvAFBaPisR5Y269lB2Ec1bPajJlX8XcqlRUBPN9P6/MyO41Iyzhr3Q NcwA== X-Gm-Message-State: APzg51Dx38Y6wVA7d+b6/iNHb0QCDD+nQp3WVfDuFzhSL5Vx1wBC5jJy lfrax7AdOQnt1llZjap2ISXjjg== X-Received: by 2002:adf:c751:: with SMTP id b17-v6mr5739892wrh.134.1536314907593; Fri, 07 Sep 2018 03:08:27 -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.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Sep 2018 03:08:27 -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 07/16] nvmem: change the signature of nvmem_unregister() Date: Fri, 7 Sep 2018 12:07:41 +0200 Message-Id: <20180907100750.14564-8-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 This function can no longer fail and there are no more users that check it return value. Change it to return void. Signed-off-by: Bartosz Golaszewski --- drivers/nvmem/core.c | 8 ++------ include/linux/nvmem-provider.h | 9 +++------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 2335b72d4b3e..89b91f73d08a 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -450,20 +450,16 @@ static void nvmem_device_release(struct kref *kref) * nvmem_unregister() - Unregister previously registered nvmem device * * @nvmem: Pointer to previously registered nvmem device. - * - * Return: Will be an negative on error or a zero on success. */ -int nvmem_unregister(struct nvmem_device *nvmem) +void nvmem_unregister(struct nvmem_device *nvmem) { kref_put(&nvmem->refcnt, nvmem_device_release); - - return 0; } EXPORT_SYMBOL_GPL(nvmem_unregister); static void devm_nvmem_release(struct device *dev, void *res) { - WARN_ON(nvmem_unregister(*(struct nvmem_device **)res)); + nvmem_unregister(*(struct nvmem_device **)res); } /** diff --git a/include/linux/nvmem-provider.h b/include/linux/nvmem-provider.h index cc8556e3c825..d14a577a002d 100644 --- a/include/linux/nvmem-provider.h +++ b/include/linux/nvmem-provider.h @@ -67,7 +67,7 @@ struct nvmem_config { #if IS_ENABLED(CONFIG_NVMEM) struct nvmem_device *nvmem_register(const struct nvmem_config *cfg); -int nvmem_unregister(struct nvmem_device *nvmem); +void nvmem_unregister(struct nvmem_device *nvmem); struct nvmem_device *devm_nvmem_register(struct device *dev, const struct nvmem_config *cfg); @@ -81,10 +81,7 @@ static inline struct nvmem_device *nvmem_register(const struct nvmem_config *c) return ERR_PTR(-ENOSYS); } -static inline int nvmem_unregister(struct nvmem_device *nvmem) -{ - return -ENOSYS; -} +static inline void nvmem_unregister(struct nvmem_device *nvmem) {} static inline struct nvmem_device * devm_nvmem_register(struct device *dev, const struct nvmem_config *c) @@ -95,7 +92,7 @@ devm_nvmem_register(struct device *dev, const struct nvmem_config *c) static inline int devm_nvmem_unregister(struct device *dev, struct nvmem_device *nvmem) { - return nvmem_unregister(nvmem); + return ERR_PTR(-ENOSYS); } -- 2.18.0