catu_desc.type = CORESIGHT_DEV_TYPE_HELPER;
catu_desc.subtype.helper_subtype = CORESIGHT_DEV_SUBTYPE_HELPER_CATU;
catu_desc.ops = &catu_ops;
+ catu_desc.name = dev_name(dev);
+
drvdata->csdev = coresight_register(&catu_desc);
if (IS_ERR(drvdata->csdev))
ret = PTR_ERR(drvdata->csdev);
desc.ops = &etb_cs_ops;
desc.pdata = pdata;
desc.dev = dev;
+ desc.name = dev_name(dev);
desc.groups = coresight_etb_groups;
drvdata->csdev = coresight_register(&desc);
if (IS_ERR(drvdata->csdev))
return PTR_ERR(drvdata->csdev);
- drvdata->miscdev.name = pdata->name;
+ drvdata->miscdev.name = desc.name;
drvdata->miscdev.minor = MISC_DYNAMIC_MINOR;
drvdata->miscdev.fops = &etb_fops;
ret = misc_register(&drvdata->miscdev);
desc.ops = &etm_cs_ops;
desc.pdata = pdata;
desc.dev = dev;
+ desc.name = dev_name(dev);
desc.groups = coresight_etm_groups;
drvdata->csdev = coresight_register(&desc);
if (IS_ERR(drvdata->csdev)) {
desc.pdata = pdata;
desc.dev = dev;
desc.groups = coresight_etmv4_groups;
+ desc.name = dev_name(dev);
drvdata->csdev = coresight_register(&desc);
if (IS_ERR(drvdata->csdev)) {
ret = PTR_ERR(drvdata->csdev);
desc.ops = &funnel_cs_ops;
desc.pdata = pdata;
desc.dev = dev;
+ desc.name = dev_name(dev);
drvdata->csdev = coresight_register(&desc);
if (IS_ERR(drvdata->csdev)) {
ret = PTR_ERR(drvdata->csdev);
goto error;
}
- /* Use device name as sysfs handle */
- pdata->name = dev_name(dev);
-
if (is_of_node(fwnode))
ret = of_get_coresight_platform_data(dev, pdata);
desc.ops = &replicator_cs_ops;
desc.pdata = dev->platform_data;
desc.dev = dev;
+ desc.name = dev_name(dev);
+
drvdata->csdev = coresight_register(&desc);
if (IS_ERR(drvdata->csdev)) {
ret = PTR_ERR(drvdata->csdev);
desc.ops = &stm_cs_ops;
desc.pdata = pdata;
desc.dev = dev;
+ desc.name = dev_name(dev);
desc.groups = coresight_stm_groups;
drvdata->csdev = coresight_register(&desc);
if (IS_ERR(drvdata->csdev)) {
desc.pdata = pdata;
desc.dev = dev;
desc.groups = coresight_tmc_groups;
+ desc.name = dev_name(dev);
switch (drvdata->config_type) {
case TMC_CONFIG_TYPE_ETB:
desc.ops = &tmc_etf_cs_ops;
break;
default:
- pr_err("%s: Unsupported TMC config\n", pdata->name);
+ pr_err("%s: Unsupported TMC config\n", desc.name);
ret = -EINVAL;
goto out;
}
goto out;
}
- drvdata->miscdev.name = pdata->name;
+ drvdata->miscdev.name = desc.name;
drvdata->miscdev.minor = MISC_DYNAMIC_MINOR;
drvdata->miscdev.fops = &tmc_fops;
ret = misc_register(&drvdata->miscdev);
desc.ops = &tpiu_cs_ops;
desc.pdata = pdata;
desc.dev = dev;
+ desc.name = dev_name(dev);
drvdata->csdev = coresight_register(&desc);
if (!IS_ERR(drvdata->csdev)) {
csdev->dev.parent = desc->dev;
csdev->dev.release = coresight_device_release;
csdev->dev.bus = &coresight_bustype;
- dev_set_name(&csdev->dev, "%s", desc->pdata->name);
+ dev_set_name(&csdev->dev, "%s", desc->name);
ret = device_register(&csdev->dev);
if (ret) {
/**
* struct coresight_platform_data - data harvested from the DT specification
- * @name: name of the component as shown under sysfs.
* @nr_inport: number of input ports for this component.
* @nr_outport: number of output ports for this component.
* @conns: Array of nr_outport connections from this component
*/
struct coresight_platform_data {
- const char *name;
int nr_inport;
int nr_outport;
struct coresight_connection *conns;
* @type: as defined by @coresight_dev_type.
* @subtype: as defined by @coresight_dev_subtype.
* @ops: generic operations for this component, as defined
- by @coresight_ops.
+ * by @coresight_ops.
* @pdata: platform data collected from DT.
* @dev: The device entity associated to this component.
* @groups: operations specific to this component. These will end up
- in the component's sysfs sub-directory.
+ * in the component's sysfs sub-directory.
+ * @name: name for the coresight device, also shown under sysfs.
*/
struct coresight_desc {
enum coresight_dev_type type;
struct coresight_platform_data *pdata;
struct device *dev;
const struct attribute_group **groups;
+ const char *name;
};
/**