Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

coresight: Fix memory leak in coresight_alloc_device_name()

The memory leak detector reports:

echo clear > /sys/kernel/debug/kmemleak
modprobe coresight_funnel
rmmod coresight_funnel

# Scan memory leak and report it
echo scan > /sys/kernel/debug/kmemleak
cat /sys/kernel/debug/kmemleak
unreferenced object 0xffff0008020c7200 (size 64):
comm "modprobe", pid 410, jiffies 4295333721
hex dump (first 32 bytes):
d8 da fe 7e 09 00 ff ff e8 2e ff 7e 09 00 ff ff ...~.......~....
b0 6c ff 7e 09 00 ff ff 30 83 00 7f 09 00 ff ff .l.~....0.......
backtrace (crc 4116a690):
kmemleak_alloc+0xd8/0xf8
__kmalloc_node_track_caller_noprof+0x2c8/0x6f0
krealloc_node_align_noprof+0x13c/0x2c8
coresight_alloc_device_name+0xe4/0x158 [coresight]
0xffffd327ecef8394
0xffffd327ecef85ec
amba_probe+0x118/0x1c8
really_probe+0xc8/0x3f0
__driver_probe_device+0x88/0x190
driver_probe_device+0x44/0x120
__driver_attach+0x100/0x238
bus_for_each_dev+0x84/0xf0
driver_attach+0x2c/0x40
bus_add_driver+0x128/0x258
driver_register+0x64/0x138
__amba_driver_register+0x2c/0x48

The memory leak is caused by not freeing the device list that maintains
device indices.

This device list preserves stable device indices across unbind and
rebind device operations, so it does not share the same lifetime as a
device instances and must only be freed when the module is unloaded.

Some modules do not implement a module exit callback because they are
registered using module_platform_driver(). As a result, the device
list cannot be released during module exit for those modules.

Fix this by moving the device list into the core layer. As a general
solution, instead of maintaining a static list in each driver, drivers
now allocate device lists via coresight_allocate_device_list() and
device indices via coresight_allocate_device_idx().

The list is released only when the core module is unloaded by calling
coresight_release_device_list(), avoiding the leak.

Fixes: 0f5f9b6ba9e1 ("coresight: Use platform agnostic names")
Reviewed-by: James Clark <james.clark@linaro.org>
Signed-off-by: Leo Yan <leo.yan@arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20260209-arm_coresight_refactor_dev_register-v4-1-62d6042f76f7@arm.com

authored by

Leo Yan and committed by
Suzuki K Poulose
0289ada4 55bf8be6

+121 -104
+1 -3
drivers/hwtracing/coresight/coresight-catu.c
··· 30 30 #define catu_dbg(x, ...) do {} while (0) 31 31 #endif 32 32 33 - DEFINE_CORESIGHT_DEVLIST(catu_devs, "catu"); 34 - 35 33 struct catu_etr_buf { 36 34 struct tmc_sg_table *catu_table; 37 35 dma_addr_t sladdr; ··· 528 530 if (ret) 529 531 return ret; 530 532 531 - catu_desc.name = coresight_alloc_device_name(&catu_devs, dev); 533 + catu_desc.name = coresight_alloc_device_name("catu", dev); 532 534 if (!catu_desc.name) 533 535 return -ENOMEM; 534 536
+92 -37
drivers/hwtracing/coresight/coresight-core.c
··· 53 53 const u32 coresight_barrier_pkt[4] = {0x7fffffff, 0x7fffffff, 0x7fffffff, 0x7fffffff}; 54 54 EXPORT_SYMBOL_GPL(coresight_barrier_pkt); 55 55 56 + /* List maintains the device index */ 57 + static LIST_HEAD(coresight_dev_idx_list); 58 + 56 59 static const struct cti_assoc_op *cti_assoc_ops; 57 60 58 61 void coresight_set_cti_ops(const struct cti_assoc_op *cti_op) ··· 1441 1438 } 1442 1439 EXPORT_SYMBOL_GPL(coresight_unregister); 1443 1440 1444 - 1445 - /* 1446 - * coresight_search_device_idx - Search the fwnode handle of a device 1447 - * in the given dev_idx list. Must be called with the coresight_mutex held. 1448 - * 1449 - * Returns the index of the entry, when found. Otherwise, -ENOENT. 1450 - */ 1451 - static int coresight_search_device_idx(struct coresight_dev_list *dict, 1452 - struct fwnode_handle *fwnode) 1441 + static struct coresight_dev_list * 1442 + coresight_allocate_device_list(const char *prefix) 1453 1443 { 1454 - int i; 1444 + struct coresight_dev_list *list; 1455 1445 1456 - for (i = 0; i < dict->nr_idx; i++) 1457 - if (dict->fwnode_list[i] == fwnode) 1458 - return i; 1459 - return -ENOENT; 1446 + /* Check if have already allocated */ 1447 + list_for_each_entry(list, &coresight_dev_idx_list, node) { 1448 + if (!strcmp(list->pfx, prefix)) 1449 + return list; 1450 + } 1451 + 1452 + list = kzalloc(sizeof(*list), GFP_KERNEL); 1453 + if (!list) 1454 + return NULL; 1455 + 1456 + list->pfx = kstrdup(prefix, GFP_KERNEL); 1457 + if (!list->pfx) { 1458 + kfree(list); 1459 + return NULL; 1460 + } 1461 + 1462 + list_add(&list->node, &coresight_dev_idx_list); 1463 + return list; 1464 + } 1465 + 1466 + static int coresight_allocate_device_idx(struct coresight_dev_list *list, 1467 + struct device *dev) 1468 + { 1469 + struct fwnode_handle **fwnode_list; 1470 + struct fwnode_handle *fwnode = dev_fwnode(dev); 1471 + int idx; 1472 + 1473 + for (idx = 0; idx < list->nr_idx; idx++) 1474 + if (list->fwnode_list[idx] == fwnode) 1475 + return idx; 1476 + 1477 + /* Make space for the new entry */ 1478 + idx = list->nr_idx; 1479 + fwnode_list = krealloc_array(list->fwnode_list, 1480 + idx + 1, sizeof(*list->fwnode_list), 1481 + GFP_KERNEL); 1482 + if (!fwnode_list) 1483 + return -ENOMEM; 1484 + 1485 + fwnode_list[idx] = fwnode; 1486 + list->fwnode_list = fwnode_list; 1487 + list->nr_idx = idx + 1; 1488 + 1489 + return idx; 1460 1490 } 1461 1491 1462 1492 static bool coresight_compare_type(enum coresight_dev_type type_a, ··· 1563 1527 EXPORT_SYMBOL_GPL(coresight_loses_context_with_cpu); 1564 1528 1565 1529 /* 1566 - * coresight_alloc_device_name - Get an index for a given device in the 1567 - * device index list specific to a driver. An index is allocated for a 1568 - * device and is tracked with the fwnode_handle to prevent allocating 1530 + * coresight_alloc_device_name - Get an index for a given device in the list 1531 + * specific to a driver (presented by the prefix string). An index is allocated 1532 + * for a device and is tracked with the fwnode_handle to prevent allocating 1569 1533 * duplicate indices for the same device (e.g, if we defer probing of 1570 1534 * a device due to dependencies), in case the index is requested again. 1571 1535 */ 1572 - char *coresight_alloc_device_name(struct coresight_dev_list *dict, 1573 - struct device *dev) 1536 + char *coresight_alloc_device_name(const char *prefix, struct device *dev) 1574 1537 { 1575 - int idx; 1538 + struct coresight_dev_list *list; 1576 1539 char *name = NULL; 1577 - struct fwnode_handle **list; 1540 + int idx; 1578 1541 1579 1542 mutex_lock(&coresight_mutex); 1580 1543 1581 - idx = coresight_search_device_idx(dict, dev_fwnode(dev)); 1582 - if (idx < 0) { 1583 - /* Make space for the new entry */ 1584 - idx = dict->nr_idx; 1585 - list = krealloc_array(dict->fwnode_list, 1586 - idx + 1, sizeof(*dict->fwnode_list), 1587 - GFP_KERNEL); 1588 - if (ZERO_OR_NULL_PTR(list)) { 1589 - idx = -ENOMEM; 1590 - goto done; 1591 - } 1544 + list = coresight_allocate_device_list(prefix); 1545 + if (!list) 1546 + goto done; 1592 1547 1593 - list[idx] = dev_fwnode(dev); 1594 - dict->fwnode_list = list; 1595 - dict->nr_idx = idx + 1; 1596 - } 1548 + idx = coresight_allocate_device_idx(list, dev); 1597 1549 1598 - name = devm_kasprintf(dev, GFP_KERNEL, "%s%d", dict->pfx, idx); 1550 + /* 1551 + * If index allocation fails, the device list is not released here; 1552 + * it is instead freed later by coresight_release_device_list() when 1553 + * the coresight_core module is unloaded. 1554 + */ 1555 + if (idx < 0) 1556 + goto done; 1557 + 1558 + name = devm_kasprintf(dev, GFP_KERNEL, "%s%d", list->pfx, idx); 1599 1559 done: 1600 1560 mutex_unlock(&coresight_mutex); 1601 1561 return name; 1602 1562 } 1603 1563 EXPORT_SYMBOL_GPL(coresight_alloc_device_name); 1564 + 1565 + static void coresight_release_device_list(void) 1566 + { 1567 + struct coresight_dev_list *list, *next; 1568 + int i; 1569 + 1570 + /* 1571 + * Here is no need to take coresight_mutex; this is during core module 1572 + * unloading, no race condition with other modules. 1573 + */ 1574 + 1575 + list_for_each_entry_safe(list, next, &coresight_dev_idx_list, node) { 1576 + for (i = 0; i < list->nr_idx; i++) 1577 + list->fwnode_list[i] = NULL; 1578 + list->nr_idx = 0; 1579 + list_del(&list->node); 1580 + 1581 + kfree(list->pfx); 1582 + kfree(list->fwnode_list); 1583 + kfree(list); 1584 + } 1585 + } 1604 1586 1605 1587 const struct bus_type coresight_bustype = { 1606 1588 .name = "coresight", ··· 1693 1639 &coresight_notifier); 1694 1640 etm_perf_exit(); 1695 1641 bus_unregister(&coresight_bustype); 1642 + coresight_release_device_list(); 1696 1643 } 1697 1644 1698 1645 module_init(coresight_init);
+1 -3
drivers/hwtracing/coresight/coresight-ctcu-core.c
··· 19 19 #include "coresight-ctcu.h" 20 20 #include "coresight-priv.h" 21 21 22 - DEFINE_CORESIGHT_DEVLIST(ctcu_devs, "ctcu"); 23 - 24 22 #define ctcu_writel(drvdata, val, offset) __raw_writel((val), drvdata->base + offset) 25 23 #define ctcu_readl(drvdata, offset) __raw_readl(drvdata->base + offset) 26 24 ··· 185 187 void __iomem *base; 186 188 int i, ret; 187 189 188 - desc.name = coresight_alloc_device_name(&ctcu_devs, dev); 190 + desc.name = coresight_alloc_device_name("ctcu", dev); 189 191 if (!desc.name) 190 192 return -ENOMEM; 191 193
+8 -11
drivers/hwtracing/coresight/coresight-cti-core.c
··· 48 48 /* quick lookup list for CPU bound CTIs when power handling */ 49 49 static struct cti_drvdata *cti_cpu_drvdata[NR_CPUS]; 50 50 51 - /* 52 - * CTI naming. CTI bound to cores will have the name cti_cpu<N> where 53 - * N is the CPU ID. System CTIs will have the name cti_sys<I> where I 54 - * is an index allocated by order of discovery. 55 - * 56 - * CTI device name list - for CTI not bound to cores. 57 - */ 58 - DEFINE_CORESIGHT_DEVLIST(cti_sys_devs, "cti_sys"); 59 - 60 51 /* write set of regs to hardware - call with spinlock claimed */ 61 52 void cti_write_all_hw_regs(struct cti_drvdata *drvdata) 62 53 { ··· 880 889 /* default to powered - could change on PM notifications */ 881 890 drvdata->config.hw_powered = true; 882 891 883 - /* set up device name - will depend if cpu bound or otherwise */ 892 + /* 893 + * Set up device name - will depend if cpu bound or otherwise. 894 + * 895 + * CTI bound to cores will have the name cti_cpu<N> where N is th 896 + * eCPU ID. System CTIs will have the name cti_sys<I> where I is an 897 + * index allocated by order of discovery. 898 + */ 884 899 if (drvdata->ctidev.cpu >= 0) 885 900 cti_desc.name = devm_kasprintf(dev, GFP_KERNEL, "cti_cpu%d", 886 901 drvdata->ctidev.cpu); 887 902 else 888 - cti_desc.name = coresight_alloc_device_name(&cti_sys_devs, dev); 903 + cti_desc.name = coresight_alloc_device_name("cti_sys", dev); 889 904 if (!cti_desc.name) 890 905 return -ENOMEM; 891 906
+2 -5
drivers/hwtracing/coresight/coresight-dummy.c
··· 19 19 u8 traceid; 20 20 }; 21 21 22 - DEFINE_CORESIGHT_DEVLIST(source_devs, "dummy_source"); 23 - DEFINE_CORESIGHT_DEVLIST(sink_devs, "dummy_sink"); 24 - 25 22 static int dummy_source_enable(struct coresight_device *csdev, 26 23 struct perf_event *event, enum cs_mode mode, 27 24 __maybe_unused struct coresight_path *path) ··· 123 126 124 127 if (of_device_is_compatible(node, "arm,coresight-dummy-source")) { 125 128 126 - desc.name = coresight_alloc_device_name(&source_devs, dev); 129 + desc.name = coresight_alloc_device_name("dummy_source", dev); 127 130 if (!desc.name) 128 131 return -ENOMEM; 129 132 ··· 152 155 drvdata->traceid = (u8)trace_id; 153 156 154 157 } else if (of_device_is_compatible(node, "arm,coresight-dummy-sink")) { 155 - desc.name = coresight_alloc_device_name(&sink_devs, dev); 158 + desc.name = coresight_alloc_device_name("dummy_sink", dev); 156 159 if (!desc.name) 157 160 return -ENOMEM; 158 161
+1 -3
drivers/hwtracing/coresight/coresight-etb10.c
··· 63 63 #define ETB_FFSR_BIT 1 64 64 #define ETB_FRAME_SIZE_WORDS 4 65 65 66 - DEFINE_CORESIGHT_DEVLIST(etb_devs, "etb"); 67 - 68 66 /** 69 67 * struct etb_drvdata - specifics associated to an ETB component 70 68 * @base: memory mapped base address for this component. ··· 720 722 struct resource *res = &adev->res; 721 723 struct coresight_desc desc = { 0 }; 722 724 723 - desc.name = coresight_alloc_device_name(&etb_devs, dev); 725 + desc.name = coresight_alloc_device_name("etb", dev); 724 726 if (!desc.name) 725 727 return -ENOMEM; 726 728
+1 -3
drivers/hwtracing/coresight/coresight-funnel.c
··· 30 30 #define FUNNEL_HOLDTIME (0x7 << FUNNEL_HOLDTIME_SHFT) 31 31 #define FUNNEL_ENSx_MASK 0xff 32 32 33 - DEFINE_CORESIGHT_DEVLIST(funnel_devs, "funnel"); 34 - 35 33 /** 36 34 * struct funnel_drvdata - specifics associated to a funnel component 37 35 * @base: memory mapped base address for this component. ··· 221 223 of_device_is_compatible(dev->of_node, "arm,coresight-funnel")) 222 224 dev_warn_once(dev, "Uses OBSOLETE CoreSight funnel binding\n"); 223 225 224 - desc.name = coresight_alloc_device_name(&funnel_devs, dev); 226 + desc.name = coresight_alloc_device_name("funnel", dev); 225 227 if (!desc.name) 226 228 return -ENOMEM; 227 229
+1 -3
drivers/hwtracing/coresight/coresight-replicator.c
··· 24 24 #define REPLICATOR_IDFILTER0 0x000 25 25 #define REPLICATOR_IDFILTER1 0x004 26 26 27 - DEFINE_CORESIGHT_DEVLIST(replicator_devs, "replicator"); 28 - 29 27 /** 30 28 * struct replicator_drvdata - specifics associated to a replicator component 31 29 * @base: memory mapped base address for this component. Also indicates ··· 228 230 dev_warn_once(dev, 229 231 "Uses OBSOLETE CoreSight replicator binding\n"); 230 232 231 - desc.name = coresight_alloc_device_name(&replicator_devs, dev); 233 + desc.name = coresight_alloc_device_name("replicator", dev); 232 234 if (!desc.name) 233 235 return -ENOMEM; 234 236
+1 -3
drivers/hwtracing/coresight/coresight-stm.c
··· 110 110 unsigned long *guaranteed; 111 111 }; 112 112 113 - DEFINE_CORESIGHT_DEVLIST(stm_devs, "stm"); 114 - 115 113 /** 116 114 * struct stm_drvdata - specifics associated to an STM component 117 115 * @base: memory mapped base address for this component. ··· 832 834 struct resource ch_res; 833 835 struct coresight_desc desc = { 0 }; 834 836 835 - desc.name = coresight_alloc_device_name(&stm_devs, dev); 837 + desc.name = coresight_alloc_device_name("stm", dev); 836 838 if (!desc.name) 837 839 return -ENOMEM; 838 840
+4 -8
drivers/hwtracing/coresight/coresight-tmc-core.c
··· 32 32 #include "coresight-priv.h" 33 33 #include "coresight-tmc.h" 34 34 35 - DEFINE_CORESIGHT_DEVLIST(etb_devs, "tmc_etb"); 36 - DEFINE_CORESIGHT_DEVLIST(etf_devs, "tmc_etf"); 37 - DEFINE_CORESIGHT_DEVLIST(etr_devs, "tmc_etr"); 38 - 39 35 int tmc_wait_for_tmcready(struct tmc_drvdata *drvdata) 40 36 { 41 37 struct coresight_device *csdev = drvdata->csdev; ··· 773 777 struct coresight_platform_data *pdata = NULL; 774 778 struct tmc_drvdata *drvdata; 775 779 struct coresight_desc desc = { 0 }; 776 - struct coresight_dev_list *dev_list = NULL; 780 + const char *dev_list = NULL; 777 781 778 782 drvdata = devm_kzalloc(dev, sizeof(*drvdata), GFP_KERNEL); 779 783 if (!drvdata) ··· 823 827 desc.type = CORESIGHT_DEV_TYPE_SINK; 824 828 desc.subtype.sink_subtype = CORESIGHT_DEV_SUBTYPE_SINK_BUFFER; 825 829 desc.ops = &tmc_etb_cs_ops; 826 - dev_list = &etb_devs; 830 + dev_list = "tmc_etb"; 827 831 break; 828 832 case TMC_CONFIG_TYPE_ETR: 829 833 desc.groups = coresight_etr_groups; ··· 835 839 goto out; 836 840 idr_init(&drvdata->idr); 837 841 mutex_init(&drvdata->idr_mutex); 838 - dev_list = &etr_devs; 842 + dev_list = "tmc_etr"; 839 843 break; 840 844 case TMC_CONFIG_TYPE_ETF: 841 845 desc.groups = coresight_etf_groups; ··· 843 847 desc.subtype.sink_subtype = CORESIGHT_DEV_SUBTYPE_SINK_BUFFER; 844 848 desc.subtype.link_subtype = CORESIGHT_DEV_SUBTYPE_LINK_FIFO; 845 849 desc.ops = &tmc_etf_cs_ops; 846 - dev_list = &etf_devs; 850 + dev_list = "tmc_etf"; 847 851 break; 848 852 default: 849 853 pr_err("%s: Unsupported TMC config\n", desc.name);
+1 -3
drivers/hwtracing/coresight/coresight-tnoc.c
··· 47 47 int atid; 48 48 }; 49 49 50 - DEFINE_CORESIGHT_DEVLIST(trace_noc_devs, "traceNoc"); 51 - 52 50 static void trace_noc_enable_hw(struct trace_noc_drvdata *drvdata) 53 51 { 54 52 u32 val; ··· 189 191 struct coresight_desc desc = { 0 }; 190 192 int ret; 191 193 192 - desc.name = coresight_alloc_device_name(&trace_noc_devs, dev); 194 + desc.name = coresight_alloc_device_name("traceNoc", dev); 193 195 if (!desc.name) 194 196 return -ENOMEM; 195 197
+1 -3
drivers/hwtracing/coresight/coresight-tpda.c
··· 20 20 #include "coresight-trace-id.h" 21 21 #include "coresight-tpdm.h" 22 22 23 - DEFINE_CORESIGHT_DEVLIST(tpda_devs, "tpda"); 24 - 25 23 static void tpda_clear_element_size(struct coresight_device *csdev) 26 24 { 27 25 struct tpda_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); ··· 583 585 if (ret) 584 586 return ret; 585 587 586 - desc.name = coresight_alloc_device_name(&tpda_devs, dev); 588 + desc.name = coresight_alloc_device_name("tpda", dev); 587 589 if (!desc.name) 588 590 return -ENOMEM; 589 591 desc.type = CORESIGHT_DEV_TYPE_LINK;
+1 -3
drivers/hwtracing/coresight/coresight-tpdm.c
··· 19 19 #include "coresight-priv.h" 20 20 #include "coresight-tpdm.h" 21 21 22 - DEFINE_CORESIGHT_DEVLIST(tpdm_devs, "tpdm"); 23 - 24 22 static bool tpdm_has_dsb_dataset(struct tpdm_drvdata *drvdata) 25 23 { 26 24 return (drvdata->datasets & TPDM_PIDR0_DS_DSB); ··· 1414 1416 } 1415 1417 1416 1418 /* Set up coresight component description */ 1417 - desc.name = coresight_alloc_device_name(&tpdm_devs, dev); 1419 + desc.name = coresight_alloc_device_name("tpdm", dev); 1418 1420 if (!desc.name) 1419 1421 return -ENOMEM; 1420 1422 desc.type = CORESIGHT_DEV_TYPE_SOURCE;
+1 -3
drivers/hwtracing/coresight/coresight-tpiu.c
··· 49 49 #define FFCR_FON_MAN BIT(6) 50 50 #define FFCR_STOP_FI BIT(12) 51 51 52 - DEFINE_CORESIGHT_DEVLIST(tpiu_devs, "tpiu"); 53 - 54 52 /* 55 53 * @base: memory mapped base address for this component. 56 54 * @atclk: optional clock for the core parts of the TPIU. ··· 132 134 struct coresight_desc desc = { 0 }; 133 135 int ret; 134 136 135 - desc.name = coresight_alloc_device_name(&tpiu_devs, dev); 137 + desc.name = coresight_alloc_device_name("tpiu", dev); 136 138 if (!desc.name) 137 139 return -ENOMEM; 138 140
+1 -3
drivers/hwtracing/coresight/ultrasoc-smb.c
··· 17 17 #include "coresight-priv.h" 18 18 #include "ultrasoc-smb.h" 19 19 20 - DEFINE_CORESIGHT_DEVLIST(sink_devs, "ultra_smb"); 21 - 22 20 #define ULTRASOC_SMB_DSM_UUID "82ae1283-7f6a-4cbe-aa06-53e8fb24db18" 23 21 24 22 static bool smb_buffer_not_empty(struct smb_drv_data *drvdata) ··· 476 478 desc.pdata = pdata; 477 479 desc.dev = &pdev->dev; 478 480 desc.groups = smb_sink_groups; 479 - desc.name = coresight_alloc_device_name(&sink_devs, &pdev->dev); 481 + desc.name = coresight_alloc_device_name("ultra_smb", &pdev->dev); 480 482 if (!desc.name) { 481 483 dev_err(&pdev->dev, "Failed to alloc coresight device name"); 482 484 return -ENOMEM;
+4 -10
include/linux/coresight.h
··· 306 306 * coresight_dev_list - Mapping for devices to "name" index for device 307 307 * names. 308 308 * 309 + * @node: Node on the global device index list. 309 310 * @nr_idx: Number of entries already allocated. 310 311 * @pfx: Prefix pattern for device name. 311 312 * @fwnode_list: Array of fwnode_handles associated with each allocated 312 313 * index, upto nr_idx entries. 313 314 */ 314 315 struct coresight_dev_list { 316 + struct list_head node; 315 317 int nr_idx; 316 - const char *pfx; 318 + char *pfx; 317 319 struct fwnode_handle **fwnode_list; 318 320 }; 319 - 320 - #define DEFINE_CORESIGHT_DEVLIST(var, dev_pfx) \ 321 - static struct coresight_dev_list (var) = { \ 322 - .pfx = dev_pfx, \ 323 - .nr_idx = 0, \ 324 - .fwnode_list = NULL, \ 325 - } 326 321 327 322 #define to_coresight_device(d) container_of(d, struct coresight_device, dev) 328 323 ··· 658 663 void coresight_clear_self_claim_tag_unlocked(struct csdev_access *csa); 659 664 void coresight_disclaim_device(struct coresight_device *csdev); 660 665 void coresight_disclaim_device_unlocked(struct coresight_device *csdev); 661 - char *coresight_alloc_device_name(struct coresight_dev_list *devs, 662 - struct device *dev); 666 + char *coresight_alloc_device_name(const char *prefix, struct device *dev); 663 667 664 668 bool coresight_loses_context_with_cpu(struct device *dev); 665 669