diff mbox

[2/2] iommu/omap: Remove omap_iommu unused owner field

Message ID 1410277545-32157-3-git-send-email-laurent.pinchart@ideasonboard.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Pinchart Sept. 9, 2014, 3:45 p.m. UTC
The owner field is never set. Remove it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/iommu/omap-iommu.c | 11 -----------
 drivers/iommu/omap-iommu.h |  1 -
 2 files changed, 12 deletions(-)

Comments

Suman Anna Sept. 9, 2014, 9:41 p.m. UTC | #1
Hi Laurent,

On 09/09/2014 10:45 AM, Laurent Pinchart wrote:
> The owner field is never set. Remove it.

Thanks, this seems to have been dead code since the days OMAP IOMMU has
been converted from building as modules to built-in as part of the IOMMU
API adoption. So,

Acked-by: Suman Anna <s-anna@ti.com>

regards
Suman

> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/iommu/omap-iommu.c | 11 -----------
>  drivers/iommu/omap-iommu.h |  1 -
>  2 files changed, 12 deletions(-)
> 
> diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
> index 192c367..fdfe732 100644
> --- a/drivers/iommu/omap-iommu.c
> +++ b/drivers/iommu/omap-iommu.c
> @@ -861,20 +861,11 @@ static struct omap_iommu *omap_iommu_attach(const char *name, u32 *iopgd)
>  		goto err_enable;
>  	flush_iotlb_all(obj);
>  
> -	if (!try_module_get(obj->owner)) {
> -		dev_err(obj->dev, "%s: can't get owner\n", __func__);
> -		err = -ENODEV;
> -		goto err_module;
> -	}
> -
>  	spin_unlock(&obj->iommu_lock);
>  
>  	dev_dbg(obj->dev, "%s: %s\n", __func__, obj->name);
>  	return obj;
>  
> -err_module:
> -	if (obj->refcount == 1)
> -		iommu_disable(obj);
>  err_enable:
>  	obj->refcount--;
>  	spin_unlock(&obj->iommu_lock);
> @@ -895,8 +886,6 @@ static void omap_iommu_detach(struct omap_iommu *obj)
>  	if (--obj->refcount == 0)
>  		iommu_disable(obj);
>  
> -	module_put(obj->owner);
> -
>  	obj->iopgd = NULL;
>  
>  	spin_unlock(&obj->iommu_lock);
> diff --git a/drivers/iommu/omap-iommu.h b/drivers/iommu/omap-iommu.h
> index 7a90800..2c3b85c 100644
> --- a/drivers/iommu/omap-iommu.h
> +++ b/drivers/iommu/omap-iommu.h
> @@ -28,7 +28,6 @@ struct iotlb_entry {
>  
>  struct omap_iommu {
>  	const char	*name;
> -	struct module	*owner;
>  	void __iomem	*regbase;
>  	struct device	*dev;
>  	void		*isr_priv;
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Joerg Roedel Sept. 25, 2014, 1:57 p.m. UTC | #2
On Tue, Sep 09, 2014 at 06:45:45PM +0300, Laurent Pinchart wrote:
> The owner field is never set. Remove it.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/iommu/omap-iommu.c | 11 -----------
>  drivers/iommu/omap-iommu.h |  1 -
>  2 files changed, 12 deletions(-)

Applied this one to arm/omap, thanks.

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/iommu/omap-iommu.c b/drivers/iommu/omap-iommu.c
index 192c367..fdfe732 100644
--- a/drivers/iommu/omap-iommu.c
+++ b/drivers/iommu/omap-iommu.c
@@ -861,20 +861,11 @@  static struct omap_iommu *omap_iommu_attach(const char *name, u32 *iopgd)
 		goto err_enable;
 	flush_iotlb_all(obj);
 
-	if (!try_module_get(obj->owner)) {
-		dev_err(obj->dev, "%s: can't get owner\n", __func__);
-		err = -ENODEV;
-		goto err_module;
-	}
-
 	spin_unlock(&obj->iommu_lock);
 
 	dev_dbg(obj->dev, "%s: %s\n", __func__, obj->name);
 	return obj;
 
-err_module:
-	if (obj->refcount == 1)
-		iommu_disable(obj);
 err_enable:
 	obj->refcount--;
 	spin_unlock(&obj->iommu_lock);
@@ -895,8 +886,6 @@  static void omap_iommu_detach(struct omap_iommu *obj)
 	if (--obj->refcount == 0)
 		iommu_disable(obj);
 
-	module_put(obj->owner);
-
 	obj->iopgd = NULL;
 
 	spin_unlock(&obj->iommu_lock);
diff --git a/drivers/iommu/omap-iommu.h b/drivers/iommu/omap-iommu.h
index 7a90800..2c3b85c 100644
--- a/drivers/iommu/omap-iommu.h
+++ b/drivers/iommu/omap-iommu.h
@@ -28,7 +28,6 @@  struct iotlb_entry {
 
 struct omap_iommu {
 	const char	*name;
-	struct module	*owner;
 	void __iomem	*regbase;
 	struct device	*dev;
 	void		*isr_priv;