linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wim Van Sebroeck <wim@iguana.be>
To: Florian Fainelli <florian@openwrt.org>
Cc: Ralf Baechle <ralf@linux-mips.org>, linux-mips@linux-mips.org
Subject: Re: [PATCH 2/2] ar7_wdt: convert to become a platform driver
Date: Sat, 18 Jul 2009 21:09:31 +0200	[thread overview]
Message-ID: <20090718190930.GC23797@infomag.iguana.be> (raw)
In-Reply-To: <200907151210.20294.florian@openwrt.org>

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.

  reply	other threads:[~2009-07-18 19:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-15 10:10 [PATCH 2/2] ar7_wdt: convert to become a platform driver Florian Fainelli
2009-07-18 19:09 ` Wim Van Sebroeck [this message]
2009-07-18 21:49   ` Wim Van Sebroeck
2009-07-21 10:11     ` Florian Fainelli
2009-08-11 12:52       ` Florian Fainelli
2009-08-11 13:01         ` Wim Van Sebroeck
2009-08-11 13:17           ` Florian Fainelli
2009-08-27 20:47             ` Wim Van Sebroeck
2009-08-31 13:42               ` Florian Fainelli

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=20090718190930.GC23797@infomag.iguana.be \
    --to=wim@iguana.be \
    --cc=florian@openwrt.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    /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).