We are about to use a name independent of the parent AMBA device name. As such, there is no need to have it in the platform description. Let us move this to coresight description instead.
Unified · Split
| @@ -551,6 +551,8 @@ static int catu_probe(struct amba_device *adev, const struct amba_id *id) · 550 unmodified lines | ||
| 551 | 551 | catu_desc.type = CORESIGHT_DEV_TYPE_HELPER; |
| 552 | 552 | catu_desc.subtype.helper_subtype = CORESIGHT_DEV_SUBTYPE_HELPER_CATU; |
| 553 | 553 | catu_desc.ops = &catu_ops; |
| 554 | + catu_desc.name = dev_name(dev); | |
| 555 | + | |
| 554 | 556 | drvdata->csdev = coresight_register(&catu_desc); |
| 555 | 557 | if (IS_ERR(drvdata->csdev)) |
| 556 | 558 | ret = PTR_ERR(drvdata->csdev); |
| @@ -777,12 +777,13 @@ static int etb_probe(struct amba_device *adev, const struct amba_id *id) · 776 unmodified lines | ||
| 777 | 777 | desc.ops = &etb_cs_ops; |
| 778 | 778 | desc.pdata = pdata; |
| 779 | 779 | desc.dev = dev; |
| 780 | + desc.name = dev_name(dev); | |
| 780 | 781 | desc.groups = coresight_etb_groups; |
| 781 | 782 | drvdata->csdev = coresight_register(&desc); |
| 782 | 783 | if (IS_ERR(drvdata->csdev)) |
| 783 | 784 | return PTR_ERR(drvdata->csdev); |
| 784 | 785 | |
| 785 | − drvdata->miscdev.name = pdata->name; | |
| 786 | + drvdata->miscdev.name = desc.name; | |
| 786 | 787 | drvdata->miscdev.minor = MISC_DYNAMIC_MINOR; |
| 787 | 788 | drvdata->miscdev.fops = &etb_fops; |
| 788 | 789 | ret = misc_register(&drvdata->miscdev); |
| @@ -854,6 +854,7 @@ static int etm_probe(struct amba_device *adev, const struct amba_id *id) · 853 unmodified lines | ||
| 854 | 854 | desc.ops = &etm_cs_ops; |
| 855 | 855 | desc.pdata = pdata; |
| 856 | 856 | desc.dev = dev; |
| 857 | + desc.name = dev_name(dev); | |
| 857 | 858 | desc.groups = coresight_etm_groups; |
| 858 | 859 | drvdata->csdev = coresight_register(&desc); |
| 859 | 860 | if (IS_ERR(drvdata->csdev)) { |
| @@ -1142,6 +1142,7 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id) · 1141 unmodified lines | ||
| 1142 | 1142 | desc.pdata = pdata; |
| 1143 | 1143 | desc.dev = dev; |
| 1144 | 1144 | desc.groups = coresight_etmv4_groups; |
| 1145 | + desc.name = dev_name(dev); | |
| 1145 | 1146 | drvdata->csdev = coresight_register(&desc); |
| 1146 | 1147 | if (IS_ERR(drvdata->csdev)) { |
| 1147 | 1148 | ret = PTR_ERR(drvdata->csdev); |
| @@ -229,6 +229,7 @@ static int funnel_probe(struct device *dev, struct resource *res) · 228 unmodified lines | ||
| 229 | 229 | desc.ops = &funnel_cs_ops; |
| 230 | 230 | desc.pdata = pdata; |
| 231 | 231 | desc.dev = dev; |
| 232 | + desc.name = dev_name(dev); | |
| 232 | 233 | drvdata->csdev = coresight_register(&desc); |
| 233 | 234 | if (IS_ERR(drvdata->csdev)) { |
| 234 | 235 | ret = PTR_ERR(drvdata->csdev); |
| @@ -323,9 +323,6 @@ coresight_get_platform_data(struct device *dev) · 322 unmodified lines | ||
| 323 | 323 | goto error; |
| 324 | 324 | } |
| 325 | 325 | |
| 326 | − /* Use device name as sysfs handle */ | |
| 327 | − pdata->name = dev_name(dev); | |
| 328 | − | |
| 329 | 326 | if (is_of_node(fwnode)) |
| 330 | 327 | ret = of_get_coresight_platform_data(dev, pdata); |
| 331 | 328 | |
| @@ -220,6 +220,8 @@ static int replicator_probe(struct device *dev, struct resource *res) · 219 unmodified lines | ||
| 220 | 220 | desc.ops = &replicator_cs_ops; |
| 221 | 221 | desc.pdata = dev->platform_data; |
| 222 | 222 | desc.dev = dev; |
| 223 | + desc.name = dev_name(dev); | |
| 224 | + | |
| 223 | 225 | drvdata->csdev = coresight_register(&desc); |
| 224 | 226 | if (IS_ERR(drvdata->csdev)) { |
| 225 | 227 | ret = PTR_ERR(drvdata->csdev); |
| @@ -871,6 +871,7 @@ static int stm_probe(struct amba_device *adev, const struct amba_id *id) · 870 unmodified lines | ||
| 871 | 871 | desc.ops = &stm_cs_ops; |
| 872 | 872 | desc.pdata = pdata; |
| 873 | 873 | desc.dev = dev; |
| 874 | + desc.name = dev_name(dev); | |
| 874 | 875 | desc.groups = coresight_stm_groups; |
| 875 | 876 | drvdata->csdev = coresight_register(&desc); |
| 876 | 877 | if (IS_ERR(drvdata->csdev)) { |
| @@ -437,6 +437,7 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) · 436 unmodified lines | ||
| 437 | 437 | desc.pdata = pdata; |
| 438 | 438 | desc.dev = dev; |
| 439 | 439 | desc.groups = coresight_tmc_groups; |
| 440 | + desc.name = dev_name(dev); | |
| 440 | 441 | |
| 441 | 442 | switch (drvdata->config_type) { |
| 442 | 443 | case TMC_CONFIG_TYPE_ETB: |
| @@ -461,7 +462,7 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) · 18 unmodified lines | ||
| 461 | 462 | desc.ops = &tmc_etf_cs_ops; |
| 462 | 463 | break; |
| 463 | 464 | default: |
| 464 | − pr_err("%s: Unsupported TMC config\n", pdata->name); | |
| 465 | + pr_err("%s: Unsupported TMC config\n", desc.name); | |
| 465 | 466 | ret = -EINVAL; |
| 466 | 467 | goto out; |
| 467 | 468 | } |
| @@ -472,7 +473,7 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) · 4 unmodified lines | ||
| 472 | 473 | goto out; |
| 473 | 474 | } |
| 474 | 475 | |
| 475 | − drvdata->miscdev.name = pdata->name; | |
| 476 | + drvdata->miscdev.name = desc.name; | |
| 476 | 477 | drvdata->miscdev.minor = MISC_DYNAMIC_MINOR; |
| 477 | 478 | drvdata->miscdev.fops = &tmc_fops; |
| 478 | 479 | ret = misc_register(&drvdata->miscdev); |
| @@ -157,6 +157,7 @@ static int tpiu_probe(struct amba_device *adev, const struct amba_id *id) · 156 unmodified lines | ||
| 157 | 157 | desc.ops = &tpiu_cs_ops; |
| 158 | 158 | desc.pdata = pdata; |
| 159 | 159 | desc.dev = dev; |
| 160 | + desc.name = dev_name(dev); | |
| 160 | 161 | drvdata->csdev = coresight_register(&desc); |
| 161 | 162 | |
| 162 | 163 | if (!IS_ERR(drvdata->csdev)) { |
| @@ -1199,7 +1199,7 @@ struct coresight_device *coresight_register(struct coresight_desc *desc) · 1198 unmodified lines | ||
| 1199 | 1199 | csdev->dev.parent = desc->dev; |
| 1200 | 1200 | csdev->dev.release = coresight_device_release; |
| 1201 | 1201 | csdev->dev.bus = &coresight_bustype; |
| 1202 | − dev_set_name(&csdev->dev, "%s", desc->pdata->name); | |
| 1202 | + dev_set_name(&csdev->dev, "%s", desc->name); | |
| 1203 | 1203 | |
| 1204 | 1204 | ret = device_register(&csdev->dev); |
| 1205 | 1205 | if (ret) { |
| @@ -91,13 +91,11 @@ union coresight_dev_subtype { · 90 unmodified lines | ||
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | 93 | * struct coresight_platform_data - data harvested from the DT specification |
| 94 | − * @name: name of the component as shown under sysfs. | |
| 95 | 94 | * @nr_inport: number of input ports for this component. |
| 96 | 95 | * @nr_outport: number of output ports for this component. |
| 97 | 96 | * @conns: Array of nr_outport connections from this component |
| 98 | 97 | */ |
| 99 | 98 | struct coresight_platform_data { |
| 100 | − const char *name; | |
| 101 | 99 | int nr_inport; |
| 102 | 100 | int nr_outport; |
| 103 | 101 | struct coresight_connection *conns; |
| @@ -108,11 +106,12 @@ struct coresight_platform_data { · 4 unmodified lines | ||
| 108 | 106 | * @type: as defined by @coresight_dev_type. |
| 109 | 107 | * @subtype: as defined by @coresight_dev_subtype. |
| 110 | 108 | * @ops: generic operations for this component, as defined |
| 111 | − by @coresight_ops. | |
| 109 | + * by @coresight_ops. | |
| 112 | 110 | * @pdata: platform data collected from DT. |
| 113 | 111 | * @dev: The device entity associated to this component. |
| 114 | 112 | * @groups: operations specific to this component. These will end up |
| 115 | − in the component's sysfs sub-directory. | |
| 113 | + * in the component's sysfs sub-directory. | |
| 114 | + * @name: name for the coresight device, also shown under sysfs. | |
| 116 | 115 | */ |
| 117 | 116 | struct coresight_desc { |
| 118 | 117 | enum coresight_dev_type type; |
| @@ -121,6 +120,7 @@ struct coresight_desc { · 2 unmodified lines | ||
| 121 | 120 | struct coresight_platform_data *pdata; |
| 122 | 121 | struct device *dev; |
| 123 | 122 | const struct attribute_group **groups; |
| 123 | + const char *name; | |
| 124 | 124 | }; |
| 125 | 125 | |
| 126 | 126 | /** |