[PATCH] Separate pci bits out of struct device_node

Stephen Rothwell sfr at canb.auug.org.au
Tue Sep 6 17:09:13 EST 2005


On Tue, 6 Sep 2005 13:17:54 +1000 Paul Mackerras <paulus at samba.org> wrote:
>
> @@ -791,11 +798,13 @@
>  	for (phb = of_find_node_by_name(NULL, "pci"); phb;
>  	     phb = of_find_node_by_name(phb, "pci")) {
>  		unsigned long buid;
> +		struct pci_dn *pci;
>  
>  		buid = get_phb_buid(phb);
> -		if (buid == 0)
> +		if (buid == 0 || phb->data == NULL)
>  			continue;
>  
> +		pci = phb->data;
>  		info.buid_lo = BUID_LO(buid);
>  		info.buid_hi = BUID_HI(buid);
>  		traverse_pci_devices(phb, early_enable_eeh, &info);

The "pci" variable doesn't get used ...

> @@ -123,14 +140,17 @@
>  
>  /*
>   * Traversal func that looks for a <busno,devfcn> value.
> - * If found, the device_node is returned (thus terminating the traversal).
> + * If found, the pci_dn is returned (thus terminating the traversal).
>   */
>  static void *is_devfn_node(struct device_node *dn, void *data)
>  {
>  	int busno = ((unsigned long)data >> 8) & 0xff;
>  	int devfn = ((unsigned long)data) & 0xff;
> +	struct pci_dn *pci = dn->data;
>  
> -	return ((devfn == dn->devfn) && (busno == dn->busno)) ? dn : NULL;
> +	if (pci && (devfn == pci->devfn) && (busno == pci->busno))
> +		return dn;
> +	return NULL;
>  }

The original comment is still correct.

> diff -urN linux-2.6/drivers/video/offb.c pcidn/drivers/video/offb.c
> --- linux-2.6/drivers/video/offb.c	2005-04-26 15:37:59.000000000 +1000
> +++ pcidn/drivers/video/offb.c	2005-09-06 08:18:54.000000000 +1000
> @@ -363,7 +363,7 @@
>  		address = (u_long) dp->addrs[i].address;
>  
>  #ifdef CONFIG_PPC64
> -		address += dp->phb->pci_mem_offset;
> +		address += ((struct pci_dn *)dp->data)->phb->pci_mem_offset;
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
PCI_DN ?

-- 
Cheers,
Stephen Rothwell                    sfr at canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://ozlabs.org/pipermail/linuxppc64-dev/attachments/20050906/a2a3ef28/attachment.pgp 


More information about the Linuxppc64-dev mailing list