Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp238814pxb; Wed, 3 Feb 2021 04:30:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJxYunqBvf4ohjFLmE1My58YMzkwxVs7yTK5BhPLMsHEvrpHFkulU4YslP7Qn44MCK1F1ChW X-Received: by 2002:a50:c88d:: with SMTP id d13mr2689655edh.206.1612355416619; Wed, 03 Feb 2021 04:30:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612355416; cv=none; d=google.com; s=arc-20160816; b=E0rbtj/EiBuVKWgHzMq9oYsd2uUJ8dKZ+HUl57KJRNL8u9cQI/13rXMUgMjXwOS0mz xqPnCAs6arZs9Un7sj8ZgWDHQpkyMEgtYk72e+PhzmPX+R3EMD+k1UO+neeF3gPesal+ pVxS+KKtLGKmEvEVquFmvr1bwtK+X69LCbkQpY72oqTRbxT1Agv3R4iWtr7HvxIdpkkM qJSc/eREs7O4UCUBFnsNtB3B603RsJRU96HalFRyOn7PWV30y1F3wDj/o5tvuYNCE5eL fscwUfS25opU5/P8QnVTENCh4ujzf2sJOVwYDONZnnroBiQMGX3lNWW/bjTUDoDOjNCx 7Xbg== 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=R6B6aEYptXpvo6UpXpjVmNgypWBRybQhX+fXxFhnFZA=; b=lgbSQS6VAJI/WJhNtozY+qVWssdq40H+Q/hSz453FZwMHuLzuQMRtT2P7uDHln8OvF LuO2yULX+xcLkW3lErIG05d++aukl+QneiQCkShxetGxciLAj4H0DXYUhcXOnQrJ8MzP XAz1xuNHq6pgocUwYQCgUuwFHVUtnkF+1mjrs5qN+f77NscsmsQCEExUhsSslzUfKRtb Ur+oWfzRW22e8+gHGuLpy/ccl/VbZL0cFNNBZvBGSqm8rBS6QPiHZoh08QY7Yngf+HBo pEDQqKwLRQoAAaenx7YDJeW9thjiRgv6sK4AIITN1+6m46Rg1zbqwRbuvJy5Vnn0EXuY dVog== 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 gz3si688343ejc.665.2021.02.03.04.29.47; Wed, 03 Feb 2021 04:30:16 -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 S234513AbhBCM1P (ORCPT + 99 others); Wed, 3 Feb 2021 07:27:15 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:12015 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234262AbhBCM1P (ORCPT ); Wed, 3 Feb 2021 07:27:15 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DW1953fffzjJKm; Wed, 3 Feb 2021 20:25:13 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.498.0; Wed, 3 Feb 2021 20:26:27 +0800 From: Tian Tao To: , CC: , Subject: [PATCH v2] hwrng: optee: Use device-managed registration API Date: Wed, 3 Feb 2021 20:26:06 +0800 Message-ID: <1612355166-11824-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 Reviewed-by: Sumit Garg --- v2:Fix up subject line as s/hwrng: optee -:/hwrng: optee:/ --- 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