Commit 4bae8e6d authored by Junhao He's avatar Junhao He Committed by Zheng Zengkai
Browse files

coresight: Return the pointer of @pdata when not "fwnode"

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I5YCYK



--------------------------------------------------------------------------

TRBE device can use the id_tabel to match driver. So if the CoreSight
component does not use the device tree or ACPI to report devices
(@fwnode is NULL), we need to return the pointer to the platform
data @pdata.

Signed-off-by: default avatarJunhao He <hejunhao3@huawei.com>
Reviewed-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 579c6f13
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -844,15 +844,15 @@ coresight_get_platform_data(struct device *dev)
	struct coresight_platform_data *pdata = NULL;
	struct fwnode_handle *fwnode = dev_fwnode(dev);

	if (IS_ERR_OR_NULL(fwnode))
		goto error;

	pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
	if (!pdata) {
		ret = -ENOMEM;
		goto error;
	}

	if (IS_ERR_OR_NULL(fwnode))
		return pdata;

	if (is_of_node(fwnode))
		ret = of_get_coresight_platform_data(dev, pdata);
	else if (is_acpi_device_node(fwnode))