Skip to content

Commit

Permalink
drm/amd/display: checking for NULL instead of IS_ERR()
Browse files Browse the repository at this point in the history
backlight_device_register() never returns NULL, it returns error
pointers on error so the check here is wrong.

Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Dan Carpenter authored and Alex Deucher committed Nov 7, 2017
1 parent 620fd73 commit 74baea4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
Original file line number Diff line number Diff line change
@@ -1296,7 +1296,7 @@ amdgpu_dm_register_backlight_device(struct amdgpu_display_manager *dm)
&amdgpu_dm_backlight_ops,
&props);

if (NULL == dm->backlight_dev)
if (IS_ERR(dm->backlight_dev))
DRM_ERROR("DM: Backlight registration failed!\n");
else
DRM_DEBUG_DRIVER("DM: Registered Backlight device: %s\n", bl_name);

0 comments on commit 74baea4

Please sign in to comment.