| 235 | } |
| 236 | |
| 237 | static struct rt_phye *ofw_phye_get_by_index(struct rt_ofw_node *np, int index) |
| 238 | { |
| 239 | struct rt_phye *phye = RT_NULL; |
| 240 | #ifdef RT_USING_OFW |
| 241 | rt_err_t err; |
| 242 | struct rt_ofw_node *phye_np; |
| 243 | struct rt_ofw_cell_args phye_args; |
| 244 | |
| 245 | if (!rt_ofw_parse_phandle_cells(np, "phys", "#phy-cells", index, &phye_args)) |
| 246 | { |
| 247 | phye_np = phye_args.data; |
| 248 | |
| 249 | if (!rt_ofw_data(phye_np)) |
| 250 | { |
| 251 | rt_platform_ofw_request(phye_np); |
| 252 | } |
| 253 | |
| 254 | phye = rt_ofw_data(phye_np); |
| 255 | rt_ofw_node_put(phye_np); |
| 256 | |
| 257 | if (phye && phye->ops->ofw_parse) |
| 258 | { |
| 259 | if ((err = phye->ops->ofw_parse(phye, &phye_args))) |
| 260 | { |
| 261 | phye = rt_err_ptr(err); |
| 262 | } |
| 263 | } |
| 264 | } |
| 265 | #endif /* RT_USING_OFW */ |
| 266 | return phye; |
| 267 | } |
| 268 | |
| 269 | struct rt_phye *rt_phye_get_by_index(struct rt_device *dev, int index) |
| 270 | { |
no test coverage detected