Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d72e71d authored by Bjorn Helgaas's avatar Bjorn Helgaas
Browse files

Merge branch 'pci/yijing-dev_is_pci' into next

* pci/yijing-dev_is_pci:
  alpha/PCI: Use dev_is_pci() to identify PCI devices
  arm/PCI: Use dev_is_pci() to identify PCI devices
  arm/PCI: Use dev_is_pci() to identify PCI devices
  parisc/PCI: Use dev_is_pci() to identify PCI devices
  sparc/PCI: Use dev_is_pci() to identify PCI devices
  ia64/PCI: Use dev_is_pci() to identify PCI devices
  x86/PCI: Use dev_is_pci() to identify PCI devices
  PCI: Use dev_is_pci() to identify PCI devices
parents 6c52f51c 09296c0b
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -325,7 +325,7 @@ pci_map_single_1(struct pci_dev *pdev, void *cpu_addr, size_t size,
/* Helper for generic DMA-mapping functions. */
/* Helper for generic DMA-mapping functions. */
static struct pci_dev *alpha_gendev_to_pci(struct device *dev)
static struct pci_dev *alpha_gendev_to_pci(struct device *dev)
{
{
	if (dev && dev->bus == &pci_bus_type)
	if (dev && dev_is_pci(dev))
		return to_pci_dev(dev);
		return to_pci_dev(dev);


	/* Assume that non-PCI devices asking for DMA are either ISA or EISA,
	/* Assume that non-PCI devices asking for DMA are either ISA or EISA,
+2 −2
Original line number Original line Diff line number Diff line
@@ -257,7 +257,7 @@ static int it8152_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t s
 */
 */
static int it8152_pci_platform_notify(struct device *dev)
static int it8152_pci_platform_notify(struct device *dev)
{
{
	if (dev->bus == &pci_bus_type) {
	if (dev_is_pci(dev)) {
		if (dev->dma_mask)
		if (dev->dma_mask)
			*dev->dma_mask = (SZ_64M - 1) | PHYS_OFFSET;
			*dev->dma_mask = (SZ_64M - 1) | PHYS_OFFSET;
		dev->coherent_dma_mask = (SZ_64M - 1) | PHYS_OFFSET;
		dev->coherent_dma_mask = (SZ_64M - 1) | PHYS_OFFSET;
@@ -268,7 +268,7 @@ static int it8152_pci_platform_notify(struct device *dev)


static int it8152_pci_platform_notify_remove(struct device *dev)
static int it8152_pci_platform_notify_remove(struct device *dev)
{
{
	if (dev->bus == &pci_bus_type)
	if (dev_is_pci(dev))
		dmabounce_unregister_dev(dev);
		dmabounce_unregister_dev(dev);


	return 0;
	return 0;
+3 −3
Original line number Original line Diff line number Diff line
@@ -326,7 +326,7 @@ static int ixp4xx_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t s
 */
 */
static int ixp4xx_pci_platform_notify(struct device *dev)
static int ixp4xx_pci_platform_notify(struct device *dev)
{
{
	if(dev->bus == &pci_bus_type) {
	if (dev_is_pci(dev)) {
		*dev->dma_mask =  SZ_64M - 1;
		*dev->dma_mask =  SZ_64M - 1;
		dev->coherent_dma_mask = SZ_64M - 1;
		dev->coherent_dma_mask = SZ_64M - 1;
		dmabounce_register_dev(dev, 2048, 4096, ixp4xx_needs_bounce);
		dmabounce_register_dev(dev, 2048, 4096, ixp4xx_needs_bounce);
@@ -336,9 +336,9 @@ static int ixp4xx_pci_platform_notify(struct device *dev)


static int ixp4xx_pci_platform_notify_remove(struct device *dev)
static int ixp4xx_pci_platform_notify_remove(struct device *dev)
{
{
	if(dev->bus == &pci_bus_type) {
	if (dev_is_pci(dev))
		dmabounce_unregister_dev(dev);
		dmabounce_unregister_dev(dev);
	}

	return 0;
	return 0;
}
}


+1 −1
Original line number Original line Diff line number Diff line
@@ -255,7 +255,7 @@ static u64 prefetch_spill_page;
#endif
#endif


#ifdef CONFIG_PCI
#ifdef CONFIG_PCI
# define GET_IOC(dev)	(((dev)->bus == &pci_bus_type)						\
# define GET_IOC(dev)	((dev_is_pci(dev))						\
			 ? ((struct ioc *) PCI_CONTROLLER(to_pci_dev(dev))->iommu) : NULL)
			 ? ((struct ioc *) PCI_CONTROLLER(to_pci_dev(dev))->iommu) : NULL)
#else
#else
# define GET_IOC(dev)	NULL
# define GET_IOC(dev)	NULL
+12 −12
Original line number Original line Diff line number Diff line
@@ -34,7 +34,7 @@
 */
 */
static int sn_dma_supported(struct device *dev, u64 mask)
static int sn_dma_supported(struct device *dev, u64 mask)
{
{
	BUG_ON(dev->bus != &pci_bus_type);
	BUG_ON(!dev_is_pci(dev));


	if (mask < 0x7fffffff)
	if (mask < 0x7fffffff)
		return 0;
		return 0;
@@ -50,7 +50,7 @@ static int sn_dma_supported(struct device *dev, u64 mask)
 */
 */
int sn_dma_set_mask(struct device *dev, u64 dma_mask)
int sn_dma_set_mask(struct device *dev, u64 dma_mask)
{
{
	BUG_ON(dev->bus != &pci_bus_type);
	BUG_ON(!dev_is_pci(dev));


	if (!sn_dma_supported(dev, dma_mask))
	if (!sn_dma_supported(dev, dma_mask))
		return 0;
		return 0;
@@ -85,7 +85,7 @@ static void *sn_dma_alloc_coherent(struct device *dev, size_t size,
	struct pci_dev *pdev = to_pci_dev(dev);
	struct pci_dev *pdev = to_pci_dev(dev);
	struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev);
	struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev);


	BUG_ON(dev->bus != &pci_bus_type);
	BUG_ON(!dev_is_pci(dev));


	/*
	/*
	 * Allocate the memory.
	 * Allocate the memory.
@@ -143,7 +143,7 @@ static void sn_dma_free_coherent(struct device *dev, size_t size, void *cpu_addr
	struct pci_dev *pdev = to_pci_dev(dev);
	struct pci_dev *pdev = to_pci_dev(dev);
	struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev);
	struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev);


	BUG_ON(dev->bus != &pci_bus_type);
	BUG_ON(!dev_is_pci(dev));


	provider->dma_unmap(pdev, dma_handle, 0);
	provider->dma_unmap(pdev, dma_handle, 0);
	free_pages((unsigned long)cpu_addr, get_order(size));
	free_pages((unsigned long)cpu_addr, get_order(size));
@@ -187,7 +187,7 @@ static dma_addr_t sn_dma_map_page(struct device *dev, struct page *page,


	dmabarr = dma_get_attr(DMA_ATTR_WRITE_BARRIER, attrs);
	dmabarr = dma_get_attr(DMA_ATTR_WRITE_BARRIER, attrs);


	BUG_ON(dev->bus != &pci_bus_type);
	BUG_ON(!dev_is_pci(dev));


	phys_addr = __pa(cpu_addr);
	phys_addr = __pa(cpu_addr);
	if (dmabarr)
	if (dmabarr)
@@ -223,7 +223,7 @@ static void sn_dma_unmap_page(struct device *dev, dma_addr_t dma_addr,
	struct pci_dev *pdev = to_pci_dev(dev);
	struct pci_dev *pdev = to_pci_dev(dev);
	struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev);
	struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev);


	BUG_ON(dev->bus != &pci_bus_type);
	BUG_ON(!dev_is_pci(dev));


	provider->dma_unmap(pdev, dma_addr, dir);
	provider->dma_unmap(pdev, dma_addr, dir);
}
}
@@ -247,7 +247,7 @@ static void sn_dma_unmap_sg(struct device *dev, struct scatterlist *sgl,
	struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev);
	struct sn_pcibus_provider *provider = SN_PCIDEV_BUSPROVIDER(pdev);
	struct scatterlist *sg;
	struct scatterlist *sg;


	BUG_ON(dev->bus != &pci_bus_type);
	BUG_ON(!dev_is_pci(dev));


	for_each_sg(sgl, sg, nhwentries, i) {
	for_each_sg(sgl, sg, nhwentries, i) {
		provider->dma_unmap(pdev, sg->dma_address, dir);
		provider->dma_unmap(pdev, sg->dma_address, dir);
@@ -284,7 +284,7 @@ static int sn_dma_map_sg(struct device *dev, struct scatterlist *sgl,


	dmabarr = dma_get_attr(DMA_ATTR_WRITE_BARRIER, attrs);
	dmabarr = dma_get_attr(DMA_ATTR_WRITE_BARRIER, attrs);


	BUG_ON(dev->bus != &pci_bus_type);
	BUG_ON(!dev_is_pci(dev));


	/*
	/*
	 * Setup a DMA address for each entry in the scatterlist.
	 * Setup a DMA address for each entry in the scatterlist.
@@ -323,26 +323,26 @@ static int sn_dma_map_sg(struct device *dev, struct scatterlist *sgl,
static void sn_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,
static void sn_dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle,
				       size_t size, enum dma_data_direction dir)
				       size_t size, enum dma_data_direction dir)
{
{
	BUG_ON(dev->bus != &pci_bus_type);
	BUG_ON(!dev_is_pci(dev));
}
}


static void sn_dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,
static void sn_dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle,
					  size_t size,
					  size_t size,
					  enum dma_data_direction dir)
					  enum dma_data_direction dir)
{
{
	BUG_ON(dev->bus != &pci_bus_type);
	BUG_ON(!dev_is_pci(dev));
}
}


static void sn_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
static void sn_dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg,
				   int nelems, enum dma_data_direction dir)
				   int nelems, enum dma_data_direction dir)
{
{
	BUG_ON(dev->bus != &pci_bus_type);
	BUG_ON(!dev_is_pci(dev));
}
}


static void sn_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
static void sn_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,
				      int nelems, enum dma_data_direction dir)
				      int nelems, enum dma_data_direction dir)
{
{
	BUG_ON(dev->bus != &pci_bus_type);
	BUG_ON(!dev_is_pci(dev));
}
}


static int sn_dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
static int sn_dma_mapping_error(struct device *dev, dma_addr_t dma_addr)
Loading