Re: [PATCH v3, part2 14/20] PCI, DRM: use hotplug-safe iterators to walk PCI buses

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

 



On Sun, May 26, 2013 at 11:53:11PM +0800, Jiang Liu wrote:
> Enhance DRM drvier to use hotplug-safe iterators to walk PCI buses.
> 
> Signed-off-by: Jiang Liu <jiang.liu@xxxxxxxxxx>
> Cc: David Airlie <airlied@xxxxxxxx>
> Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> ---
>  drivers/gpu/drm/drm_fops.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
> index 429e07d..dc8c40b 100644
> --- a/drivers/gpu/drm/drm_fops.c
> +++ b/drivers/gpu/drm/drm_fops.c
> @@ -359,9 +359,11 @@ static int drm_open_helper(struct inode *inode, struct file *filp,
>  			pci_dev_put(pci_dev);
>  		}
>  		if (!dev->hose) {
> -			struct pci_bus *b = pci_bus_b(pci_root_buses.next);
> -			if (b)
> +			struct pci_bus *b = pci_get_next_root_bus(NULL);
> +			if (b) {
>  				dev->hose = b->sysdata;
> +				pci_bus_put(b);
> +			}

This is a gross hack to begin with, and it would be far better to get
rid of the whole "#ifdef __alpha__" block that contains this code.
I can't believe alpha is so special that it needs to do something
that no other arch needs.

>  		}
>  	}
>  #endif
> -- 
> 1.8.1.2
> 
--
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