File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -395,20 +395,15 @@ static int msm_iommu_add_device(struct device *dev)
395
395
struct msm_iommu_dev * iommu ;
396
396
struct iommu_group * group ;
397
397
unsigned long flags ;
398
- int ret = 0 ;
399
398
400
399
spin_lock_irqsave (& msm_iommu_lock , flags );
401
-
402
400
iommu = find_iommu_for_dev (dev );
401
+ spin_unlock_irqrestore (& msm_iommu_lock , flags );
402
+
403
403
if (iommu )
404
404
iommu_device_link (& iommu -> iommu , dev );
405
405
else
406
- ret = - ENODEV ;
407
-
408
- spin_unlock_irqrestore (& msm_iommu_lock , flags );
409
-
410
- if (ret )
411
- return ret ;
406
+ return - ENODEV ;
412
407
413
408
group = iommu_group_get_for_dev (dev );
414
409
if (IS_ERR (group ))
@@ -425,13 +420,12 @@ static void msm_iommu_remove_device(struct device *dev)
425
420
unsigned long flags ;
426
421
427
422
spin_lock_irqsave (& msm_iommu_lock , flags );
428
-
429
423
iommu = find_iommu_for_dev (dev );
424
+ spin_unlock_irqrestore (& msm_iommu_lock , flags );
425
+
430
426
if (iommu )
431
427
iommu_device_unlink (& iommu -> iommu , dev );
432
428
433
- spin_unlock_irqrestore (& msm_iommu_lock , flags );
434
-
435
429
iommu_group_remove_device (dev );
436
430
}
437
431
You can’t perform that action at this time.
0 commit comments