diff options
| -rw-r--r-- | drivers/remoteproc/remoteproc_core.c | 27 | ||||
| -rw-r--r-- | drivers/remoteproc/remoteproc_internal.h | 2 |
2 files changed, 10 insertions, 19 deletions
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 11cdb119e4f3..e991512e04ed 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c | |||
| @@ -132,8 +132,6 @@ static void rproc_disable_iommu(struct rproc *rproc) | |||
| 132 | 132 | ||
| 133 | iommu_detach_device(domain, dev); | 133 | iommu_detach_device(domain, dev); |
| 134 | iommu_domain_free(domain); | 134 | iommu_domain_free(domain); |
| 135 | |||
| 136 | return; | ||
| 137 | } | 135 | } |
| 138 | 136 | ||
| 139 | /* | 137 | /* |
| @@ -411,10 +409,8 @@ static int rproc_handle_trace(struct rproc *rproc, struct fw_rsc_trace *rsc, | |||
| 411 | } | 409 | } |
| 412 | 410 | ||
| 413 | trace = kzalloc(sizeof(*trace), GFP_KERNEL); | 411 | trace = kzalloc(sizeof(*trace), GFP_KERNEL); |
| 414 | if (!trace) { | 412 | if (!trace) |
| 415 | dev_err(dev, "kzalloc trace failed\n"); | ||
| 416 | return -ENOMEM; | 413 | return -ENOMEM; |
| 417 | } | ||
| 418 | 414 | ||
| 419 | /* set the trace buffer dma properties */ | 415 | /* set the trace buffer dma properties */ |
| 420 | trace->len = rsc->len; | 416 | trace->len = rsc->len; |
| @@ -489,10 +485,8 @@ static int rproc_handle_devmem(struct rproc *rproc, struct fw_rsc_devmem *rsc, | |||
| 489 | } | 485 | } |
| 490 | 486 | ||
| 491 | mapping = kzalloc(sizeof(*mapping), GFP_KERNEL); | 487 | mapping = kzalloc(sizeof(*mapping), GFP_KERNEL); |
| 492 | if (!mapping) { | 488 | if (!mapping) |
| 493 | dev_err(dev, "kzalloc mapping failed\n"); | ||
| 494 | return -ENOMEM; | 489 | return -ENOMEM; |
| 495 | } | ||
| 496 | 490 | ||
| 497 | ret = iommu_map(rproc->domain, rsc->da, rsc->pa, rsc->len, rsc->flags); | 491 | ret = iommu_map(rproc->domain, rsc->da, rsc->pa, rsc->len, rsc->flags); |
| 498 | if (ret) { | 492 | if (ret) { |
| @@ -565,10 +559,8 @@ static int rproc_handle_carveout(struct rproc *rproc, | |||
| 565 | rsc->da, rsc->pa, rsc->len, rsc->flags); | 559 | rsc->da, rsc->pa, rsc->len, rsc->flags); |
| 566 | 560 | ||
| 567 | carveout = kzalloc(sizeof(*carveout), GFP_KERNEL); | 561 | carveout = kzalloc(sizeof(*carveout), GFP_KERNEL); |
| 568 | if (!carveout) { | 562 | if (!carveout) |
| 569 | dev_err(dev, "kzalloc carveout failed\n"); | ||
| 570 | return -ENOMEM; | 563 | return -ENOMEM; |
| 571 | } | ||
| 572 | 564 | ||
| 573 | va = dma_alloc_coherent(dev->parent, rsc->len, &dma, GFP_KERNEL); | 565 | va = dma_alloc_coherent(dev->parent, rsc->len, &dma, GFP_KERNEL); |
| 574 | if (!va) { | 566 | if (!va) { |
| @@ -768,7 +760,8 @@ static void rproc_resource_cleanup(struct rproc *rproc) | |||
| 768 | 760 | ||
| 769 | /* clean up carveout allocations */ | 761 | /* clean up carveout allocations */ |
| 770 | list_for_each_entry_safe(entry, tmp, &rproc->carveouts, node) { | 762 | list_for_each_entry_safe(entry, tmp, &rproc->carveouts, node) { |
| 771 | dma_free_coherent(dev->parent, entry->len, entry->va, entry->dma); | 763 | dma_free_coherent(dev->parent, entry->len, entry->va, |
| 764 | entry->dma); | ||
| 772 | list_del(&entry->node); | 765 | list_del(&entry->node); |
| 773 | kfree(entry); | 766 | kfree(entry); |
| 774 | } | 767 | } |
| @@ -808,9 +801,8 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw) | |||
| 808 | 801 | ||
| 809 | /* look for the resource table */ | 802 | /* look for the resource table */ |
| 810 | table = rproc_find_rsc_table(rproc, fw, &tablesz); | 803 | table = rproc_find_rsc_table(rproc, fw, &tablesz); |
| 811 | if (!table) { | 804 | if (!table) |
| 812 | goto clean_up; | 805 | goto clean_up; |
| 813 | } | ||
| 814 | 806 | ||
| 815 | /* Verify that resource table in loaded fw is unchanged */ | 807 | /* Verify that resource table in loaded fw is unchanged */ |
| 816 | if (rproc->table_csum != crc32(0, table, tablesz)) { | 808 | if (rproc->table_csum != crc32(0, table, tablesz)) { |
| @@ -911,7 +903,8 @@ static void rproc_fw_config_virtio(const struct firmware *fw, void *context) | |||
| 911 | 903 | ||
| 912 | /* count the number of notify-ids */ | 904 | /* count the number of notify-ids */ |
| 913 | rproc->max_notifyid = -1; | 905 | rproc->max_notifyid = -1; |
| 914 | ret = rproc_handle_resources(rproc, tablesz, rproc_count_vrings_handler); | 906 | ret = rproc_handle_resources(rproc, tablesz, |
| 907 | rproc_count_vrings_handler); | ||
| 915 | if (ret) | 908 | if (ret) |
| 916 | goto out; | 909 | goto out; |
| 917 | 910 | ||
| @@ -1268,10 +1261,8 @@ struct rproc *rproc_alloc(struct device *dev, const char *name, | |||
| 1268 | name_len = strlen(name) + strlen(template) - 2 + 1; | 1261 | name_len = strlen(name) + strlen(template) - 2 + 1; |
| 1269 | 1262 | ||
| 1270 | rproc = kzalloc(sizeof(struct rproc) + len + name_len, GFP_KERNEL); | 1263 | rproc = kzalloc(sizeof(struct rproc) + len + name_len, GFP_KERNEL); |
| 1271 | if (!rproc) { | 1264 | if (!rproc) |
| 1272 | dev_err(dev, "%s: kzalloc failed\n", __func__); | ||
| 1273 | return NULL; | 1265 | return NULL; |
| 1274 | } | ||
| 1275 | 1266 | ||
| 1276 | if (!firmware) { | 1267 | if (!firmware) { |
| 1277 | p = (char *)rproc + sizeof(struct rproc) + len; | 1268 | p = (char *)rproc + sizeof(struct rproc) + len; |
diff --git a/drivers/remoteproc/remoteproc_internal.h b/drivers/remoteproc/remoteproc_internal.h index 70701a50ddfa..8041b95cb058 100644 --- a/drivers/remoteproc/remoteproc_internal.h +++ b/drivers/remoteproc/remoteproc_internal.h | |||
| @@ -35,7 +35,7 @@ struct rproc; | |||
| 35 | * @get_boot_addr: get boot address to entry point specified in firmware | 35 | * @get_boot_addr: get boot address to entry point specified in firmware |
| 36 | */ | 36 | */ |
| 37 | struct rproc_fw_ops { | 37 | struct rproc_fw_ops { |
| 38 | struct resource_table *(*find_rsc_table) (struct rproc *rproc, | 38 | struct resource_table *(*find_rsc_table)(struct rproc *rproc, |
| 39 | const struct firmware *fw, | 39 | const struct firmware *fw, |
| 40 | int *tablesz); | 40 | int *tablesz); |
| 41 | struct resource_table *(*find_loaded_rsc_table)(struct rproc *rproc, | 41 | struct resource_table *(*find_loaded_rsc_table)(struct rproc *rproc, |
