| 121 | } |
| 122 | |
| 123 | static int |
| 124 | mtk_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 | |
| 151 | out: |
| 152 | OF_prop_free(group_list); |
| 153 | OF_prop_free(pin_function); |
| 154 | return (ret); |
| 155 | } |
| 156 | |
| 157 | static int |
| 158 | mtk_pinctrl_configure(device_t dev, phandle_t cfgxref) |
no test coverage detected