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

Function ofw_get_address_by_name

components/drivers/ofw/io.c:156–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156static rt_err_t ofw_get_address_by_name(struct rt_ofw_node *np, const char *name,
157 rt_uint64_t *out_address, rt_uint64_t *out_size)
158
159{
160 int index = 0;
161 rt_err_t err = -RT_EEMPTY;
162 const char *reg_name;
163 struct rt_ofw_prop *prop;
164
165 rt_ofw_foreach_prop_string(np, "reg-names", prop, reg_name)
166 {
167 if (!rt_strcmp(name, reg_name))
168 {
169 err = rt_ofw_get_address(np, index, out_address, out_size);
170
171 break;
172 }
173
174 ++index;
175 }
176
177 return err;
178}
179
180rt_err_t rt_ofw_get_address_by_name(struct rt_ofw_node *np, const char *name,
181 rt_uint64_t *out_address, rt_uint64_t *out_size)

Callers 2

rt_ofw_iomap_by_nameFunction · 0.85

Calls 2

rt_strcmpFunction · 0.85
rt_ofw_get_addressFunction · 0.85

Tested by

no test coverage detected