From: Julia Lawall <julia@diku.dk>
To: Wim Van Sebroeck <wim@iguana.be>
Cc: Kukjin Kim <kgene.kim@samsung.com>,
"'Ben Dooks'" <ben-linux@fluff.org>,
kernel-janitors@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] drivers/watchdog/s3c2410_wdt.c: Convert release_resource to release_region/release_mem_region
Date: Fri, 18 Mar 2011 09:35:32 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.64.1103180933590.2698@ask.diku.dk> (raw)
In-Reply-To: <20110318081140.GS1751@infomag.iguana.be>
On Fri, 18 Mar 2011, Wim Van Sebroeck wrote:
> 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,... ).
Actually, I later realized that one can also use the result of
request_mem_region in place of res. Even though it is not the same
structure, it has the same start and end field information, which is the
only information that is used. But I haven't had a chance to send a patch
that follows that strategy. So if it is preferred to keep res, then that
can be done.
julia
next prev parent reply other threads:[~2011-03-18 8:35 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-26 16:34 Julia Lawall
2011-02-28 10:07 ` Kukjin Kim
2011-02-28 10:12 ` Julia Lawall
2011-03-18 8:11 ` Wim Van Sebroeck
2011-03-18 8:35 ` Julia Lawall [this message]
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=Pine.LNX.4.64.1103180933590.2698@ask.diku.dk \
--to=julia@diku.dk \
--cc=ben-linux@fluff.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=kgene.kim@samsung.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-watchdog@vger.kernel.org \
--cc=wim@iguana.be \
/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
all inboxes | Powered by JetHome®