From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: JiaJie Ho <jiajie.ho@starfivetech.com>,
Olivia Mackall <olivia@selenic.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: Emil Renner Berthing <kernel@esmil.dk>,
Conor Dooley <conor.dooley@microchip.com>,
"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-riscv@lists.infradead.org"
<linux-riscv@lists.infradead.org>
Subject: Re: [PATCH 2/3] hwrng: starfive - Add TRNG driver for StarFive SoC
Date: Thu, 22 Dec 2022 10:43:31 +0100 [thread overview]
Message-ID: <27f1c084-60b4-daeb-0ffe-c0500aecbd49@linaro.org> (raw)
In-Reply-To: <69dca1be673a40729d750c00d927b437@EXMBX168.cuchost.com>
On 22/12/2022 10:35, JiaJie Ho wrote:
>
>
>> -----Original Message-----
>> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>> Sent: Wednesday, December 21, 2022 5:49 PM
>> To: JiaJie Ho <jiajie.ho@starfivetech.com>; Olivia Mackall
>> <olivia@selenic.com>; Herbert Xu <herbert@gondor.apana.org.au>; Rob
>> Herring <robh+dt@kernel.org>; Krzysztof Kozlowski
>> <krzysztof.kozlowski+dt@linaro.org>
>> Cc: Emil Renner Berthing <kernel@esmil.dk>; Conor Dooley
>> <conor.dooley@microchip.com>; linux-crypto@vger.kernel.org;
>> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
>> riscv@lists.infradead.org
>> Subject: Re: [PATCH 2/3] hwrng: starfive - Add TRNG driver for StarFive SoC
>>
>> On 21/12/2022 10:08, Jia Jie Ho wrote:
>>> This adds driver support for the hardware random number generator in
>>> Starfive SoCs and adds StarFive TRNG entry to MAINTAINERS.
>>>
>>> Co-developed-by: Jenny Zhang <jenny.zhang@starfivetech.com>
>>> Signed-off-by: Jenny Zhang <jenny.zhang@starfivetech.com>
>>> Signed-off-by: Jia Jie Ho <jiajie.ho@starfivetech.com>
>>> ---
>>> MAINTAINERS | 6 +
>>> drivers/char/hw_random/Kconfig | 11 +
>>> drivers/char/hw_random/Makefile | 1 +
>>> drivers/char/hw_random/starfive-trng.c | 403
>>> +++++++++++++++++++++++++
>>> 4 files changed, 421 insertions(+)
>>> create mode 100644 drivers/char/hw_random/starfive-trng.c
>>>
>>
>> (...)
>>
>>> +static const struct of_device_id trng_dt_ids[] = {
>>> + { .compatible = "starfive,jh7110-trng" },
>>> + { }
>>> +};
>>> +MODULE_DEVICE_TABLE(of, trng_dt_ids);
>>> +
>>> +static struct platform_driver starfive_trng_driver = {
>>> + .probe = starfive_trng_probe,
>>> + .driver = {
>>> + .name = "starfive-trng",
>>> + .pm = &starfive_trng_pm_ops,
>>> + .of_match_table = of_match_ptr(trng_dt_ids),
>>
>> of_match_ptr goes with __maybe_unused. You will have now warnings, so
>> please test more your patches (W=1, sparse, smatch).
>>
>
> Hi Krzysztof,
>
> Thanks for reviewing this patch.
> How do I properly handle __maybe_unused functions in this scenario?
The same as in other files. Use `git grep`
> Will it help if I add #define as follows:
>
> #ifdef CONFIG_PM
> #define STARFIVE_RNG_PM_OPS (&starfive_rng_pm_ops)
> #else
> #define STARFIVE_RNG_PM_OPS NULL
> #endif
I talked only about of_match_ptr(). This is not of_match_ptr and should
have its own syntax (pm_sleep_ptr + static DEFINE_SIMPLE_DEV_PM_OPS)
>
> static struct platform_driver starfive_trng_driver = {
> .probe = starfive_trng_probe,
> .driver = {
> .name = "starfive-trng",
> .pm = STARFIVE_RNG_PM_OPS,
> .of_match_table = of_match_ptr(trng_dt_ids),
> },
> };
>
> I did build the patches with the tools mentioned but did not get warnings.
> Do I need a specific version, or have I done something wrong?
You just need proper COMPILE_TEST config with OF disabled.
Best regards,
Krzysztof
next prev parent reply other threads:[~2022-12-22 9:44 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-21 9:08 [PATCH 0/3] hwrng: starfive - Add driver for TRNG module Jia Jie Ho
2022-12-21 9:08 ` [PATCH 1/3] dt-bindings: rng: Add StarFive " Jia Jie Ho
2022-12-21 9:47 ` Krzysztof Kozlowski
2022-12-22 8:12 ` JiaJie Ho
2022-12-21 9:08 ` [PATCH 2/3] hwrng: starfive - Add TRNG driver for StarFive SoC Jia Jie Ho
2022-12-21 9:49 ` Krzysztof Kozlowski
2022-12-22 9:35 ` JiaJie Ho
2022-12-22 9:43 ` Krzysztof Kozlowski [this message]
2022-12-22 10:29 ` JiaJie Ho
2022-12-21 9:08 ` [PATCH 3/3] riscv: dts: starfive: Add TRNG node for VisionFive 2 Jia Jie Ho
2022-12-21 9:48 ` Krzysztof Kozlowski
2022-12-22 8:11 ` JiaJie Ho
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=27f1c084-60b4-daeb-0ffe-c0500aecbd49@linaro.org \
--to=krzysztof.kozlowski@linaro.org \
--cc=conor.dooley@microchip.com \
--cc=devicetree@vger.kernel.org \
--cc=herbert@gondor.apana.org.au \
--cc=jiajie.ho@starfivetech.com \
--cc=kernel@esmil.dk \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=olivia@selenic.com \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).