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)
395395 struct msm_iommu_dev * iommu ;
396396 struct iommu_group * group ;
397397 unsigned long flags ;
398- int ret = 0 ;
399398
400399 spin_lock_irqsave (& msm_iommu_lock , flags );
401-
402400 iommu = find_iommu_for_dev (dev );
401+ spin_unlock_irqrestore (& msm_iommu_lock , flags );
402+
403403 if (iommu )
404404 iommu_device_link (& iommu -> iommu , dev );
405405 else
406- ret = - ENODEV ;
407-
408- spin_unlock_irqrestore (& msm_iommu_lock , flags );
409-
410- if (ret )
411- return ret ;
406+ return - ENODEV ;
412407
413408 group = iommu_group_get_for_dev (dev );
414409 if (IS_ERR (group ))
@@ -425,13 +420,12 @@ static void msm_iommu_remove_device(struct device *dev)
425420 unsigned long flags ;
426421
427422 spin_lock_irqsave (& msm_iommu_lock , flags );
428-
429423 iommu = find_iommu_for_dev (dev );
424+ spin_unlock_irqrestore (& msm_iommu_lock , flags );
425+
430426 if (iommu )
431427 iommu_device_unlink (& iommu -> iommu , dev );
432428
433- spin_unlock_irqrestore (& msm_iommu_lock , flags );
434-
435429 iommu_group_remove_device (dev );
436430}
437431
You can’t perform that action at this time.
0 commit comments