MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / ofw_phye_get_by_index

Function ofw_phye_get_by_index

components/drivers/phye/phye.c:237–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235}
236
237static 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
269struct rt_phye *rt_phye_get_by_index(struct rt_device *dev, int index)
270{

Callers 1

rt_phye_get_by_indexFunction · 0.85

Calls 3

rt_platform_ofw_requestFunction · 0.85
rt_ofw_node_putFunction · 0.85

Tested by

no test coverage detected