Commit 652355c5 authored by Alexander Aring's avatar Alexander Aring Committed by David S. Miller

at86rf230: use devm_request_irq

This patch replace request_irq with devm_request_irq. With
devm_request_irq we don't need to care about freeing the irq.
Signed-off-by: default avatarAlexander Aring <alex.aring@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8eba0eef
...@@ -1190,7 +1190,7 @@ static int at86rf230_probe(struct spi_device *spi) ...@@ -1190,7 +1190,7 @@ static int at86rf230_probe(struct spi_device *spi)
if (rc) if (rc)
goto err_hw_init; goto err_hw_init;
rc = request_irq(spi->irq, irq_handler, IRQF_SHARED, rc = devm_request_irq(&spi->dev, spi->irq, irq_handler, IRQF_SHARED,
dev_name(&spi->dev), lp); dev_name(&spi->dev), lp);
if (rc) if (rc)
goto err_hw_init; goto err_hw_init;
...@@ -1198,16 +1198,14 @@ static int at86rf230_probe(struct spi_device *spi) ...@@ -1198,16 +1198,14 @@ static int at86rf230_probe(struct spi_device *spi)
/* Read irq status register to reset irq line */ /* Read irq status register to reset irq line */
rc = at86rf230_read_subreg(lp, RG_IRQ_STATUS, 0xff, 0, &status); rc = at86rf230_read_subreg(lp, RG_IRQ_STATUS, 0xff, 0, &status);
if (rc) if (rc)
goto err_irq; goto err_hw_init;
rc = ieee802154_register_device(lp->dev); rc = ieee802154_register_device(lp->dev);
if (rc) if (rc)
goto err_irq; goto err_hw_init;
return rc; return rc;
err_irq:
free_irq(spi->irq, lp);
err_hw_init: err_hw_init:
flush_work(&lp->irqwork); flush_work(&lp->irqwork);
spi_set_drvdata(spi, NULL); spi_set_drvdata(spi, NULL);
...@@ -1232,7 +1230,6 @@ static int at86rf230_remove(struct spi_device *spi) ...@@ -1232,7 +1230,6 @@ static int at86rf230_remove(struct spi_device *spi)
at86rf230_write_subreg(lp, SR_IRQ_MASK, 0); at86rf230_write_subreg(lp, SR_IRQ_MASK, 0);
ieee802154_unregister_device(lp->dev); ieee802154_unregister_device(lp->dev);
free_irq(spi->irq, lp);
flush_work(&lp->irqwork); flush_work(&lp->irqwork);
if (gpio_is_valid(pdata->slp_tr)) if (gpio_is_valid(pdata->slp_tr))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment