Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp136880pxb; Wed, 3 Feb 2021 01:30:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQduLHvzUMwELi+5NYxNS3TGWH4VanhCVgHu57ad/doYnNzr39apRt1EH8TPC6KLkHKQFe X-Received: by 2002:a17:906:5ac8:: with SMTP id x8mr2288487ejs.347.1612344654912; Wed, 03 Feb 2021 01:30:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612344654; cv=none; d=google.com; s=arc-20160816; b=dC10eRAJxdjzJZC0PXC8aBN+RJyAHfg3qWlkJAiddbnsTEGi8Wuwa8VG3w2L5KlinO UDSUUYSf+S1igi2ZkMcF4EcxUSXHVGFd7+yw4noFWe/BuFxk5SlZoO6X3fEMbYV1Of+K aoa8O0apPLPGo5/V1Cwz/NYjh7XUwJq2JsQvyqwhEJ5iVRzv3i+CfJ7J5z2yYQWDjuAG qGCH2YGp6bgYxiLOa5G5GmiIlz9Af3SRcxdMVJQaYZcwb/K1QgfbyIU4QdLoHHDlpGaQ mOnFE4L3lVCuxyEet7ONoAEk4h7hI+gQUxpHZCHlkl7EQbNAz53TXQUat5o0xWvsjsZM Re3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=sHt2QMs2iyNmXAIFzzFYw0SpaaSQrxi7yo1olCL0ZJI=; b=W9ktTZ274SvyQ7VqHB6ZLOvYZWqnC8KCBqD+b4j+nspPumN1LiBZo9SETqN7+47TbM 7Bp3ko8daoN9OQJm3ob63nQZ169Z3xd+fYYf1Vh/sl1iR4iAuAWybB6z2zdhJgrVQuP3 Q19R8ce5bVyRv/oX5l/eNa4xZyjR4AwG3rWOcQyzUBGmlSe1WMcFndyuquO7vHOfFI8y DQ03XwcmYof2jLUbNvIxsqjmwla3ZY/IcqdivFtXwAivARmTyLQKsf+JWlKTI9QDZDcH JOBJyZPdtPitmhGl1L/L4FPIuQfskMPM0+URrbQWyiqKIS+geU9B9zai+pi9Tn/PrSgw bb8g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i24si952585ejy.153.2021.02.03.01.30.23; Wed, 03 Feb 2021 01:30:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233406AbhBCJ1u (ORCPT + 99 others); Wed, 3 Feb 2021 04:27:50 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:12408 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233448AbhBCJZ6 (ORCPT ); Wed, 3 Feb 2021 04:25:58 -0500 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4DVx8B0ZGszjHHh; Wed, 3 Feb 2021 17:24:10 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.498.0; Wed, 3 Feb 2021 17:25:09 +0800 From: Tian Tao To: , CC: , Subject: [PATCH] hwrng: optee -: Use device-managed registration API Date: Wed, 3 Feb 2021 17:24:48 +0800 Message-ID: <1612344288-12201-1-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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(-) 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