diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-09-25 03:37:45 -0400 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2013-10-23 11:21:17 -0400 |
commit | 89720264a1f0870e45f583583357ee986e216157 (patch) | |
tree | 1265a2316b81ff49d1e0b74179fbae0677856849 /drivers/mfd/ezx-pcap.c | |
parent | e90f875419967589d75d1a3e2b89c5f2720e794e (diff) |
mfd: ezx-pcap: Drop devm_free_irq of devm_ allocated irq
The devm_request_irq function allocates irq that is released
when a driver detaches. Thus, there is no reason to explicitly
call devm_free_irq in probe or remove functions.
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/ezx-pcap.c')
-rw-r--r-- | drivers/mfd/ezx-pcap.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c index 7245b0c5b794..2ed774e7d342 100644 --- a/drivers/mfd/ezx-pcap.c +++ b/drivers/mfd/ezx-pcap.c | |||
@@ -394,16 +394,12 @@ static int pcap_add_subdev(struct pcap_chip *pcap, | |||
394 | static int ezx_pcap_remove(struct spi_device *spi) | 394 | static int ezx_pcap_remove(struct spi_device *spi) |
395 | { | 395 | { |
396 | struct pcap_chip *pcap = spi_get_drvdata(spi); | 396 | struct pcap_chip *pcap = spi_get_drvdata(spi); |
397 | struct pcap_platform_data *pdata = dev_get_platdata(&spi->dev); | 397 | int i; |
398 | int i, adc_irq; | ||
399 | 398 | ||
400 | /* remove all registered subdevs */ | 399 | /* remove all registered subdevs */ |
401 | device_for_each_child(&spi->dev, NULL, pcap_remove_subdev); | 400 | device_for_each_child(&spi->dev, NULL, pcap_remove_subdev); |
402 | 401 | ||
403 | /* cleanup ADC */ | 402 | /* cleanup ADC */ |
404 | adc_irq = pcap_to_irq(pcap, (pdata->config & PCAP_SECOND_PORT) ? | ||
405 | PCAP_IRQ_ADCDONE2 : PCAP_IRQ_ADCDONE); | ||
406 | devm_free_irq(&spi->dev, adc_irq, pcap); | ||
407 | mutex_lock(&pcap->adc_mutex); | 403 | mutex_lock(&pcap->adc_mutex); |
408 | for (i = 0; i < PCAP_ADC_MAXQ; i++) | 404 | for (i = 0; i < PCAP_ADC_MAXQ; i++) |
409 | kfree(pcap->adc_queue[i]); | 405 | kfree(pcap->adc_queue[i]); |
@@ -509,8 +505,6 @@ static int ezx_pcap_probe(struct spi_device *spi) | |||
509 | 505 | ||
510 | remove_subdevs: | 506 | remove_subdevs: |
511 | device_for_each_child(&spi->dev, NULL, pcap_remove_subdev); | 507 | device_for_each_child(&spi->dev, NULL, pcap_remove_subdev); |
512 | /* free_adc: */ | ||
513 | devm_free_irq(&spi->dev, adc_irq, pcap); | ||
514 | free_irqchip: | 508 | free_irqchip: |
515 | for (i = pcap->irq_base; i < (pcap->irq_base + PCAP_NIRQS); i++) | 509 | for (i = pcap->irq_base; i < (pcap->irq_base + PCAP_NIRQS); i++) |
516 | irq_set_chip_and_handler(i, NULL, NULL); | 510 | irq_set_chip_and_handler(i, NULL, NULL); |