if (list_empty(&uc->dev_head))
return -ENODEV;
- list_for_each_entry(iter, &uc->dev_head, uclass_node) {
+ uclass_foreach_dev(iter, uc) {
if (iter == dev) {
if (ucp)
*ucp = uc;
if (list_empty(&uc->dev_head))
return -ENODEV;
- list_for_each_entry(dev, &uc->dev_head, uclass_node) {
+ uclass_foreach_dev(dev, uc) {
if (!index--) {
*devp = dev;
return 0;
if (ret)
return ret;
- list_for_each_entry(dev, &uc->dev_head, uclass_node) {
+ uclass_foreach_dev(dev, uc) {
if (!strncmp(dev->name, name, strlen(name))) {
*devp = dev;
return 0;
if (ret)
return ret;
- list_for_each_entry(dev, &uc->dev_head, uclass_node) {
+ uclass_foreach_dev(dev, uc) {
debug(" - %d %d '%s'\n", dev->req_seq, dev->seq, dev->name);
if ((find_req_seq ? dev->req_seq : dev->seq) ==
seq_or_req_seq) {
if (ret)
return ret;
- list_for_each_entry(dev, &uc->dev_head, uclass_node) {
+ uclass_foreach_dev(dev, uc) {
if (dev_of_offset(dev) == node) {
*devp = dev;
return 0;
if (ret)
return ret;
- list_for_each_entry(dev, &uc->dev_head, uclass_node) {
+ uclass_foreach_dev(dev, uc) {
log(LOGC_DM, LOGL_DEBUG_CONTENT, " - checking %s\n",
dev->name);
if (ofnode_equal(dev_ofnode(dev), node)) {
if (ret)
return ret;
- list_for_each_entry(dev, &uc->dev_head, uclass_node) {
+ uclass_foreach_dev(dev, uc) {
uint phandle;
phandle = dev_read_phandle(dev);
if (ret)
return ret;
- list_for_each_entry(dev, &uc->dev_head, uclass_node) {
+ uclass_foreach_dev(dev, uc) {
if (dev->driver == find_drv)
return uclass_get_device_tail(dev, 0, devp);
}
if (ret)
return ret;
- list_for_each_entry(dev, &uc->dev_head, uclass_node) {
+ uclass_foreach_dev(dev, uc) {
uint phandle;
phandle = dev_read_phandle(dev);