diff mbox series

i2c: mlxbf: Remove the unneeded devm_free_irq

Message ID 1616144165-54498-1-git-send-email-tiantao6@hisilicon.com
State Changes Requested
Headers show
Series i2c: mlxbf: Remove the unneeded devm_free_irq | expand

Commit Message

tiantao \(H\) March 19, 2021, 8:56 a.m. UTC
Use devm_request_irq to request interrupts,devm_free_irq is
not needed to release interrupts. so just remove it.

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
---
 drivers/i2c/busses/i2c-mlxbf.c | 2 --
 1 file changed, 2 deletions(-)

Comments

Khalil Blaiech March 23, 2021, 11:56 p.m. UTC | #1
> -----Original Message-----
> From: Tian Tao <tiantao6@hisilicon.com>
> Sent: Friday, March 19, 2021 4:56 AM
> To: Khalil Blaiech <kblaiech@nvidia.com>
> Cc: linux-i2c@vger.kernel.org
> Subject: [PATCH] i2c: mlxbf: Remove the unneeded devm_free_irq
> 
> Use devm_request_irq to request interrupts,devm_free_irq is
> not needed to release interrupts. so just remove it.
> 
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> ---
>  drivers/i2c/busses/i2c-mlxbf.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c
> index 2fb0532..ea839de 100644
> --- a/drivers/i2c/busses/i2c-mlxbf.c
> +++ b/drivers/i2c/busses/i2c-mlxbf.c
> @@ -2426,8 +2426,6 @@ static int mlxbf_i2c_remove(struct platform_device
> *pdev)
>  	}
>  	mutex_unlock(&mlxbf_i2c_bus_lock);
> 
> -	devm_free_irq(dev, priv->irq, priv);
> -

Thanks.
Acked-by: Khalil Blaiech <kblaiech@nvidia.com>

>  	i2c_del_adapter(&priv->adap);
> 
>  	return 0;
> --
> 2.7.4
Wolfram Sang March 31, 2021, 7:25 a.m. UTC | #2
On Fri, Mar 19, 2021 at 04:56:05PM +0800, Tian Tao wrote:
> Use devm_request_irq to request interrupts,devm_free_irq is
> not needed to release interrupts. so just remove it.
> 
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>

So, we are sure that interrupts can't happen anymore? Otherwise we would
get an OOPS because of the missing adapter. And if so, what about
the devm_release_mem_region() above. Can't they be removed, too?

> ---
>  drivers/i2c/busses/i2c-mlxbf.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c
> index 2fb0532..ea839de 100644
> --- a/drivers/i2c/busses/i2c-mlxbf.c
> +++ b/drivers/i2c/busses/i2c-mlxbf.c
> @@ -2426,8 +2426,6 @@ static int mlxbf_i2c_remove(struct platform_device *pdev)
>  	}
>  	mutex_unlock(&mlxbf_i2c_bus_lock);
>  
> -	devm_free_irq(dev, priv->irq, priv);
> -
>  	i2c_del_adapter(&priv->adap);
>  
>  	return 0;
> -- 
> 2.7.4
>
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-mlxbf.c b/drivers/i2c/busses/i2c-mlxbf.c
index 2fb0532..ea839de 100644
--- a/drivers/i2c/busses/i2c-mlxbf.c
+++ b/drivers/i2c/busses/i2c-mlxbf.c
@@ -2426,8 +2426,6 @@  static int mlxbf_i2c_remove(struct platform_device *pdev)
 	}
 	mutex_unlock(&mlxbf_i2c_bus_lock);
 
-	devm_free_irq(dev, priv->irq, priv);
-
 	i2c_del_adapter(&priv->adap);
 
 	return 0;