]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/nouveau: Replace redundant return value judgment with PTR_ERR_OR_ZERO()
authorLiao Yuanhong <liaoyuanhong@vivo.com>
Fri, 15 Aug 2025 13:36:43 +0000 (21:36 +0800)
committerLyude Paul <lyude@redhat.com>
Fri, 29 Aug 2025 21:10:13 +0000 (17:10 -0400)
Replace redundant return value judgment with PTR_ERR_OR_ZERO() to
enhance code readability.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://lore.kernel.org/r/20250815133643.418089-1-liaoyuanhong@vivo.com
drivers/gpu/drm/nouveau/nouveau_platform.c

index a5ce8eb4a3be7a20988ea5515e8b58b1801e5842..8d5853deeee4dad7457c4208a6c3a40f5cb2235d 100644 (file)
@@ -30,10 +30,7 @@ static int nouveau_platform_probe(struct platform_device *pdev)
        func = of_device_get_match_data(&pdev->dev);
 
        drm = nouveau_platform_device_create(func, pdev, &device);
-       if (IS_ERR(drm))
-               return PTR_ERR(drm);
-
-       return 0;
+       return PTR_ERR_OR_ZERO(drm);
 }
 
 static void nouveau_platform_remove(struct platform_device *pdev)