Re: [PATCH 2/2] ar7_wdt: convert to become a platform driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Florian,

> This patch converts the ar7_wdt driver to become a platform
> driver. The AR7 SoC specific identification and base register
> calculation is performed by the board code, therefore we no
> longer need to have access to ar7_chip_id.

> @@ -298,22 +285,33 @@ static struct miscdevice ar7_wdt_miscdev = {
>  	.fops		= &ar7_wdt_fops,
>  };
>  
> -static int __init ar7_wdt_init(void)
> +static int __init ar7_wdt_probe(struct platform_device *pdev)

Should be __devinit .

> +static struct platform_driver ar7_wdt_driver = {
> +	.driver.name = "ar7_wdt",
> +	.probe = ar7_wdt_probe,
> +	.remove = __devexit_p(ar7_wdt_remove),
> +};

I prefer to have it as follows (so that the driver.owner field is also set):
static struct platform_driver ar7_wdt_driver = {
	.probe = ar7_wdt_probe,
	.remove = __devexit_p(ar7_wdt_remove),
	.driver = {
		.owner = THIS_MODULE,
		.name = "ar7_wdt",
	},
};

I suggest to also change the reboot notifier code into a platform shutdown method.
You then get something like the attached patch (untested, uncompiled and I included above 2 remarks).
For the rest: code is OK for me. After the __init to __devinit fix you can add my signed-off-by.

Kind regards,
Wim.



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux