Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 /*
0003  * Copyright (C) 2022 Linaro Ltd.
0004  */
0005 
0006 #include <linux/of.h>
0007 #include <linux/slab.h>
0008 
0009 #include "icc-common.h"
0010 
0011 struct icc_node_data *qcom_icc_xlate_extended(struct of_phandle_args *spec, void *data)
0012 {
0013     struct icc_node_data *ndata;
0014     struct icc_node *node;
0015 
0016     node = of_icc_xlate_onecell(spec, data);
0017     if (IS_ERR(node))
0018         return ERR_CAST(node);
0019 
0020     ndata = kzalloc(sizeof(*ndata), GFP_KERNEL);
0021     if (!ndata)
0022         return ERR_PTR(-ENOMEM);
0023 
0024     ndata->node = node;
0025 
0026     if (spec->args_count == 2)
0027         ndata->tag = spec->args[1];
0028 
0029     if (spec->args_count > 2)
0030         pr_warn("%pOF: Too many arguments, path tag is not parsed\n", spec->np);
0031 
0032     return ndata;
0033 }
0034 EXPORT_SYMBOL_GPL(qcom_icc_xlate_extended);