Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp232782pxb; Wed, 3 Feb 2021 04:19:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJykqmFuxLQXs5ra7akLEOCQVFNWY+EwtwB/MZqsrxQBbIat5lioSOduCiu0U7lvqxe0FxTY X-Received: by 2002:a17:906:1dc2:: with SMTP id v2mr3015972ejh.136.1612354793314; Wed, 03 Feb 2021 04:19:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612354793; cv=none; d=google.com; s=arc-20160816; b=Im/e/BxvaO6/oQQHno5QLDKA/JDyypqvu0dmgQdW3fvX9dwdpn64LfxgJY8pyJJV2s uupkwqZ5JhCUrZDQeAvKZnrcEV1MSIEy2vwgvp63/A5nQFLeqlri2Q70k3U/9d/v6yy+ rDlBEQGRYin6HkcApRYBrz3uewgv0DjNvvXAy0HYY75z4nmPbLah/e9vx1YGyAiirVFQ d3EeMbG5Ysy1UNfjkdKScTCjQUj/L2v+4AZaHDBgWJywehu/YXRyes2+sxrWYxCwpTjb xRITjyUm32f1loyKW2ddr5LVtPGu7v9uT/8VAYYrnJqf0NQMak7lxzXji6fNqaDoQvqo xXzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=MoPxYlztBMkUInx90I6MSDZW1GupbzFyQ7KEz/9vHUg=; b=BpwwDUV22S3UMrefK220gnjt16FvS5/LDJFYECOGajK9aSwP2EujEf/Mav3UYD442D ynUK6kuk/en1AhroSuw3wZKhbAmFRYBJYrJjsi9FQi2I3WXzpkXb83YJSeS+5ceGXEeX Zc49BVumfKXm3+XNg4hhA+Wtc2cWqK2ESfQo7X3u8oHfp6oA6yILs7tMQJokoENZMuOd Z//GniqBiXspwDZMiNeB9yW8lnwHLhBFwKn4DbesVNnZkMF5IBI9tm0wLEzjuOZNEIpw 1kW/Whmv+llaR4fRvv2/cJMjdVSk69UzJTuGMEOBAeB1hbM4YKdY4lztQKeux8WVCMEy qTpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XNt1A+FC; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id js10si1125383ejc.446.2021.02.03.04.19.08; Wed, 03 Feb 2021 04:19:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XNt1A+FC; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234118AbhBCMSv (ORCPT + 99 others); Wed, 3 Feb 2021 07:18:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234057AbhBCMSu (ORCPT ); Wed, 3 Feb 2021 07:18:50 -0500 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18A9AC061573 for ; Wed, 3 Feb 2021 04:18:10 -0800 (PST) Received: by mail-lf1-x12e.google.com with SMTP id i187so32977822lfd.4 for ; Wed, 03 Feb 2021 04:18:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=MoPxYlztBMkUInx90I6MSDZW1GupbzFyQ7KEz/9vHUg=; b=XNt1A+FCURD8+kUH7QpgVVZxQHARWLl28d6lDb4blMt7QUhf2OPwUQBXQkY4Uo5Xea R4RcX/XZjkB7+R1Lc5eQP+deZHaLQTaGUWMB+UAQG7CiDTgE9v9U+FFup9HQwnjegwR1 ghMyCs6E3iSd/t++E7kRbtlnsaZ6oXk6Fl7JEWxoEGAPpXP8Y+qHIGuUYRyepYvqDAIo 6cm7yJbnBJk1ScAMPmrbgMPjue646PgqqaRpnfVekgHpDDck941pIOGOqtGscFsL4UeB RUGAKWRRCpB6mwsx7Lhk9YWYr2pKFjLzt+eRv7Sr2UQeIcO/39oLAMWX1MSE2sCgyNzA lkkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=MoPxYlztBMkUInx90I6MSDZW1GupbzFyQ7KEz/9vHUg=; b=GQ5tD75Gl6Y6Ir5BBwVZgRmIgjEzalUjUdaIBRdaHZrW/642uYPoBEvumsTyickV9k gLMg/+IyHeBqOQ08Q5viBQ1PJi5tKm+oR52Z58kApetdwAq01xHSmwETMwdMZNG3b/Qk nmwT1jPSfvmuAU4rVmpXrW6uSyzjvGoWaBJpCOJ/i2WyBwles+EmQaqJ1uTe2XAIdYAH S2tHQe1XQ0mIx0TWzYaXygv3bRmB/H56e/TL3nU9yvqhrHo8YIHlvAppauW11oKDa+Uq upuzxPXfoyG2xr5RIvnIVrdkG2iTUD7km0vOrKocMHMj0EWDqcpgiyNpcftkJyUe5f8H VP8Q== X-Gm-Message-State: AOAM533Cz3vlmON3F7FZWSbkBQzNZLAtjUiEqsH7SRVjEQJ8lfyWQv1z a/VebsW9LUb18VHbCzTo7jgjqp7cQLNY9ROoHpp3TA== X-Received: by 2002:a19:4b:: with SMTP id 72mr1622873lfa.302.1612354688510; Wed, 03 Feb 2021 04:18:08 -0800 (PST) MIME-Version: 1.0 References: <1612344288-12201-1-git-send-email-tiantao6@hisilicon.com> In-Reply-To: <1612344288-12201-1-git-send-email-tiantao6@hisilicon.com> From: Sumit Garg Date: Wed, 3 Feb 2021 17:47:57 +0530 Message-ID: Subject: Re: [PATCH] hwrng: optee -: Use device-managed registration API To: Tian Tao Cc: Herbert Xu , op-tee@lists.trustedfirmware.org, "open list:HARDWARE RANDOM NUMBER GENERATOR CORE" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Wed, 3 Feb 2021 at 14:55, Tian Tao wrote: > > Use devm_hwrng_register to get rid of manual unregistration. > > Signed-off-by: Tian Tao > --- > drivers/char/hw_random/optee-rng.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > Fix up subject line as s/hwrng: optee -:/hwrng: optee:/ With that fixed you can add: Reviewed-by: Sumit Garg -Sumit > diff --git a/drivers/char/hw_random/optee-rng.c b/drivers/char/hw_random/optee-rng.c > index a99d829..135a825 100644 > --- a/drivers/char/hw_random/optee-rng.c > +++ b/drivers/char/hw_random/optee-rng.c > @@ -243,7 +243,7 @@ static int optee_rng_probe(struct device *dev) > if (err) > goto out_sess; > > - err = hwrng_register(&pvt_data.optee_rng); > + err = devm_hwrng_register(dev, &pvt_data.optee_rng); > if (err) { > dev_err(dev, "hwrng registration failed (%d)\n", err); > goto out_sess; > @@ -263,7 +263,6 @@ static int optee_rng_probe(struct device *dev) > > static int optee_rng_remove(struct device *dev) > { > - hwrng_unregister(&pvt_data.optee_rng); > tee_client_close_session(pvt_data.ctx, pvt_data.session_id); > tee_client_close_context(pvt_data.ctx); > > -- > 2.7.4 >