From patchwork Thu Jul 13 07:04:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 13311406 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 749C6EB64DD for ; Thu, 13 Jul 2023 07:07:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3bTWPvl79H2pncA7vHQ5XRYjHWPHMbbnxIOYZIucoMo=; b=GUl/zc3z14HKfq OpqDbgw1v/erfqevpl2K4JiGrHBT+QZNl+OXu8idsLG3CWE4HUI/t38M72HSu3H6WtwOTJ/LIgGJD hcim1+Q60sEpmannjSB0Mo5CBDFOI5KJT6LvdeltbZ6tdVFK3t1fpeZV/ohg664q9johef14LalAO qhlLx2wpUi3hRc6XxCZdE0t26m+dUHwuda8I5b7lAHLC3+TODsmqgCM4/7kuDo8LBPg2ez6FC0yAT AKONUGpTeC7rpFWShPxGFlM2UOTuigB+dF83KdxgtFmkSgddzcdMnaimScmd8JE+MjwNOGJqCD6Yq fe04kd6LOhdYAqR8kicA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qJqPZ-002BEn-0u; Thu, 13 Jul 2023 07:06:49 +0000 Received: from viti.kaiser.cx ([2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qJqPS-002BAE-3B for linux-arm-kernel@lists.infradead.org; Thu, 13 Jul 2023 07:06:45 +0000 Received: from 74.172.62.81.static.wline.lns.sme.cust.swisscom.ch ([81.62.172.74] 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 1qJqPL-0004KN-Rg; Thu, 13 Jul 2023 09:06:35 +0200 From: Martin Kaiser To: Herbert Xu Cc: olivier@sobrie.be, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 1/3] hwrng: ba431 - do not set drvdata Date: Thu, 13 Jul 2023 09:04:44 +0200 Message-Id: <20230713070446.230978-2-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230713070446.230978-1-martin@kaiser.cx> References: <20230713070446.230978-1-martin@kaiser.cx> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230713_000643_193020_055C5B4F X-CRM114-Status: UNSURE ( 8.98 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Do not set drvdata in the ba431 driver. Nobody is using it. Signed-off-by: Martin Kaiser --- drivers/char/hw_random/ba431-rng.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/char/hw_random/ba431-rng.c b/drivers/char/hw_random/ba431-rng.c index 5b7ca0416490..b1518dd52a24 100644 --- a/drivers/char/hw_random/ba431-rng.c +++ b/drivers/char/hw_random/ba431-rng.c @@ -189,8 +189,6 @@ static int ba431_trng_probe(struct platform_device *pdev) ba431->rng.cleanup = ba431_trng_cleanup; ba431->rng.read = ba431_trng_read; - platform_set_drvdata(pdev, ba431); - ret = devm_hwrng_register(&pdev->dev, &ba431->rng); if (ret) { dev_err(&pdev->dev, "BA431 registration failed (%d)\n", ret); From patchwork Thu Jul 13 07:04:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 13311405 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D047CEB64DD for ; Thu, 13 Jul 2023 07:07:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hfvSMM2fSU3FBlJiaQ/q0Xj31CTprhDfYPe9vZcKPyE=; b=DXyC5m7YkbD1EP B9imnVQO4zcKNC+Vdg5GBslOwzrKkqPUt23zUWWq5tcFBW5Pqr0a1/PL8m14ZdBfKxiuR0vUmJPz5 cT5+WFqwU0mg6iF5gseb9gXWArXkrcuJSwkR/mubJb13reAZF8jbI09t5IkfHMi+YCGjOYZfNxdKf EDJw1CHjfK7QBCPj1UE93qKTmEkenTp8MDvBhq3h+j+6B8txwr/4bezCDVeuSYRY+VtmqYkw6EgIV q6udQZZI4bprFJYixX6Z3A8D2bU6VpzKsm0yUKteaJDy0p3uENH3bXQnWF9rrEo/67o4lwdwma3h+ VcxcY2D8EupRIXMJ+KKw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qJqPY-002BE0-0R; Thu, 13 Jul 2023 07:06:48 +0000 Received: from viti.kaiser.cx ([2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qJqPS-002BAF-1x for linux-arm-kernel@lists.infradead.org; Thu, 13 Jul 2023 07:06:44 +0000 Received: from 74.172.62.81.static.wline.lns.sme.cust.swisscom.ch ([81.62.172.74] 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 1qJqPM-0004KN-Kp; Thu, 13 Jul 2023 09:06:36 +0200 From: Martin Kaiser To: Herbert Xu Cc: olivier@sobrie.be, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 2/3] hwrng: ba431 - don't init of_device_id's data Date: Thu, 13 Jul 2023 09:04:45 +0200 Message-Id: <20230713070446.230978-3-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230713070446.230978-1-martin@kaiser.cx> References: <20230713070446.230978-1-martin@kaiser.cx> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230713_000642_790405_5CF40383 X-CRM114-Status: GOOD ( 12.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org We have no device-specific data for silex-insight,ba431-rng. There's no need to set .data = NULL, this is the default. Signed-off-by: Martin Kaiser --- drivers/char/hw_random/ba431-rng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/char/hw_random/ba431-rng.c b/drivers/char/hw_random/ba431-rng.c index b1518dd52a24..d2a9d16323a6 100644 --- a/drivers/char/hw_random/ba431-rng.c +++ b/drivers/char/hw_random/ba431-rng.c @@ -201,7 +201,7 @@ static int ba431_trng_probe(struct platform_device *pdev) } static const struct of_device_id ba431_trng_dt_ids[] = { - { .compatible = "silex-insight,ba431-rng", .data = NULL }, + { .compatible = "silex-insight,ba431-rng" }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, ba431_trng_dt_ids); From patchwork Thu Jul 13 07:04:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Kaiser X-Patchwork-Id: 13311404 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2EDC4EB64DD for ; Thu, 13 Jul 2023 07:07:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6wL01Wm8KE/5NNlerFt+4f7xfuY8LF4I8wtVakf5Ezo=; b=UMw2upf9MnKBwo 8uKW7L+6kgz7ilkq0df/k3JTftmldRleTHDKogwgQ1FKvKkNeLndHe0yLOkd2ArzuTb/PyRu0OPMo crWdxvoKnSxhUTYyOVYaWJwZYNBBsmHZ2lR36TiDwdyyoKEceFt/fBoCa4fPxkKT3Qj4HuG6X8G8b cJxDK6fQfNEbWraktVhLxCdK/w/pZso5DiSKSc/yNPvrzpnqO7si1TDbKXASYDO6kFV/lADol3o5o hynKHlNQdI+nGdVJWFfdZFEMgcHJOvrubpyqeKrpVckctgzULMVX6LzfQiZWfkBUuFvN+cVbncAC3 GbqJZWcjgKPgY+4x8R/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qJqPY-002BEL-28; Thu, 13 Jul 2023 07:06:48 +0000 Received: from viti.kaiser.cx ([2a01:238:43fe:e600:cd0c:bd4a:7a3:8e9f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qJqPS-002BAI-1y for linux-arm-kernel@lists.infradead.org; Thu, 13 Jul 2023 07:06:45 +0000 Received: from 74.172.62.81.static.wline.lns.sme.cust.swisscom.ch ([81.62.172.74] 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 1qJqPN-0004KN-CF; Thu, 13 Jul 2023 09:06:37 +0200 From: Martin Kaiser To: Herbert Xu Cc: olivier@sobrie.be, linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH 3/3] hwrng: ba431 - use dev_err_probe after failed registration Date: Thu, 13 Jul 2023 09:04:46 +0200 Message-Id: <20230713070446.230978-4-martin@kaiser.cx> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230713070446.230978-1-martin@kaiser.cx> References: <20230713070446.230978-1-martin@kaiser.cx> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230713_000642_796972_B62B83D1 X-CRM114-Status: GOOD ( 10.08 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use dev_err_probe to print the error message after a failed hwrng registration. Signed-off-by: Martin Kaiser --- drivers/char/hw_random/ba431-rng.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/char/hw_random/ba431-rng.c b/drivers/char/hw_random/ba431-rng.c index d2a9d16323a6..9de7466e6896 100644 --- a/drivers/char/hw_random/ba431-rng.c +++ b/drivers/char/hw_random/ba431-rng.c @@ -190,10 +190,8 @@ static int ba431_trng_probe(struct platform_device *pdev) ba431->rng.read = ba431_trng_read; ret = devm_hwrng_register(&pdev->dev, &ba431->rng); - if (ret) { - dev_err(&pdev->dev, "BA431 registration failed (%d)\n", ret); - return ret; - } + if (ret) + return dev_err_probe(&pdev->dev, ret, "BA431 registration failed\n"); dev_info(&pdev->dev, "BA431 TRNG registered\n");