search for: platform_get_resourc

Displaying 20 results from an estimated 41 matches for "platform_get_resourc".

Did you mean: platform_get_resource
2019 Dec 23
7
[PATCH 1/6] iommu/omap: convert to devm_platform_ioremap_resource
...obj; - struct resource *res; struct device_node *of = pdev->dev.of_node; struct orphan_dev *orphan_dev, *tmp; @@ -1218,8 +1217,7 @@ static int omap_iommu_probe(struct platform_device *pdev) spin_lock_init(&obj->iommu_lock); spin_lock_init(&obj->page_table_lock); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - obj->regbase = devm_ioremap_resource(obj->dev, res); + obj->regbase = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(obj->regbase)) return PTR_ERR(obj->regbase); -- 2.17.1
2019 Dec 23
7
[PATCH 1/6] iommu/omap: convert to devm_platform_ioremap_resource
...obj; - struct resource *res; struct device_node *of = pdev->dev.of_node; struct orphan_dev *orphan_dev, *tmp; @@ -1218,8 +1217,7 @@ static int omap_iommu_probe(struct platform_device *pdev) spin_lock_init(&obj->iommu_lock); spin_lock_init(&obj->page_table_lock); - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - obj->regbase = devm_ioremap_resource(obj->dev, res); + obj->regbase = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(obj->regbase)) return PTR_ERR(obj->regbase); -- 2.17.1
2019 Dec 22
1
[PATCH] virtio-mmio: convert to devm_platform_ioremap_resource
Use devm_platform_ioremap_resource() to simplify code, which contains platform_get_resource, devm_request_mem_region and devm_ioremap. Signed-off-by: Yangtao Li <tiny.windzz at gmail.com> --- drivers/virtio/virtio_mmio.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index e09edb5c5e...
2019 Dec 23
0
[PATCH] virtio-mmio: convert to devm_platform_ioremap_resource
Use devm_platform_ioremap_resource() to simplify code, which contains platform_get_resource, devm_request_mem_region and devm_ioremap. Signed-off-by: Yangtao Li <tiny.windzz at gmail.com> --- drivers/virtio/virtio_mmio.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/virtio/virtio_mmio.c b/drivers/virtio/virtio_mmio.c index e09edb5c5e...
2014 Feb 10
0
[PATCH] drm/nouveau: support for platform devices
...u/core/engine/device/base.c [...] > +resource_size_t > +nv_device_resource_start(struct nouveau_device *device, unsigned int bar) > +{ > + if (nv_device_is_pci(device)) { > + return pci_resource_start(device->pdev, bar); > + } else { > + struct resource *res; > + res = platform_get_resource(device->platformdev, > + IORESOURCE_MEM, bar); > + if (!res) > + return 0; > + return res->start; > + } > +} > + > +resource_size_t > +nv_device_resource_len(struct nouveau_device *device, unsigned int bar) > +{ > + if (nv_device_is_pci(device)) {...
2014 Oct 25
0
[RFC PATCH 1/2] Add a new register offset let interrupt reason available
...IRQs */ spinlock_t lock; struct list_head virtqueues; + + uint8_t *isr_mem; }; struct virtio_mmio_vq_info { @@ -443,6 +445,7 @@ static int virtio_mmio_probe(struct platform_device *pdev) struct virtio_mmio_device *vm_dev; struct resource *mem; unsigned long magic; + int err; mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mem) @@ -481,6 +484,15 @@ static int virtio_mmio_probe(struct platform_device *pdev) return -ENXIO; } + vm_dev->isr_mem = alloc_pages_exact(PAGE_SIZE, GFP_KERNEL|__GFP_ZERO); + if (vm_dev->isr_mem == NULL) { + dev_err(&pdev->dev, "Allocate...
2017 Jan 10
5
[PATCH] virtio_mmio: Set DMA masks appropriately
...dma-mapping.h> #include <linux/highmem.h> #include <linux/interrupt.h> #include <linux/io.h> @@ -497,6 +498,7 @@ static int virtio_mmio_probe(struct platform_device *pdev) struct virtio_mmio_device *vm_dev; struct resource *mem; unsigned long magic; + int rc; mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mem) @@ -548,6 +550,14 @@ static int virtio_mmio_probe(struct platform_device *pdev) if (vm_dev->version == 1) writel(PAGE_SIZE, vm_dev->base + VIRTIO_MMIO_GUEST_PAGE_SIZE); + rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); + if (r...
2017 Jan 10
5
[PATCH] virtio_mmio: Set DMA masks appropriately
...dma-mapping.h> #include <linux/highmem.h> #include <linux/interrupt.h> #include <linux/io.h> @@ -497,6 +498,7 @@ static int virtio_mmio_probe(struct platform_device *pdev) struct virtio_mmio_device *vm_dev; struct resource *mem; unsigned long magic; + int rc; mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mem) @@ -548,6 +550,14 @@ static int virtio_mmio_probe(struct platform_device *pdev) if (vm_dev->version == 1) writel(PAGE_SIZE, vm_dev->base + VIRTIO_MMIO_GUEST_PAGE_SIZE); + rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)); + if (r...
2017 Jan 10
4
[PATCH v2 1/2] virtio_mmio: Set DMA masks appropriately
...dma-mapping.h> #include <linux/highmem.h> #include <linux/interrupt.h> #include <linux/io.h> @@ -498,6 +499,7 @@ static int virtio_mmio_probe(struct platform_device *pdev) struct virtio_mmio_device *vm_dev; struct resource *mem; unsigned long magic; + int rc; mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mem) @@ -547,9 +549,25 @@ static int virtio_mmio_probe(struct platform_device *pdev) } vm_dev->vdev.id.vendor = readl(vm_dev->base + VIRTIO_MMIO_VENDOR_ID); - if (vm_dev->version == 1) + if (vm_dev->version == 1) { writel(PAGE_SIZE, vm_dev->...
2017 Jan 10
4
[PATCH v2 1/2] virtio_mmio: Set DMA masks appropriately
...dma-mapping.h> #include <linux/highmem.h> #include <linux/interrupt.h> #include <linux/io.h> @@ -498,6 +499,7 @@ static int virtio_mmio_probe(struct platform_device *pdev) struct virtio_mmio_device *vm_dev; struct resource *mem; unsigned long magic; + int rc; mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mem) @@ -547,9 +549,25 @@ static int virtio_mmio_probe(struct platform_device *pdev) } vm_dev->vdev.id.vendor = readl(vm_dev->base + VIRTIO_MMIO_VENDOR_ID); - if (vm_dev->version == 1) + if (vm_dev->version == 1) { writel(PAGE_SIZE, vm_dev->...
2017 Jan 10
1
[PATCH] virtio_mmio: Set DMA masks appropriately
...interrupt.h> >> #include <linux/io.h> >> @@ -497,6 +498,7 @@ static int virtio_mmio_probe(struct platform_device *pdev) >> struct virtio_mmio_device *vm_dev; >> struct resource *mem; >> unsigned long magic; >> + int rc; >> >> mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); >> if (!mem) >> @@ -548,6 +550,14 @@ static int virtio_mmio_probe(struct platform_device *pdev) >> if (vm_dev->version == 1) >> writel(PAGE_SIZE, vm_dev->base + VIRTIO_MMIO_GUEST_PAGE_SIZE); >> >> + rc = dma_set_mask_and_...
2017 Jan 10
1
[PATCH] virtio_mmio: Set DMA masks appropriately
...interrupt.h> >> #include <linux/io.h> >> @@ -497,6 +498,7 @@ static int virtio_mmio_probe(struct platform_device *pdev) >> struct virtio_mmio_device *vm_dev; >> struct resource *mem; >> unsigned long magic; >> + int rc; >> >> mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); >> if (!mem) >> @@ -548,6 +550,14 @@ static int virtio_mmio_probe(struct platform_device *pdev) >> if (vm_dev->version == 1) >> writel(PAGE_SIZE, vm_dev->base + VIRTIO_MMIO_GUEST_PAGE_SIZE); >> >> + rc = dma_set_mask_and_...
2014 Feb 10
2
[PATCH] drm/nouveau: support for platform devices
...veau_object *object) nouveau_engine_destroy(&device->base); } +resource_size_t +nv_device_resource_start(struct nouveau_device *device, unsigned int bar) +{ + if (nv_device_is_pci(device)) { + return pci_resource_start(device->pdev, bar); + } else { + struct resource *res; + res = platform_get_resource(device->platformdev, + IORESOURCE_MEM, bar); + if (!res) + return 0; + return res->start; + } +} + +resource_size_t +nv_device_resource_len(struct nouveau_device *device, unsigned int bar) +{ + if (nv_device_is_pci(device)) { + return pci_resource_len(device->pdev, bar); + }...
2017 Jan 10
0
[PATCH] virtio_mmio: Set DMA masks appropriately
....h> > #include <linux/interrupt.h> > #include <linux/io.h> > @@ -497,6 +498,7 @@ static int virtio_mmio_probe(struct platform_device *pdev) > struct virtio_mmio_device *vm_dev; > struct resource *mem; > unsigned long magic; > + int rc; > > mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); > if (!mem) > @@ -548,6 +550,14 @@ static int virtio_mmio_probe(struct platform_device *pdev) > if (vm_dev->version == 1) > writel(PAGE_SIZE, vm_dev->base + VIRTIO_MMIO_GUEST_PAGE_SIZE); > > + rc = dma_set_mask_and_coherent(&pdev->d...
2017 Dec 05
0
[PATCH v2 2/2] virtio_mmio: add cleanup for virtio_mmio_remove
...tatic int virtio_mmio_probe(struct platform_device *pdev) static int virtio_mmio_remove(struct platform_device *pdev) { struct virtio_mmio_device *vm_dev = platform_get_drvdata(pdev); + struct resource *mem; unregister_virtio_device(&vm_dev->vdev); + iounmap(vm_dev->base); + mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (mem) + devm_release_mem_region(&pdev->dev, mem->start, + resource_size(mem)); + devm_kfree(&pdev->dev, vm_dev); return 0; } -- 2.9.4
2017 Dec 06
0
[PATCH v3 2/2] virtio_mmio: add cleanup for virtio_mmio_remove
...rivers/virtio/virtio_mmio.c @@ -610,7 +610,13 @@ static int virtio_mmio_probe(struct platform_device *pdev) static int virtio_mmio_remove(struct platform_device *pdev) { struct virtio_mmio_device *vm_dev = platform_get_drvdata(pdev); + struct resource *mem; + iounmap(vm_dev->base); + mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (mem) + devm_release_mem_region(&pdev->dev, mem->start, + resource_size(mem)); unregister_virtio_device(&vm_dev->vdev); return 0; -- 2.9.4
2014 Oct 26
0
[RFC PATCH 1/2] Add a new register offset let interrupt reason available
...t; + > + uint8_t *isr_mem; > }; > > struct virtio_mmio_vq_info { > @@ -443,6 +445,7 @@ static int virtio_mmio_probe(struct platform_device *pdev) > struct virtio_mmio_device *vm_dev; > struct resource *mem; > unsigned long magic; > + int err; > > mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); > if (!mem) > @@ -481,6 +484,15 @@ static int virtio_mmio_probe(struct platform_device *pdev) > return -ENXIO; > } > > + vm_dev->isr_mem = alloc_pages_exact(PAGE_SIZE, GFP_KERNEL|__GFP_ZERO); > + if (vm_dev->isr_mem == NULL) { > + d...
2014 Feb 01
0
[RFC 02/16] drm/nouveau: basic support for platform devices
...veau_object *object) nouveau_engine_destroy(&device->base); } +resource_size_t +nv_device_resource_start(struct nouveau_device *device, unsigned int bar) +{ + if (nv_device_is_pci(device)) { + return pci_resource_start(device->pdev, bar); + } else { + struct resource *res; + res = platform_get_resource(device->platformdev, + IORESOURCE_MEM, bar); + if (!res) + return 0; + return res->start; + } +} + +resource_size_t +nv_device_resource_len(struct nouveau_device *device, unsigned int bar) +{ + if (nv_device_is_pci(device)) { + return pci_resource_len(device->pdev, bar); + }...
2017 Dec 06
4
[PATCH v3 0/2] Add cleanup for virtio_mmio driver
this patchset try to add cleanup for virtio_mmio driver, include virtio_mmio_probe and virtio_mmio_remove weiping zhang (2): virtio_mmio: add cleanup for virtio_mmio_probe virtio_mmio: add cleanup for virtio_mmio_remove drivers/virtio/virtio_mmio.c | 57 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 10 deletions(-) -- 2.9.4
2017 Dec 06
4
[PATCH v3 0/2] Add cleanup for virtio_mmio driver
this patchset try to add cleanup for virtio_mmio driver, include virtio_mmio_probe and virtio_mmio_remove weiping zhang (2): virtio_mmio: add cleanup for virtio_mmio_probe virtio_mmio: add cleanup for virtio_mmio_remove drivers/virtio/virtio_mmio.c | 57 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 10 deletions(-) -- 2.9.4