Commit 458a445d authored by Srinivas Kandagatla's avatar Srinivas Kandagatla Committed by Greg Kroah-Hartman
Browse files

slimbus: ngd: Fix build error on x86



on non DT platforms like x86 of_match_node is set to NULL, dereferencing
directly would throw an error.
Fix this by doing this in two steps, get the match then the data.

Reported-by: default avatarGreg KH <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent aa1f0fa3
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -1327,11 +1327,12 @@ static int of_qcom_slim_ngd_register(struct device *parent,
{
	const struct ngd_reg_offset_data *data;
	struct qcom_slim_ngd *ngd;
	const struct of_device_id *match;
	struct device_node *node;
	u32 id;

	data = of_match_node(qcom_slim_ngd_dt_match, parent->of_node)->data;

	match = of_match_node(qcom_slim_ngd_dt_match, parent->of_node);
	data = match->data;
	for_each_available_child_of_node(parent->of_node, node) {
		if (of_property_read_u32(node, "reg", &id))
			continue;