1 From c22a0c1ce0ec4c468dcbdaff05d18f366522af9b Mon Sep 17 00:00:00 2001
2 From: popcornmix <popcornmix@gmail.com>
3 Date: Fri, 23 Aug 2019 16:34:38 +0100
4 Subject: [PATCH] v3d_drv: Handle missing clock more gracefully
6 Signed-off-by: popcornmix <popcornmix@gmail.com>
8 drivers/gpu/drm/v3d/v3d_drv.c | 8 ++++----
9 1 file changed, 4 insertions(+), 4 deletions(-)
11 --- a/drivers/gpu/drm/v3d/v3d_drv.c
12 +++ b/drivers/gpu/drm/v3d/v3d_drv.c
13 @@ -302,10 +302,10 @@ static int v3d_platform_drm_probe(struct
16 v3d->clk = devm_clk_get(dev, NULL);
17 - if (IS_ERR(v3d->clk)) {
18 - if (ret != -EPROBE_DEFER)
19 - dev_err(dev, "Failed to get clock\n");
21 + if (IS_ERR_OR_NULL(v3d->clk)) {
22 + if (PTR_ERR(v3d->clk) != -EPROBE_DEFER)
23 + dev_err(dev, "Failed to get clock (%ld)\n", PTR_ERR(v3d->clk));
24 + return PTR_ERR(v3d->clk);
26 v3d->clk_up_rate = clk_get_rate(v3d->clk);
27 /* For downclocking, drop it to the minimum frequency we can get from