From patchwork Mon Jul 10 20:27:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 118076 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a6b2:0:b0:3e4:2afc:c1 with SMTP id c18csp62457vqm; Mon, 10 Jul 2023 13:45:28 -0700 (PDT) X-Google-Smtp-Source: APBJJlGHAlkd+i/TJok84uRkCMeaVXhm7n7ppCTJRJ9NJalOfJWvVHlUT7uRMCxL4ffBtVo3ltta X-Received: by 2002:adf:fa51:0:b0:314:16d3:d1ee with SMTP id y17-20020adffa51000000b0031416d3d1eemr11609326wrr.68.1689021928710; Mon, 10 Jul 2023 13:45:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689021928; cv=none; d=google.com; s=arc-20160816; b=wDaC4CggmXSVrky2ABd9HS1truIyf8fwH9gQArkObh5b/DYHrSWfCgSBt2v3bGaBNo WHSMkGcTP/qXS9A1X3uD9rumB/Q+X5SquxfAfDbMGlUJwunJGVWVDs0ibOGdOpHvugwm jMiRyC+pbgrwYNevXqyD2vvoIejtHSpBDY8Ji5g0dxI5tUsojoYMzcDFXdEQUP0HkSj3 QzXqBid/Vrvi3+8LlbVjc4ZWqWuwpi/iC7dAVJs+s48eAlZaeoIzxVbYPHYMYeFnl+ie 6K81BU7b+saedhKqYM5+c6LwGbbred5hQb2TQMy7XxjiEQAwF8sF+birsbjgRikf+g/a wEPg== 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=YjBvQWRnPxAVhWFLWp653HMrLnkLSO9k4PHwucUnG12rgimAsecmahb3XN8njc2uYd 39oTc2nZ9TP19SatJkv7ivTdOgT/v/WnibTNSQlauxZWlNU9qRBnnnNpIlV6MxWfq/5l 9NTknAmS+o/Lk/n6wVL4M4vNkFEvIAkBjqCh7a/hjk/X1Ck9zoVU74Fo6A64awtNVAGg 5sKgihLRsdB+kik5onBmIXIQrv0T53/BMEF60HlI4cLO40qgkbRm3LgFDIgaubmjj/Nd ipDTuHZUqbrHRfkiWK7kTPjI+aFfpr6hC+fGVxYki9sjOpEiN1Z9xhFIsdJijzylYtWP QQLw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jp25-20020a170906f75900b00992d8355decsi451885ejb.249.2023.07.10.13.45.05; Mon, 10 Jul 2023 13:45:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232420AbjGJU3v (ORCPT + 99 others); Mon, 10 Jul 2023 16:29:51 -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 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-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771067857924759163 X-GMAIL-MSGID: 1771067857924759163 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,