File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -411,9 +411,6 @@ static int tegra_gart_probe(struct platform_device *pdev)
411
411
struct device * dev = & pdev -> dev ;
412
412
int ret ;
413
413
414
- if (gart_handle )
415
- return - EIO ;
416
-
417
414
BUILD_BUG_ON (PAGE_SHIFT != GART_PAGE_SHIFT );
418
415
419
416
/* the GART memory aperture is required */
@@ -448,8 +445,7 @@ static int tegra_gart_probe(struct platform_device *pdev)
448
445
ret = iommu_device_register (& gart -> iommu );
449
446
if (ret ) {
450
447
dev_err (dev , "Failed to register IOMMU\n" );
451
- iommu_device_sysfs_remove (& gart -> iommu );
452
- return ret ;
448
+ goto remove_sysfs ;
453
449
}
454
450
455
451
gart -> dev = & pdev -> dev ;
@@ -463,7 +459,8 @@ static int tegra_gart_probe(struct platform_device *pdev)
463
459
gart -> savedata = vmalloc (array_size (sizeof (u32 ), gart -> page_count ));
464
460
if (!gart -> savedata ) {
465
461
dev_err (dev , "failed to allocate context save area\n" );
466
- return - ENOMEM ;
462
+ ret = - ENOMEM ;
463
+ goto unregister_iommu ;
467
464
}
468
465
469
466
platform_set_drvdata (pdev , gart );
@@ -472,6 +469,13 @@ static int tegra_gart_probe(struct platform_device *pdev)
472
469
gart_handle = gart ;
473
470
474
471
return 0 ;
472
+
473
+ unregister_iommu :
474
+ iommu_device_unregister (& gart -> iommu );
475
+ remove_sysfs :
476
+ iommu_device_sysfs_remove (& gart -> iommu );
477
+
478
+ return ret ;
475
479
}
476
480
477
481
static const struct dev_pm_ops tegra_gart_pm_ops = {
You can’t perform that action at this time.
0 commit comments