Selaa lähdekoodia

gpu: host1x: Rewrite conditional for better readability

The current check is slightly difficult to read, rewrite it to improve
that a little.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Thierry Reding 8 vuotta sitten
vanhempi
commit
1f876c3fce
1 muutettua tiedostoa jossa 7 lisäystä ja 5 poistoa
  1. 7 5
      drivers/gpu/host1x/dev.c

+ 7 - 5
drivers/gpu/host1x/dev.c

@@ -227,11 +227,13 @@ static int host1x_probe(struct platform_device *pdev)
 			return -ENOMEM;
 
 		err = iommu_attach_device(host->domain, &pdev->dev);
-		if (err == -ENODEV) {
-			iommu_domain_free(host->domain);
-			host->domain = NULL;
-			goto skip_iommu;
-		} else if (err) {
+		if (err) {
+			if (err == -ENODEV) {
+				iommu_domain_free(host->domain);
+				host->domain = NULL;
+				goto skip_iommu;
+			}
+
 			goto fail_free_domain;
 		}