Merge tag 'rpmsg-v6.8' of git://git.kernel.org/pub/scm/linux/kernel/git/remoteproc...
[linux-block.git] / drivers / interconnect / qcom / icc-common.c
CommitLineData
cb4805b5
LY
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2022 Linaro Ltd.
4 */
5
6#include <linux/of.h>
7#include <linux/slab.h>
7aa429e8 8#include <linux/module.h>
cb4805b5
LY
9
10#include "icc-common.h"
11
12struct icc_node_data *qcom_icc_xlate_extended(struct of_phandle_args *spec, void *data)
13{
14 struct icc_node_data *ndata;
15 struct icc_node *node;
16
17 node = of_icc_xlate_onecell(spec, data);
18 if (IS_ERR(node))
19 return ERR_CAST(node);
20
21 ndata = kzalloc(sizeof(*ndata), GFP_KERNEL);
22 if (!ndata)
23 return ERR_PTR(-ENOMEM);
24
25 ndata->node = node;
26
27 if (spec->args_count == 2)
28 ndata->tag = spec->args[1];
29
30 if (spec->args_count > 2)
31 pr_warn("%pOF: Too many arguments, path tag is not parsed\n", spec->np);
32
33 return ndata;
34}
35EXPORT_SYMBOL_GPL(qcom_icc_xlate_extended);
7aa429e8
HY
36
37MODULE_LICENSE("GPL");