diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2015-05-26 14:07:56 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2015-06-16 13:25:53 +0200 |
commit | 898a2f387d1c663772c630e8f78ef60f1639077e (patch) | |
tree | 905f444af548417afd20f05fdec45caf081f7973 /drivers/gpu/drm/rcar-du | |
parent | drm: rcar-du: Clarify error message when encoder initialization fails (diff) | |
download | linux-898a2f387d1c663772c630e8f78ef60f1639077e.tar.xz linux-898a2f387d1c663772c630e8f78ef60f1639077e.zip |
drm: rcar-du: Convert rcar_du_encoders_init_one() return value to 0/<0
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>
Diffstat (limited to 'drivers/gpu/drm/rcar-du')
-rw-r--r-- | drivers/gpu/drm/rcar-du/rcar_du_kms.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c index ab29c179d854..fa185a450aea 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c @@ -573,7 +573,7 @@ static int rcar_du_encoders_init_one(struct rcar_du_device *rcdu, 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); @@ -596,7 +596,7 @@ static int rcar_du_encoders_init_one(struct rcar_du_device *rcdu, encoder->full_name); of_node_put(entity_ep_node); of_node_put(encoder); - return 0; + return -ENODEV; } break; @@ -625,7 +625,7 @@ static int rcar_du_encoders_init_one(struct rcar_du_device *rcdu, encoder->full_name); of_node_put(encoder); of_node_put(connector); - return 0; + return -EINVAL; } } else { /* @@ -644,7 +644,7 @@ static int rcar_du_encoders_init_one(struct rcar_du_device *rcdu, "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) @@ -696,7 +696,7 @@ static int rcar_du_encoders_init(struct rcar_du_device *rcdu) continue; } - num_encoders += ret; + num_encoders++; } return num_encoders; |