aboutsummaryrefslogtreecommitdiff
path: root/drivers/video/mxsfb.c
diff options
context:
space:
mode:
authorGiulio Benetti2021-10-24 00:34:42 +0200
committerAnatolij Gustschin2021-12-27 00:30:37 +0100
commitf36b3f8f174f0b4168121b99db060d53491c5922 (patch)
tree446702ebeb3c99d0591b5ede37773fd72ba533b5 /drivers/video/mxsfb.c
parent578b479affa4570a3fcfca40f2b69f503880a8c9 (diff)
video: mxsfb: fix clk_get_by_name() return value check
If clk_get_by_name() returns 0 it means it executed successfully while now we consider it as an error. So let's check if return value is negative to be an error. Otherwise this prevents "axi" and "disp_axi" to be enabled. Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
Diffstat (limited to 'drivers/video/mxsfb.c')
-rw-r--r--drivers/video/mxsfb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index 98d29657119..5f85c0c3eb7 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -89,7 +89,7 @@ static void mxs_lcd_init(struct udevice *dev, u32 fb_addr,
}
ret = clk_get_by_name(dev, "axi", &clk);
- if (!ret) {
+ if (ret < 0) {
debug("%s: Failed to get mxs axi clk: %d\n", __func__, ret);
} else {
ret = clk_enable(&clk);
@@ -100,7 +100,7 @@ static void mxs_lcd_init(struct udevice *dev, u32 fb_addr,
}
ret = clk_get_by_name(dev, "disp_axi", &clk);
- if (!ret) {
+ if (ret < 0) {
debug("%s: Failed to get mxs disp_axi clk: %d\n", __func__, ret);
} else {
ret = clk_enable(&clk);