Skip to content

Commit 9174cb7

Browse files
josuahmmahadevan108
authored andcommitted
drivers: video: gc2145: return 0 at the end of functions
After the error code is checked to be zero, it is possible to return 0 explicitly to help with readability. Also, when available, forward the return code from the failing function instead of a locally chosen error code like -EIO. Signed-off-by: Josuah Demangeon <[email protected]>
1 parent 81f5725 commit 9174cb7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/video/gc2145.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ static int gc2145_set_window(const struct device *dev, uint16_t reg, uint16_t x,
876876
return ret;
877877
}
878878

879-
return ret;
879+
return 0;
880880
}
881881

882882
static int gc2145_set_output_format(const struct device *dev, int output_format)
@@ -1155,9 +1155,10 @@ static int gc2145_init(const struct device *dev)
11551155
ret = gc2145_set_fmt(dev, VIDEO_EP_OUT, &fmt);
11561156
if (ret) {
11571157
LOG_ERR("Unable to configure default format");
1158-
return -EIO;
1158+
return ret;
11591159
}
1160-
return ret;
1160+
1161+
return 0;
11611162
}
11621163

11631164
/* Unique Instance */

0 commit comments

Comments
 (0)