Skip to contentSkip to conversation

ARM: PNX4008: i2c-pnx: use the same dev_id for request_irq and free_irq

PATCH New Russell King - ARM Linux 2 participants 2 messages Nov 21, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: PNX4008: i2c-pnx: use the same dev_id for request_irq and free_irq

This allows i2c-pnx to free its interrupt handler when the module is removed or if an error occurs; using the same dev_id for both request_irq and free_irq is desirable.

---
 drivers/i2c/busses/i2c-pnx.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-pnx.c +2 -2
index 1fca590..fbab684 100644
@@ -650,7 +650,7 @@ static int __devinit i2c_pnx_probe(struct platform_device *pdev)
 	return 0;
 
 out_irq:
-	free_irq(alg_data->irq, alg_data);
+	free_irq(alg_data->irq, i2c_pnx->adapter);
 out_clock:
 	i2c_pnx->set_clock_stop(pdev);
 out_unmap:
@@ -669,7 +669,7 @@ static int __devexit i2c_pnx_remove(struct platform_device *pdev)
 	struct i2c_adapter *adap = i2c_pnx->adapter;
 	struct i2c_pnx_algo_data *alg_data = adap->algo_data;
 
-	free_irq(alg_data->irq, alg_data);
+	free_irq(alg_data->irq, i2c_pnx->adapter);
 	i2c_del_adapter(adap);
 	i2c_pnx->set_clock_stop(pdev);
 	iounmap((void *)alg_data->ioaddr);
Signature · 1 line
1.6.2.5
#1 lore raw

PATCH 1/1 ARM: PNX4008: i2c-pnx: use the same dev_id for request_irq and free_irq

Quoted 5 lines · Russell King - ARM Linux

This allows i2c-pnx to free its interrupt handler when the module is removed or if an error occurs; using the same dev_id for both request_irq and free_irq is desirable.

If you want to merge this via your current pnx work, then have my ack to this, otherwise let me know and i'll add it to i2c-fixes.

Quoted 33 lines
---
 drivers/i2c/busses/i2c-pnx.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/busses/i2c-pnx.c +2 -2
index 1fca590..fbab684 100644
@@ -650,7 +650,7 @@ static int __devinit i2c_pnx_probe(struct platform_device *pdev)
 	return 0;
 
 out_irq:
-	free_irq(alg_data->irq, alg_data);
+	free_irq(alg_data->irq, i2c_pnx->adapter);
 out_clock:
 	i2c_pnx->set_clock_stop(pdev);
 out_unmap:
@@ -669,7 +669,7 @@ static int __devexit i2c_pnx_remove(struct platform_device *pdev)
 	struct i2c_adapter *adap = i2c_pnx->adapter;
 	struct i2c_pnx_algo_data *alg_data = adap->algo_data;
 
-	free_irq(alg_data->irq, alg_data);
+	free_irq(alg_data->irq, i2c_pnx->adapter);
 	i2c_del_adapter(adap);
 	i2c_pnx->set_clock_stop(pdev);
 	iounmap((void *)alg_data->ioaddr);
Signature · 6 lines
1.6.2.5

--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 3 lines
Ben (ben at fluff.org, http://www.fluff.org/)

  'a smiley only costs 4 bytes'