public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH 05/06] sh_mobile_ceu_camera: Add SuperH Mobile CEU driver V3
Date: Fri, 18 Jul 2008 22:27:13 +0000	[thread overview]
Message-ID: <20080718222713.GA18822@linux-sh.org> (raw)
In-Reply-To: <20080714120249.4806.66136.sendpatchset@rx1.opensource.se>

On Sat, Jul 19, 2008 at 12:14:42AM +0200, Guennadi Liakhovetski wrote:
> On Sat, 19 Jul 2008, Paul Mundt wrote:
> 
> > On Fri, Jul 18, 2008 at 10:23:14AM +0200, Guennadi Liakhovetski wrote:
> > > On Fri, 18 Jul 2008, Magnus Damm wrote:
> > > > Regarding request_mem_region() - I used to add that here and there,
> > > > but I think the platform driver layer should handle that for us
> > > > automatically these days. I'm not 100% sure though. =)
> > > 
> > > I had a short look and didn't find anything like that there... So, you 
> > > might want to double-check and add if needed.
> > > 
> > It's a bit obscured, but it's certainly handled generically these days.
> > 
> > Look at drivers/base/platform.c:platform_device_add(). The resource type
> > is checked there and handed off to insert_resource().
> > platform_device_add() is likewise wrapped in to from
> > platform_device_register(), so everyone claims the resources
> > unconditionally.
> 
> Sorry, I still don't qite follow. _Resources_ get accounted with the 
> platform_device_add() / platform_device_del(), and are searched by 
> platform_get_resource(), but even this doesn't lock the resource like 
> some other "get" methods. I can see that. But we are talking not about 
> "struct resource" accounting, but about memory regions. And I don't see 
> this done anywhere in platform-device / resource handling.

Uhm, what? What do you think request_mem_region() does? It most certainly
is about struct resource accounting, and the use of insert_resource() is
very clearly documented in kernel/resource.c.

If you have an IORESOURCE_MEM resource in your platform device, the
iomem_resource pointer gets referenced, just as with
request_mem_region(), and they both go through __request_region(). The
only difference is that request_mem_region() doesn't permit nesting,
while insert_resource() does. There's nothing else going on here.

platform_get_resource() has nothing to do with platform_device_add()
setting up resources, it's just a helper to find a struct resource by its
IORESOURCE type nested in the platform device, as they are very often out
of order. platform_get_irq() tends to be the most useful of these.

  parent reply	other threads:[~2008-07-18 22:27 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-14 12:02 [PATCH 00/06] soc_camera: SuperH Mobile CEU patches V3 Magnus Damm
2008-07-14 12:02 ` [PATCH 01/06] soc_camera: Move spinlocks Magnus Damm
2008-07-14 12:31   ` Guennadi Liakhovetski
2008-07-14 12:36     ` Paulius Zaleckas
2008-07-14 12:43       ` Guennadi Liakhovetski
2008-07-15  8:23     ` Magnus Damm
2008-07-14 12:02 ` [PATCH 02/06] soc_camera: Add 16-bit bus width support Magnus Damm
2008-07-14 12:02 ` [PATCH 03/06] videobuf: Fix gather spelling Magnus Damm
2008-07-14 12:02 ` [PATCH 04/06] videobuf: Add physically contiguous queue code V3 Magnus Damm
2008-07-14 12:20   ` [PATCH 04/06] videobuf: Add physically contiguous queue code Paulius Zaleckas
2008-07-14 12:02 ` [PATCH 05/06] sh_mobile_ceu_camera: Add SuperH Mobile CEU driver V3 Magnus Damm
2008-07-18  7:39   ` [PATCH 05/06] sh_mobile_ceu_camera: Add SuperH Mobile CEU driver Guennadi Liakhovetski
2008-07-18  8:07     ` [PATCH 05/06] sh_mobile_ceu_camera: Add SuperH Mobile CEU driver V3 Magnus Damm
2008-07-18  8:23       ` [PATCH 05/06] sh_mobile_ceu_camera: Add SuperH Mobile CEU driver Guennadi Liakhovetski
2008-07-18 21:05   ` [PATCH 05/06] sh_mobile_ceu_camera: Add SuperH Mobile CEU driver V3 Paul Mundt
2008-07-18 21:46   ` Paul Mundt
2008-07-18 22:14     ` [PATCH 05/06] sh_mobile_ceu_camera: Add SuperH Mobile CEU driver Guennadi Liakhovetski
2008-07-18 22:27   ` Paul Mundt [this message]
2008-07-18 22:48     ` Guennadi Liakhovetski
2008-07-14 12:02 ` [PATCH 06/06] soc_camera_platform: Add SoC Camera Platform driver Magnus Damm
2008-07-18  7:40 ` [PATCH 00/06] soc_camera: SuperH Mobile CEU patches V3 Guennadi Liakhovetski

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=20080718222713.GA18822@linux-sh.org \
    --to=lethal@linux-sh.org \
    --cc=linux-sh@vger.kernel.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