Re: [RFC PATCH v2 ]pci: pci resource iterator

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

 



On Wed, Aug 22, 2012 at 3:15 AM, Ram Pai <linuxram@xxxxxxxxxx> wrote:
> On Tue, Aug 21, 2012 at 04:22:52PM -0700, Yinghai Lu wrote:
>> On Tue, Aug 21, 2012 at 8:13 AM, Ram Pai <linuxram@xxxxxxxxxx> wrote:
> by exposing idx through the interface, we are exposing the implementation to
> the enduser. I want the end user not know that the resources are
> structured as a array. This will help easily restructure resources
> in the pci_dev structure to whatever implementation we want, linked list
> or hash or whatever...
>
> Why can't the addon resource be hidden behind the interface? something
> like this?

keep the idx would make thing simple for referencing and converting.

pci_dev_resource_n() would be wrapper to from idx to real resource pointer.
we just need to change &dev->resource[i] referencing to
pci_dev_resource_n(dev, i) instead.

We did that before for irq_desc storage converting, and now we have
     for_each_irq_desc(irq, desc)

later for the resource allocation, I will change resource member from
          struct resource resource[DEVICE_COUNT_RESOURCE];
to
          struct resource *std_res;
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux