Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp130305pxb; Mon, 8 Feb 2021 17:38:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJzk7C02+AuFBNvZWRBMTNWYcRQB+WMwmpghNbChKONskuJZcN3lDvxlleanDJCRrPmuKlVk X-Received: by 2002:a17:906:c448:: with SMTP id ck8mr19983714ejb.55.1612834695644; Mon, 08 Feb 2021 17:38:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612834695; cv=none; d=google.com; s=arc-20160816; b=uJZd3gISVPYVtd0dM8i7Ucisr5KVrlLdSg5JUcqit6hYWpc1XHBbecqb8s0WaMbnNh zAooQJsPeapDljIfAbvgg+O5eazqVlBRZwtrth2WFRUAanffxHFFfz4+dM2DhBuzK1pW +tEMWR6XXMBRQ9LvRyIZ47Hnof0HPn0rnXDIHNMNtpyONZG0JX7h1KV3u1fiXa0CPJ6j /nQNMOmuu2Rfcr3WH7x3c8NPbQ6JXmXllZ5HIg3TfuIGeCRgmHahlQLP2ET2/v91O4lf 2VoneP8pbJOkkBBtvD636Wp/PvaXjTSceK07KpMf/8J1kLGSJUV4muuiS//Q5NHd5dB+ wspA== 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=Ce8u/U+IRHTrOGcrEKDS38T3rvmR4Zgs8fqR0aspFxI=; b=bn1gSc6KFF6RQM4tmuLXzfA4b+xSh5pGJsh5kvzAFOA7uakphk41NifeXggA1UffR0 WbZiIpHYyg4D8p198R9m7zVH7S8IFQ7jXmPN0ViGMlnNievbuIhWvFVbc50h82MaAx2K 3hkT2CdqgVFKrcEfP2ohXnD2foHJZv1MnFukXCG0Ay+JTGnU2SdQZ7RWGqBxbQPd/n66 nrNxGmObaGFmrD6wcweMa2kYNaqNrM7PXjHGXXyUn2nC7jaVIdfv41QAA4a1d1Yl729E kDoXG9F53mbuPz7woGMAiTzAyDQd/IqbRdPaENEkC1Kd5PdC+Xr+btCOnz2aI75WYItC k+Hg== 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 m5si13144312edv.157.2021.02.08.17.37.44; Mon, 08 Feb 2021 17:38:15 -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 S229683AbhBIBgr (ORCPT + 99 others); Mon, 8 Feb 2021 20:36:47 -0500 Received: from szxga07-in.huawei.com ([45.249.212.35]:12871 "EHLO szxga07-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229623AbhBIBgq (ORCPT ); Mon, 8 Feb 2021 20:36:46 -0500 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4DZQRd5CSSz7j8q; Tue, 9 Feb 2021 09:34:37 +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; Tue, 9 Feb 2021 09:35:58 +0800 From: Tian Tao To: , CC: Subject: [PATCH] hwrng: ba431 - Use device-managed registration Date: Tue, 9 Feb 2021 09:35:34 +0800 Message-ID: <1612834534-59383-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 device-managed registration, so we can delete the ba431_trng_remove. Signed-off-by: Tian Tao --- drivers/char/hw_random/ba431-rng.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/char/hw_random/ba431-rng.c b/drivers/char/hw_random/ba431-rng.c index 410b50b..4f514e2 100644 --- a/drivers/char/hw_random/ba431-rng.c +++ b/drivers/char/hw_random/ba431-rng.c @@ -193,7 +193,7 @@ static int ba431_trng_probe(struct platform_device *pdev) platform_set_drvdata(pdev, ba431); - ret = hwrng_register(&ba431->rng); + ret = devm_hwrng_register(&pdev->dev, &ba431->rng); if (ret) { dev_err(&pdev->dev, "BA431 registration failed (%d)\n", ret); return ret; @@ -204,15 +204,6 @@ static int ba431_trng_probe(struct platform_device *pdev) return 0; } -static int ba431_trng_remove(struct platform_device *pdev) -{ - struct ba431_trng *ba431 = platform_get_drvdata(pdev); - - hwrng_unregister(&ba431->rng); - - return 0; -} - static const struct of_device_id ba431_trng_dt_ids[] = { { .compatible = "silex-insight,ba431-rng", .data = NULL }, { /* sentinel */ } @@ -225,7 +216,6 @@ static struct platform_driver ba431_trng_driver = { .of_match_table = ba431_trng_dt_ids, }, .probe = ba431_trng_probe, - .remove = ba431_trng_remove, }; module_platform_driver(ba431_trng_driver); -- 2.7.4