[PATCH v2] watchdog: at91rm9200 remove mach/ header dependency

Boris Brezillon boris.brezillon at free-electrons.com
Fri Nov 7 08:06:16 PST 2014


Hi Alexandre,

On Fri,  7 Nov 2014 14:22:44 +0100
Alexandre Belloni <alexandre.belloni at free-electrons.com> wrote:

> Remove the mach/ header dependency by including the necessary macros and taking
> the appropriate resources from the system timer.
> 
> Also change the name to avoid conflicting with the at91sam9 watchdog driver and
> allow to compile both the at91rm920 and at91sam9 watchdog drivers at the same
> time.
> 
> Signed-off-by: Alexandre Belloni <alexandre.belloni at free-electrons.com>
> Suggested-by: Arnd Bergmann <arnd at arndb.de>
> Acked-by: Arnd Bergmann <arnd at arndb.de>
> ---
> 
> Changes in v2:
>  - squashed both patches in one

[...]

> +
>  	res = misc_register(&at91wdt_miscdev);
>  	if (res)
>  		return res;
> @@ -267,7 +308,7 @@ static struct platform_driver at91wdt_driver = {
>  	.suspend	= at91wdt_suspend,
>  	.resume		= at91wdt_resume,
>  	.driver		= {
> -		.name	= "at91_wdt",
> +		.name	= "at91rm9200_wdt",
>  		.owner	= THIS_MODULE,
>  		.of_match_table = at91_wdt_dt_ids,

Shouldn't we avoid attaching this driver to the "atmel,at91rm9200-wdt"
compatible string ?
What I mean is that the watchdog should not be represented as a device
node under the apb bus, because it's actually a subdevice of the ST
(System Timer) block, neither it should be declared at the root of the
DT because it's not an external peripheral.
Given those constraints I don't know where we could put the watchdog
node...

I know that removing this of_match_table assignment would break the
existing binding, but nobody is currently using it (at least nobody is
using it in mainline).

Can't we use an MFD to create the watchdog platform device instead of
declaring this node at a random place ?

Regards,

Boris

-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com



More information about the linux-arm-kernel mailing list