[PATCH] mx35_3ds: Add watchdog support

Russell King - ARM Linux linux at arm.linux.org.uk
Mon Nov 15 14:04:21 EST 2010


On Mon, Nov 15, 2010 at 09:31:34AM -0800, Fabio Estevam wrote:
> diff --git a/drivers/watchdog/imx2_wdt.c b/drivers/watchdog/imx2_wdt.c
> index 2ee7dac..63f600c 100644
> --- a/drivers/watchdog/imx2_wdt.c
> +++ b/drivers/watchdog/imx2_wdt.c
> @@ -270,10 +270,12 @@ static int __init imx2_wdt_probe(struct
> platform_device *pdev)
>         return -ENOMEM;
>     }
> 
> -    imx2_wdt.clk = clk_get_sys("imx-wdt.0", NULL);
> -    if (IS_ERR(imx2_wdt.clk)) {
> -        dev_err(&pdev->dev, "can't get Watchdog clock\n");
> -        return PTR_ERR(imx2_wdt.clk);
> +    if (!cpu_is_mx51()) {
> +        imx2_wdt.clk = clk_get_sys("imx-wdt.0", NULL);
> +        if (IS_ERR(imx2_wdt.clk)) {
> +            dev_err(&pdev->dev, "can't get Watchdog clock\n");
> +            return PTR_ERR(imx2_wdt.clk);
> +        }
>     }

Why not do what we do on other platforms (such as omap) and provide a dummy
imx-wdt.0 clock for non-MX51 CPUs?  Then you don't need to code such stuff
into drivers.



More information about the linux-arm-kernel mailing list