From: Arnd Bergmann <arnd@arndb.de>
To: "Hawkins, Nick" <nick.hawkins@hpe.com>
Cc: "Verdun, Jean-Marie" <verdun@hpe.com>,
nick@hpe.com, Joel Stanley <joel@jms.id.au>,
Arnd Bergmann <arnd@arndb.de>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH v6 4/8] clocksource/drivers/timer-gxp: Add HPE GXP Timer
Date: Tue, 3 May 2022 12:34:00 +0200 [thread overview]
Message-ID: <CAK8P3a19pe=ehX1CR9RQz6MH=4YmTN9s7aW5LGFOPypDYjckbg@mail.gmail.com> (raw)
In-Reply-To: <20220502204050.88316-4-nick.hawkins@hpe.com>
On Mon, May 2, 2022 at 10:40 PM <nick.hawkins@hpe.com> wrote:
>
> +config GXP_TIMER
> + bool "GXP timer driver" if COMPILE_TEST
> + depends on ARCH_HPE
> + default y
I don't think this does what you intended: with the COMPILE_TEST option,
you make it possible to disable the driver when ARCH_HPE is set,
but you don't allow enabling it on other platforms, which is actually the
point of compile testing.
Maybe instead use
config GXP_TIMER
bool "GXP timer driver" if COMPILE_TEST && !ARCH_HPE
default ARCH_HPE
Also change the prompt to be more specific and mention HPE,
as the 'GXP timer' is not a particularly obvious name for random
users.
You probably also need
select TIMER_OF if OF
> +/*
> + * This probe gets called after the timer is already up and running. This will create
> + * the watchdog device as a child since the registers are shared.
> + */
> +
> +static int gxp_timer_probe(struct platform_device *pdev)
> +{
> + struct platform_device *gxp_watchdog_device;
> + struct device *dev = &pdev->dev;
> +
> + if (!gxp_timer) {
> + pr_err("Gxp Timer not initialized, cannot create watchdog");
> + return -ENOMEM;
> + }
> +
> + gxp_watchdog_device = platform_device_alloc("gxp-wdt", -1);
> + if (!gxp_watchdog_device) {
> + pr_err("Timer failed to allocate gxp-wdt");
> + return -ENOMEM;
> + }
> +
> + /* Pass the base address (counter) as platform data and nothing else */
> + gxp_watchdog_device->dev.platform_data = gxp_timer->counter;
> + gxp_watchdog_device->dev.parent = dev;
> +
> + return platform_device_add(gxp_watchdog_device);
> +}
This looks good to me now.
Arnd
next prev parent reply other threads:[~2022-05-03 10:34 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-02 20:40 [PATCH v6 1/8] ARM: hpe: Introduce the HPE GXP architecture nick.hawkins
2022-05-02 20:40 ` [PATCH v6 2/8] ARM: configs: multi_v7_defconfig: Add HPE GXP ARCH nick.hawkins
2022-05-02 20:40 ` [PATCH v6 3/8] watchdog: hpe-wdt: Introduce HPE GXP Watchdog nick.hawkins
2022-05-03 2:19 ` Guenter Roeck
2022-05-03 16:22 ` Hawkins, Nick
2022-05-03 16:53 ` Guenter Roeck
2022-05-03 18:51 ` Arnd Bergmann
2022-05-04 16:25 ` Hawkins, Nick
2022-05-05 21:29 ` Guenter Roeck
2022-05-02 20:40 ` [PATCH v6 4/8] clocksource/drivers/timer-gxp: Add HPE GXP Timer nick.hawkins
2022-05-03 10:34 ` Arnd Bergmann [this message]
2022-05-02 20:40 ` [PATCH v6 5/8] dt-bindings: timer: hpe,gxp-timer: Creation nick.hawkins
2022-05-03 9:58 ` Krzysztof Kozlowski
2022-05-03 17:39 ` Rob Herring
2022-05-02 20:40 ` [PATCH v6 6/8] dt-bindings: arm: hpe: add GXP Support nick.hawkins
2022-05-03 9:59 ` Krzysztof Kozlowski
2022-05-03 17:40 ` Rob Herring
2022-05-02 20:40 ` [PATCH v6 7/8] ARM: dts: Introduce HPE GXP Device tree nick.hawkins
2022-05-03 10:00 ` Krzysztof Kozlowski
2022-05-03 14:08 ` Hawkins, Nick
2022-05-03 10:45 ` Arnd Bergmann
2022-05-03 15:07 ` Hawkins, Nick
2022-05-03 18:19 ` Arnd Bergmann
2022-05-02 20:40 ` [PATCH v6 8/8] MAINTAINERS: Introduce HPE GXP Architecture nick.hawkins
2022-05-03 10:05 ` Krzysztof Kozlowski
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='CAK8P3a19pe=ehX1CR9RQz6MH=4YmTN9s7aW5LGFOPypDYjckbg@mail.gmail.com' \
--to=arnd@arndb.de \
--cc=daniel.lezcano@linaro.org \
--cc=joel@jms.id.au \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nick.hawkins@hpe.com \
--cc=nick@hpe.com \
--cc=tglx@linutronix.de \
--cc=verdun@hpe.com \
/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).