aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/soc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-09 17:48:22 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-09 17:48:22 -0500
commit3a647c1d7ab08145cee4b650f5e797d168846c51 (patch)
tree6fcbc8ad1fc69b5a99214e22f6084452bdf0131c /drivers/soc
parent6cd94d5e57ab97ddd672b707ab4bb639672c1727 (diff)
parent5db45002576f7d60c5bf7b23e277845cd3e806be (diff)
Merge tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC driver updates from Arnd Bergmann: "These are changes for drivers that are intimately tied to some SoC and for some reason could not get merged through the respective subsystem maintainer tree. The largest single change here this time around is the Tegra iommu/memory controller driver, which gets updated to the new iommu DT binding. More drivers like this are likely to follow for the following merge window, but we should be able to do those through the iommu maintainer. Other notable changes are: - reset controller drivers from the reset maintainer (socfpga, sti, berlin) - fixes for the keystone navigator driver merged last time - at91 rtc driver changes related to the at91 cleanups - ARM perf driver changes from Will Deacon - updates for the brcmstb_gisb driver" * tag 'drivers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (53 commits) clocksource: arch_timer: Allow the device tree to specify uninitialized timer registers clocksource: arch_timer: Fix code to use physical timers when requested memory: Add NVIDIA Tegra memory controller support bus: brcmstb_gisb: Add register offset tables for older chips bus: brcmstb_gisb: Look up register offsets in a table bus: brcmstb_gisb: Introduce wrapper functions for MMIO accesses bus: brcmstb_gisb: Make the driver buildable on MIPS of: Add NVIDIA Tegra memory controller binding ARM: tegra: Move AHB Kconfig to drivers/amba amba: Add Kconfig file clk: tegra: Implement memory-controller clock serial: samsung: Fix serial config dependencies for exynos7 bus: brcmstb_gisb: resolve section mismatch ARM: common: edma: edma_pm_resume may be unused ARM: common: edma: add suspend resume hook powerpc/iommu: Rename iommu_[un]map_sg functions rtc: at91sam9: add DT bindings documentation rtc: at91sam9: use clk API instead of relying on AT91_SLOW_CLOCK ARM: at91: add clk_lookup entry for RTT devices rtc: at91sam9: rework the Kconfig description ...
Diffstat (limited to 'drivers/soc')
-rw-r--r--drivers/soc/ti/knav_qmss.h8
-rw-r--r--drivers/soc/ti/knav_qmss_queue.c13
2 files changed, 11 insertions, 10 deletions
diff --git a/drivers/soc/ti/knav_qmss.h b/drivers/soc/ti/knav_qmss.h
index bc9dcc8cc3ce..51da2341280d 100644
--- a/drivers/soc/ti/knav_qmss.h
+++ b/drivers/soc/ti/knav_qmss.h
@@ -348,15 +348,15 @@ struct knav_range_info {
348 list_for_each_entry(region, &kdev->regions, list) 348 list_for_each_entry(region, &kdev->regions, list)
349 349
350#define first_region(kdev) \ 350#define first_region(kdev) \
351 list_first_entry(&kdev->regions, \ 351 list_first_entry_or_null(&kdev->regions, \
352 struct knav_region, list) 352 struct knav_region, list)
353 353
354#define for_each_queue_range(kdev, range) \ 354#define for_each_queue_range(kdev, range) \
355 list_for_each_entry(range, &kdev->queue_ranges, list) 355 list_for_each_entry(range, &kdev->queue_ranges, list)
356 356
357#define first_queue_range(kdev) \ 357#define first_queue_range(kdev) \
358 list_first_entry(&kdev->queue_ranges, \ 358 list_first_entry_or_null(&kdev->queue_ranges, \
359 struct knav_range_info, list) 359 struct knav_range_info, list)
360 360
361#define for_each_pool(kdev, pool) \ 361#define for_each_pool(kdev, pool) \
362 list_for_each_entry(pool, &kdev->pools, list) 362 list_for_each_entry(pool, &kdev->pools, list)
diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c
index 0a2c8634c48b..9b8dd6732681 100644
--- a/drivers/soc/ti/knav_qmss_queue.c
+++ b/drivers/soc/ti/knav_qmss_queue.c
@@ -785,7 +785,7 @@ void *knav_pool_create(const char *name,
785 dev_err(kdev->dev, "out of descs in region(%d) for pool(%s)\n", 785 dev_err(kdev->dev, "out of descs in region(%d) for pool(%s)\n",
786 region_id, name); 786 region_id, name);
787 ret = -ENOMEM; 787 ret = -ENOMEM;
788 goto err; 788 goto err_unlock;
789 } 789 }
790 790
791 /* Region maintains a sorted (by region offset) list of pools 791 /* Region maintains a sorted (by region offset) list of pools
@@ -815,15 +815,16 @@ void *knav_pool_create(const char *name,
815 dev_err(kdev->dev, "pool(%s) create failed: fragmented desc pool in region(%d)\n", 815 dev_err(kdev->dev, "pool(%s) create failed: fragmented desc pool in region(%d)\n",
816 name, region_id); 816 name, region_id);
817 ret = -ENOMEM; 817 ret = -ENOMEM;
818 goto err; 818 goto err_unlock;
819 } 819 }
820 820
821 mutex_unlock(&knav_dev_lock); 821 mutex_unlock(&knav_dev_lock);
822 kdesc_fill_pool(pool); 822 kdesc_fill_pool(pool);
823 return pool; 823 return pool;
824 824
825err: 825err_unlock:
826 mutex_unlock(&knav_dev_lock); 826 mutex_unlock(&knav_dev_lock);
827err:
827 kfree(pool->name); 828 kfree(pool->name);
828 devm_kfree(kdev->dev, pool); 829 devm_kfree(kdev->dev, pool);
829 return ERR_PTR(ret); 830 return ERR_PTR(ret);
@@ -1305,14 +1306,14 @@ static void knav_free_queue_ranges(struct knav_device *kdev)
1305static void knav_queue_free_regions(struct knav_device *kdev) 1306static void knav_queue_free_regions(struct knav_device *kdev)
1306{ 1307{
1307 struct knav_region *region; 1308 struct knav_region *region;
1308 struct knav_pool *pool; 1309 struct knav_pool *pool, *tmp;
1309 unsigned size; 1310 unsigned size;
1310 1311
1311 for (;;) { 1312 for (;;) {
1312 region = first_region(kdev); 1313 region = first_region(kdev);
1313 if (!region) 1314 if (!region)
1314 break; 1315 break;
1315 list_for_each_entry(pool, &region->pools, region_inst) 1316 list_for_each_entry_safe(pool, tmp, &region->pools, region_inst)
1316 knav_pool_destroy(pool); 1317 knav_pool_destroy(pool);
1317 1318
1318 size = region->virt_end - region->virt_start; 1319 size = region->virt_end - region->virt_start;
@@ -1639,7 +1640,7 @@ static int knav_queue_init_queues(struct knav_device *kdev)
1639 size = (1 << kdev->inst_shift) * kdev->num_queues_in_use; 1640 size = (1 << kdev->inst_shift) * kdev->num_queues_in_use;
1640 kdev->instances = devm_kzalloc(kdev->dev, size, GFP_KERNEL); 1641 kdev->instances = devm_kzalloc(kdev->dev, size, GFP_KERNEL);
1641 if (!kdev->instances) 1642 if (!kdev->instances)
1642 return -1; 1643 return -ENOMEM;
1643 1644
1644 for_each_queue_range(kdev, range) { 1645 for_each_queue_range(kdev, range) {
1645 if (range->ops && range->ops->init_range) 1646 if (range->ops && range->ops->init_range)