[PATCH] spi: add spi_tegra driver

Russell King - ARM Linux linux at arm.linux.org.uk
Thu Aug 12 11:24:24 EDT 2010


On Wed, Aug 11, 2010 at 05:31:00PM -0700, Erik Gilling wrote:
> >> +       if (!request_mem_region(r->start, (r->end - r->start) + 1,
> >> +                       dev_name(&pdev->dev))) {
> >> +               ret = -EBUSY;
> >> +               goto err0;
> >> +       }
> >
> > I believe the platform bus does this for you already by calling
> > insert_resource() on all the platform bus ranges.  See if /proc/iomem
> > is any different with or without this call to verify.
> 
> You're right.  Didn't realize this

There is a big difference between what the platform bus does and what
drivers do.

The platform bus adds the resources to the resource tree as they stand
without marking them _busy_.  This means that they can be sub-divided
and other resources registered within their range.

request_mem_region() adds resources to the resource tree marking them
busy, detecting overlapping resources and indicating whether two
drivers are trying to claim the same resource region.  In other words,
it's a preventative measure against two device drivers accessing the
same region.

You're absolutely right to do what you're doing above, please continue
to do so.



More information about the linux-arm-kernel mailing list