[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a19pe=ehX1CR9RQz6MH=4YmTN9s7aW5LGFOPypDYjckbg@mail.gmail.com>
Date: Tue, 3 May 2022 12:34:00 +0200
From: Arnd Bergmann <arnd@...db.de>
To: "Hawkins, Nick" <nick.hawkins@....com>
Cc: "Verdun, Jean-Marie" <verdun@....com>, nick@....com,
Joel Stanley <joel@....id.au>, Arnd Bergmann <arnd@...db.de>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH v6 4/8] clocksource/drivers/timer-gxp: Add HPE GXP Timer
On Mon, May 2, 2022 at 10:40 PM <nick.hawkins@....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
Powered by blists - more mailing lists