csdev->dev.parent = desc->dev;
csdev->dev.release = coresight_device_release;
csdev->dev.bus = &coresight_bustype;
- /*
- * Hold the reference to our parent device. This will be
- * dropped only in coresight_device_release().
- */
- csdev->dev.fwnode = fwnode_handle_get(dev_fwnode(desc->dev));
- dev_set_name(&csdev->dev, "%s", desc->name);
if (csdev->type == CORESIGHT_DEV_TYPE_SINK ||
csdev->type == CORESIGHT_DEV_TYPE_LINKSINK) {
goto err_out;
}
}
+
+ /*
+ * Hold the reference to our parent device. This will be
+ * dropped only in coresight_device_release().
+ */
+ csdev->dev.fwnode = fwnode_handle_get(dev_fwnode(desc->dev));
+ dev_set_name(&csdev->dev, "%s", desc->name);
+
/*
* Make sure the device registration and the connection fixup
* are synchronised, so that we don't see uninitialised devices