Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp35843015rwd; Mon, 10 Jul 2023 13:33:50 -0700 (PDT) X-Google-Smtp-Source: APBJJlFOiP09jlzDMjAMFG+rQibvZUp7rrGFmPRDVWIngYTDjuGZVcj3HXqSEEe0+6ekADxuk1dw X-Received: by 2002:a17:906:2dd:b0:992:872:76d4 with SMTP id 29-20020a17090602dd00b00992087276d4mr14924000ejk.17.1689021230346; Mon, 10 Jul 2023 13:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689021230; cv=none; d=google.com; s=arc-20160816; b=saebwqTZHSBCQnTcQEV36qBMf1y24wS8OSDtcg6Xi7o/1X5rF2zK6eUJLUFsITEkLP GXZMXGFAwnnHcSrdcYsbLiurIppXqZAvbk0nG0dW4TQpKjdYr2PZOCSGiIrBSxVV9pw8 QcNMpDB1JY+Kw+L4rfD4txFn+zBhlHA8L+SX6hJatt1qb5ZtmbOmGbiAWt/0tQud+ZIy WEdGVD+NdpGGxx+5fEYqzjyxv4aXLCZccJH/W5IhLBa6d1SND1W8lPICmRkHgInMO25D vOyUfi31hc65mJGfeyq2Xoza5iNQA/Germcp3DSg2+wmyZk7O7nV+CQ1W4elr/9dujbV zcWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=5L4Y41EMlcZQIIM8iqchfzrMfSKqKG7eenir0Q2uofM=; fh=GUQwZ7uCW3sOebrGSFJwPRX8di32vmIzxh/oFyyWwpA=; b=w2oZWKlRT/bwJ+jEZZ5eVLTp7ir7bSCmNFMKD8s3MnfEUTnx1Un4cptE9VDBTRSELe u/ODRS93hXYuGTagFQDB7M2aXGe3Hch0W2RVvl0r/J2bV+OWGwi1Fxu3Mt59hMr//HHX mlgAQFtEG8Dy41R77HPTlxl4y6YRW4ws+5P5kv5D27+35LheKWF0XYVw0wYQQEGQTRsh EtK0L+0OwvlFy95wgLY/GzMdBWcJe2wkTXXsoKux8ET/kbBQzqekOqrUCcx6MJtX5YyJ lvGNtbS0vf09iROGyx7NLH2eKQvn591k6KXAMdkmn8Omg/Bs1n8yXIKx5ig7r1L8eW7s 6oqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rl10-20020a170907216a00b00992ad3f32d6si365970ejb.810.2023.07.10.13.33.27; Mon, 10 Jul 2023 13:33:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232138AbjGJU3j (ORCPT + 99 others); Mon, 10 Jul 2023 16:29:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232143AbjGJU3g (ORCPT ); Mon, 10 Jul 2023 16:29:36 -0400 Received: from viti.kaiser.cx (viti.kaiser.cx [IPv6:2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E9E2D1AB; Mon, 10 Jul 2023 13:29:32 -0700 (PDT) Received: from 250.57.4.146.static.wline.lns.sme.cust.swisscom.ch ([146.4.57.250] helo=martin-debian-2.paytec.ch) by viti.kaiser.cx with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1qIxVh-0002mg-Uz; Mon, 10 Jul 2023 22:29:29 +0200 From: Martin Kaiser To: Herbert Xu Cc: aric.pzqi@ingenic.com, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 7/7] hwrng: ingenic - switch to device managed registration Date: Mon, 10 Jul 2023 22:27:33 +0200 Message-Id: <20230710202733.116133-8-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230710202733.116133-1-martin@kaiser.cx> References: <20230710202733.116133-1-martin@kaiser.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org Call devm_hwrng_register for device managed registration of the ingenic-trng driver. ingenic_trng_remove can then be deleted. Signed-off-by: Martin Kaiser --- drivers/char/hw_random/ingenic-trng.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/drivers/char/hw_random/ingenic-trng.c b/drivers/char/hw_random/ingenic-trng.c index 9c54721f8399..3967a8dbe967 100644 --- a/drivers/char/hw_random/ingenic-trng.c +++ b/drivers/char/hw_random/ingenic-trng.c @@ -98,7 +98,7 @@ static int ingenic_trng_probe(struct platform_device *pdev) trng->rng.cleanup = ingenic_trng_cleanup; trng->rng.read = ingenic_trng_read; - ret = hwrng_register(&trng->rng); + ret = devm_hwrng_register(&pdev->dev, &trng->rng); if (ret) return dev_err_probe(&pdev->dev, ret, "Failed to register hwrng\n"); @@ -108,15 +108,6 @@ static int ingenic_trng_probe(struct platform_device *pdev) return 0; } -static int ingenic_trng_remove(struct platform_device *pdev) -{ - struct ingenic_trng *trng = platform_get_drvdata(pdev); - - hwrng_unregister(&trng->rng); - - return 0; -} - static const struct of_device_id ingenic_trng_of_match[] = { { .compatible = "ingenic,x1830-dtrng" }, { /* sentinel */ } @@ -125,7 +116,6 @@ MODULE_DEVICE_TABLE(of, ingenic_trng_of_match); static struct platform_driver ingenic_trng_driver = { .probe = ingenic_trng_probe, - .remove = ingenic_trng_remove, .driver = { .name = "ingenic-trng", .of_match_table = ingenic_trng_of_match, -- 2.30.2