From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx.socionext.com (mx.socionext.com [202.248.49.38]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0C474364EAD for ; Wed, 4 Mar 2026 08:32:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.248.49.38 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772613169; cv=none; b=WB5QIUGNThvWTZ7jHYRkzPg+lpO2K8V3NDHuRJ4LhYE03Hp6nHjUt+4XwaGFTrxiozSDT9vcCcO21YDlV/QT1GKZ6CwY92GFukIx0tZEr1+577XJ905yQltgJs96VZh/2bjBce0FVBLOQoh+PzH5r8exfJjdIH0HOIfyq9wjnEc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772613169; c=relaxed/simple; bh=ygZwtjw2/L7BOXCUMBQXaMx+bSb0n1I8zK8F8ckNtfk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jkZ7IblvMp5icVu4pgsebteAfmU5rD0FnBrfED0eE62oODr0ITyfdxuSeGb7iaf2hfMpk7nnc6zyeLPsmE+AB4ANOdpU1LVM6LQOzvfIPCpQWWeE03/TwKQ8biJmCe/LnOZz5B71GXO9LBSRyhvVvHfMdkhD7Ktv3Xj+7hjhY2Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=socionext.com; spf=pass smtp.mailfrom=socionext.com; arc=none smtp.client-ip=202.248.49.38 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=socionext.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=socionext.com Received: from unknown (HELO kinkan3-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 04 Mar 2026 17:31:37 +0900 Received: from mail.mfilter.local (mail-arc02.css.socionext.com [10.213.46.40]) by kinkan3-ex.css.socionext.com (Postfix) with ESMTP id B44312069FEA; Wed, 4 Mar 2026 17:31:37 +0900 (JST) Received: from iyokan3.css.socionext.com ([172.31.9.53]) by m-FILTER with ESMTP; Wed, 4 Mar 2026 17:31:37 +0900 Received: from [10.212.247.202] (unknown [10.212.247.202]) by iyokan3.css.socionext.com (Postfix) with ESMTP id 67D1810A016; Wed, 4 Mar 2026 17:31:37 +0900 (JST) Message-ID: <32838929-e5ed-4796-845b-ce45712a440b@socionext.com> Date: Wed, 4 Mar 2026 17:31:36 +0900 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] phy: uniphier-usb3: no devm for nvmem_cell_get To: Rosen Penev Cc: linux-phy@lists.infradead.org, Vinod Koul , Neil Armstrong , Masami Hiramatsu , "moderated list:ARM/UNIPHIER ARCHITECTURE" , open list References: <20260304041602.7539-1-rosenp@gmail.com> Content-Language: en-US From: Kunihiko Hayashi In-Reply-To: <20260304041602.7539-1-rosenp@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Rosen, On 2026/03/04 13:16, Rosen Penev wrote: > There is absolutely no reason to extend the lifetime of nvmem_cell_get > to after removal of the driver. Use and free right after use. > > Signed-off-by: Rosen Penev > --- > drivers/phy/socionext/phy-uniphier-usb3hs.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/phy/socionext/phy-uniphier-usb3hs.c > b/drivers/phy/socionext/phy-uniphier-usb3hs.c > index 8c8673df0084..c8971eee3640 100644 > --- a/drivers/phy/socionext/phy-uniphier-usb3hs.c > +++ b/drivers/phy/socionext/phy-uniphier-usb3hs.c > @@ -104,11 +104,12 @@ static int uniphier_u3hsphy_get_nvparam(struct > uniphier_u3hsphy_priv *priv, > struct nvmem_cell *cell; > u8 *buf; > > - cell = devm_nvmem_cell_get(priv->dev, name); > + cell = nvmem_cell_get(priv->dev, name); > if (IS_ERR(cell)) > return PTR_ERR(cell); > > buf = nvmem_cell_read(cell, NULL); > + nvmem_cell_put(cell); > if (IS_ERR(buf)) > return PTR_ERR(buf); > Looks good to me. This function is called multiple times and creates a cell each time, so it's probably better to delete it after using it. Reviewed-by: Kunihiko Hayashi Thank you, --- Best Regards Kunihiko Hayashi