Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3061560pxb; Sat, 6 Feb 2021 18:41:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJzgdDhnI3TwAP8SOX9Pea1el3vgt6RM3oSfKwWpp92zrjdlGCrv1BfDCoamgpxsVVN/iFJq X-Received: by 2002:aa7:d513:: with SMTP id y19mr10820547edq.229.1612665661874; Sat, 06 Feb 2021 18:41:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612665661; cv=none; d=google.com; s=arc-20160816; b=efFSNK0oChqOhox10/HYjpPXGWew1O39QxdzppVlegjrrS1u5BCF2GG44D+8TflkW3 SDa4LkGS9qg7TMvriTjqS8cL9yyhm27zrNnkF7fVr9jyLQyFgKJGeNuz1j+/p/O6x1Jw yNucqOOq9mbhleC8u3dVaHQQLkDJIzlfMLzYsARTe6mvO4U3SrVK+6WHpcISz9xKfZef m8Rgk4ttqMuurvOKcUvwgBa4m8C6T+pVwUFus4HACGV0igrQeWW3yQsEboNRBSD5YFbp XPwmkWJpvMLUDJl4+VZfKthlpw7MXPMDSukzgeLNVSEnHssj8MQolpDVbpVliz5C8V8l IXng== 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=RH4N1/46W0X6PO+F8WkUfEwGxrcA6KFnk/s/mTs61gs=; b=V8kBvnCD//HtxaICqKAA5T6fIBP7Qx6Cu7pvplmYJ3SKdq1jc1R1ru1fc519qFf/2V Ig3S+C6jNsAnZFS0X2Cak0pMhpev35utuJvp2JCvlDQ4TXJpdtxMqLjbOu2NWiN471pv UNklsMw1WKmK2Tl5EqTjBaxdGCDKu7ofI5HQ3j8deOmRnTwtY6CFnE38e9T/JsiBqtTy edI8FRtXwj9C/4VNtkcu7Xfa6ijr8/CwwG1TcLg0gHDsocZ8R7S5u6eB2Agb+Co5O5h3 dkBXyJNVMjb4QNPAN5A/kwKA5Xtb5n+0P6w4Qzdnp9SWACVjodYUdTutzAosAY73wH+Z FADg== 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 v19si8161655eji.75.2021.02.06.18.40.24; Sat, 06 Feb 2021 18:41:01 -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 S229522AbhBGCkM (ORCPT + 99 others); Sat, 6 Feb 2021 21:40:12 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:12441 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbhBGCkM (ORCPT ); Sat, 6 Feb 2021 21:40:12 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4DYCy73XbczjGmF; Sun, 7 Feb 2021 10:38:23 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Sun, 7 Feb 2021 10:39:28 +0800 From: Tian Tao To: , CC: Subject: [PATCH] hw_random: timeriomem_rng: Use device-managed registration API Date: Sun, 7 Feb 2021 10:39:05 +0800 Message-ID: <1612665545-43612-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/timeriomem-rng.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/char/hw_random/timeriomem-rng.c b/drivers/char/hw_random/timeriomem-rng.c index e262445..9c237a0 100644 --- a/drivers/char/hw_random/timeriomem-rng.c +++ b/drivers/char/hw_random/timeriomem-rng.c @@ -169,7 +169,7 @@ static int timeriomem_rng_probe(struct platform_device *pdev) priv->present = 1; complete(&priv->completion); - err = hwrng_register(&priv->rng_ops); + err = devm_hwrng_register(&pdev->dev, &priv->rng_ops); if (err) { dev_err(&pdev->dev, "problem registering\n"); return err; @@ -185,7 +185,6 @@ static int timeriomem_rng_remove(struct platform_device *pdev) { struct timeriomem_rng_private *priv = platform_get_drvdata(pdev); - hwrng_unregister(&priv->rng_ops); hrtimer_cancel(&priv->timer); return 0; -- 2.7.4