Re: [PATCH] spi: add spi_tegra driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
--
To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux