The function returns 1 on success, and either 0 or a negative error code
on failure. As the 0 and negative values don't need to be differentiated
by the caller, convert it to the usual scheme of returning 0 on success
and a negative error code on failure.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
if (!entity) {
dev_dbg(rcdu->dev, "unconnected endpoint %s, skipping\n",
ep->local_node->full_name);
- return 0;
+ return -ENODEV;
}
entity_ep_node = of_parse_phandle(ep->local_node, "remote-endpoint", 0);
encoder->full_name);
of_node_put(entity_ep_node);
of_node_put(encoder);
- return 0;
+ return -ENODEV;
}
break;
encoder->full_name);
of_node_put(encoder);
of_node_put(connector);
- return 0;
+ return -EINVAL;
}
} else {
/*
"failed to initialize encoder %s (%d), skipping\n",
encoder->full_name, ret);
- return ret < 0 ? ret : 1;
+ return ret;
}
static int rcar_du_encoders_init(struct rcar_du_device *rcdu)
continue;
}
- num_encoders += ret;
+ num_encoders++;
}
return num_encoders;