linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: wim@iguana.be (Wim Van Sebroeck)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] drivers/watchdog/s3c2410_wdt.c: Convert release_resource to release_region/release_mem_region
Date: Fri, 18 Mar 2011 09:11:40 +0100	[thread overview]
Message-ID: <20110318081140.GS1751@infomag.iguana.be> (raw)
In-Reply-To: <Pine.LNX.4.64.1102281110090.14560@pc-004.diku.dk>

Hi Julia, Kukjin Kim,

> > Hmm...I think, 'res' is better for platform_get_resource().
> > Do we _really_ need to change the name?...
> 
> wdt_mem is a global variable.  Is res a good name for a global variable?  
> One could say wdt_mem = res, if that seems better.

If you look at the code then you have:
static struct resource  *wdt_mem;
static struct resource  *wdt_irq;

and in the probe function you have:
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	...
	wdt_mem = request_mem_region(res->start, size, pdev->name);
	...
	wdt_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);

So doing Julia's:
	wdt_mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	...
	if (!request_mem_region(wdt_mem->start, size, pdev->name)) {
	...
	wdt_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0)

seems the best solution to me (since you then have both resources being polulated via platform_get_resource(pdev,... ).

Kind regards,
Wim.

  reply	other threads:[~2011-03-18  8:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-26 16:34 [PATCH 1/2] drivers/watchdog/s3c2410_wdt.c: Convert release_resource to release_region/release_mem_region Julia Lawall
2011-02-28 10:07 ` Kukjin Kim
2011-02-28 10:12   ` Julia Lawall
2011-03-18  8:11     ` Wim Van Sebroeck [this message]
2011-03-18  8:35       ` Julia Lawall
2011-03-18  9:12         ` Wim Van Sebroeck

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=20110318081140.GS1751@infomag.iguana.be \
    --to=wim@iguana.be \
    --cc=linux-arm-kernel@lists.infradead.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).