lkml.org 
[lkml]   [2013]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/6] of/pci: Provide support for parsing PCI DT ranges property

On Sat, 23 Mar 2013 10:41:56 +0000, Russell King - ARM Linux wrote:

> Please look at how IORESOURCE_* stuff is defined:
> #define IORESOURCE_TYPE_BITS 0x00001f00 /* Resource type */
> #define IORESOURCE_IO 0x00000100 /* PCI/ISA I/O ports */
> #define IORESOURCE_MEM 0x00000200
> #define IORESOURCE_REG 0x00000300 /* Register offsets */
> #define IORESOURCE_IRQ 0x00000400
> #define IORESOURCE_DMA 0x00000800
> #define IORESOURCE_BUS 0x00001000
>
> Notice that it's not an array of bits.
>
> So this should be:
> if ((iter.flags & IORESOURCE_TYPE_BITS) == IORESOURCE_IO) {

What I've done for the Marvell PCIe driver is:

+ for_each_of_pci_range(&iter, np) {
+ unsigned long restype = iter.flags & IORESOURCE_TYPE_BITS;
+ if (restype == IORESOURCE_IO) {
[...]
+ if (restype == IORESOURCE_MEM) {
[...]

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com


\
 
 \ /
  Last update: 2013-03-23 15:01    [W:0.514 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site