MCPcopy Create free account
hub / github.com/F-Stack/f-stack / mtk_pinctrl_process_node

Function mtk_pinctrl_process_node

freebsd/mips/mediatek/mtk_pinctrl.c:123–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121}
122
123static int
124mtk_pinctrl_process_node(device_t dev, struct mtk_pin_group *table,
125 phandle_t node)
126{
127 const char **group_list = NULL;
128 char *pin_function = NULL;
129 int ret, num_groups, i;
130
131 ret = 0;
132
133 num_groups = ofw_bus_string_list_to_array(node, "ralink,group",
134 &group_list);
135
136 if (num_groups <= 0)
137 return (ENOENT);
138
139 if (OF_getprop_alloc_multi(node, "ralink,function", sizeof(*pin_function),
140 (void **)&pin_function) == -1) {
141 ret = ENOENT;
142 goto out;
143 }
144
145 for (i = 0; i < num_groups; i++) {
146 if ((ret = mtk_pinctrl_process_entry(dev, table, group_list[i],
147 pin_function)) != 0)
148 goto out;
149 }
150
151out:
152 OF_prop_free(group_list);
153 OF_prop_free(pin_function);
154 return (ret);
155}
156
157static int
158mtk_pinctrl_configure(device_t dev, phandle_t cfgxref)

Callers 1

mtk_pinctrl_configureFunction · 0.85

Calls 1

Tested by

no test coverage detected