From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43F1B3B8D5C for ; Mon, 23 Mar 2026 16:44:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774284259; cv=none; b=rCXKxcRPJ5SkK0eWQgDEMXbcc0jxf8OfYOjpd3j4JIhzb7R8R9Skv48xjOi/xVvzIDTIxaTehNr/5NsK+L7qzsaAdgeL/IQeCm3ujErEBxTmTZIuc28r7xi3Xm28Gf1MNpbhPxqhx39uEpb3H6FSUXsPTtnZYUmAfl8EpchhSnU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774284259; c=relaxed/simple; bh=9wwef48iYOnLtH4imZ57CWfWOnJX+jY9e/fXQG/zeHc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DwCn0+WCuUddIvZBNHJ1GUFMtCRvGokk0+7OleHzneFmCjFyxddw3P5R9KAjHryJuz045rjvueIA4LWas7GQY6eU/i0wOJq06kdkLym4lKCx9St6SIj7/d+/8h87cuAxo16RvuLkrYTwvQ0VRbuKScGl5xQ0H2OKg4WgyXH/BKg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=FLE3Whz5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="FLE3Whz5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7703C4CEF7; Mon, 23 Mar 2026 16:44:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774284258; bh=9wwef48iYOnLtH4imZ57CWfWOnJX+jY9e/fXQG/zeHc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FLE3Whz5N62hwWCQJ4Gdk/SAVoWGY6isoxCfiBRm+iGyX2ctPHgotLaLxYVUw9BE7 HYXrGoUvTpGFmOXwhPCv7pJIGXcoVbE3R8VaBdpsRKqdfpS5oxc/x0wjiwzZsHGjWC t52XhfY0FgyKSOza16f8VsMO3W6tBgrvj2hiFpbihKNndBLlf3PGF8hCQiijQUhlIr uUq0gf8Ot5h1MwmJUOCjRCdR07MSfu2jeq23NBXsfp3XIfGy69AeircP2FgaZ1DC+F +qc/MXS5/jI3kEq/1k7pCwX/dsJ39pNA5sJmprUH0Rc2DTixs9hb+/524fXpSfVwEO Zggyn31NepcDg== Received: from johan by xi.lan with local (Exim 4.98.2) (envelope-from ) id 1w4iO0-00000003eMP-30Eo; Mon, 23 Mar 2026 17:44:16 +0100 Date: Mon, 23 Mar 2026 17:44:16 +0100 From: Johan Hovold To: Bartosz Golaszewski Cc: Srinivas Kandagatla , Bartosz Golaszewski , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 5/7] nvmem: remove unneeded __nvmem_device_put() Message-ID: References: <20260223-nvmem-unbind-v2-0-0df33a933dca@oss.qualcomm.com> <20260223-nvmem-unbind-v2-5-0df33a933dca@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260223-nvmem-unbind-v2-5-0df33a933dca@oss.qualcomm.com> On Mon, Feb 23, 2026 at 11:57:06AM +0100, Bartosz Golaszewski wrote: > __nvmem_device_put() is wrapped by nvmem_device_put() but there's no > extra functionality offered by the latter so just fold one into the > other. > > Signed-off-by: Bartosz Golaszewski > --- > drivers/nvmem/core.c | 23 +++++++++-------------- > 1 file changed, 9 insertions(+), 14 deletions(-) > > diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c > index 42827ba2146ce9ba07716ac5973327da6e9426da..30aee8089f1dc65b1fa07dac8fb35e1dbbcd0ce7 100644 > --- a/drivers/nvmem/core.c > +++ b/drivers/nvmem/core.c > @@ -1134,13 +1134,6 @@ static struct nvmem_device *__nvmem_device_get(void *data, > return nvmem; > } > > -static void __nvmem_device_put(struct nvmem_device *nvmem) > -{ > - put_device(&nvmem->dev); > - module_put(nvmem->owner); > - kref_put(&nvmem->refcnt, nvmem_device_release); > -} Not sure this is a good idea since __nvmem_device_put() here matches __nvmem_device_get() just above (and we already have nvmem_device_get()). Keeping them together and as the inverse of each other should prevent things from getting out of sync. I'd just leave this as is for now. Johan