Commit 57f77cb7 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Rob Herring (Arm)
Browse files

soc: qcom: ubwc: Simplify with of_machine_get_match_data()

parent 599ff56e
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -277,21 +277,15 @@ static const struct of_device_id qcom_ubwc_configs[] __maybe_unused = {

const struct qcom_ubwc_cfg_data *qcom_ubwc_config_get_data(void)
{
	const struct of_device_id *match;
	struct device_node *root;
	const struct qcom_ubwc_cfg_data *data;

	root = of_find_node_by_path("/");
	if (!root)
		return ERR_PTR(-ENODEV);

	match = of_match_node(qcom_ubwc_configs, root);
	of_node_put(root);
	if (!match) {
	data = of_machine_get_match_data(qcom_ubwc_configs);
	if (!data) {
		pr_err("Couldn't find UBWC config data for this platform!\n");
		return ERR_PTR(-EINVAL);
	}

	return match->data;
	return data;
}
EXPORT_SYMBOL_GPL(qcom_ubwc_config_get_data);