diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2017-08-08 15:28:25 +0200 |
---|---|---|
committer | Lucas Stach <l.stach@pengutronix.de> | 2017-08-15 15:28:15 +0200 |
commit | 5247e2aac5c932e6d59af7715854d1bb47ebdf89 (patch) | |
tree | 1dfc885f0eea2ab024802b31498b60134559e51f /drivers/gpu/drm/etnaviv | |
parent | 23d1dd03cc51e2570045745c7a24ef0f45141558 (diff) | |
download | linux-stable-5247e2aac5c932e6d59af7715854d1bb47ebdf89.tar.gz linux-stable-5247e2aac5c932e6d59af7715854d1bb47ebdf89.tar.bz2 linux-stable-5247e2aac5c932e6d59af7715854d1bb47ebdf89.zip |
drm/etnaviv: don't fail GPU bind when CONFIG_THERMAL isn't enabled
The stub functions returns -ENODEV when trying to register the cooling device,
thus failing the GPU bind, rendering the GPU subsystem unusable when
CONFIG_THERMAL isn't enabled.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Diffstat (limited to 'drivers/gpu/drm/etnaviv')
-rw-r--r-- | drivers/gpu/drm/etnaviv/etnaviv_gpu.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c index ada45fdd0eae..fc9a6a83dfc7 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_gpu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_gpu.c @@ -1622,10 +1622,12 @@ static int etnaviv_gpu_bind(struct device *dev, struct device *master, struct etnaviv_gpu *gpu = dev_get_drvdata(dev); int ret; - gpu->cooling = thermal_of_cooling_device_register(dev->of_node, + if (IS_ENABLED(CONFIG_THERMAL)) { + gpu->cooling = thermal_of_cooling_device_register(dev->of_node, (char *)dev_name(dev), gpu, &cooling_ops); - if (IS_ERR(gpu->cooling)) - return PTR_ERR(gpu->cooling); + if (IS_ERR(gpu->cooling)) + return PTR_ERR(gpu->cooling); + } #ifdef CONFIG_PM ret = pm_runtime_get_sync(gpu->dev); |