From: Alexander Aring <alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [PATCH net-next 04/14] at86rf230: use devm_request_irq
Date: Thu, 24 Apr 2014 19:09:08 +0200 [thread overview]
Message-ID: <1398359358-11085-5-git-send-email-alex.aring@gmail.com> (raw)
In-Reply-To: <1398359358-11085-1-git-send-email-alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
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: Alexander Aring <alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
drivers/net/ieee802154/at86rf230.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index e1d3af6..5856488 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -1190,24 +1190,22 @@ static int at86rf230_probe(struct spi_device *spi)
if (rc)
goto err_hw_init;
- rc = request_irq(spi->irq, irq_handler, IRQF_SHARED,
- dev_name(&spi->dev), lp);
+ rc = devm_request_irq(&spi->dev, spi->irq, irq_handler, IRQF_SHARED,
+ dev_name(&spi->dev), lp);
if (rc)
goto err_hw_init;
/* Read irq status register to reset irq line */
rc = at86rf230_read_subreg(lp, RG_IRQ_STATUS, 0xff, 0, &status);
if (rc)
- goto err_irq;
+ goto err_hw_init;
rc = ieee802154_register_device(lp->dev);
if (rc)
- goto err_irq;
+ goto err_hw_init;
return rc;
-err_irq:
- free_irq(spi->irq, lp);
err_hw_init:
flush_work(&lp->irqwork);
spi_set_drvdata(spi, NULL);
@@ -1232,7 +1230,6 @@ static int at86rf230_remove(struct spi_device *spi)
at86rf230_write_subreg(lp, SR_IRQ_MASK, 0);
ieee802154_unregister_device(lp->dev);
- free_irq(spi->irq, lp);
flush_work(&lp->irqwork);
if (gpio_is_valid(pdata->slp_tr))
--
1.9.2
------------------------------------------------------------------------------
Start Your Social Network Today - Download eXo Platform
Build your Enterprise Intranet with eXo Platform Software
Java Based Open Source Intranet - Social, Extensible, Cloud Ready
Get Started Now And Turn Your Intranet Into A Collaboration Platform
http://p.sf.net/sfu/ExoPlatform
next prev parent reply other threads:[~2014-04-24 17:09 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-24 17:09 [PATCH net-next 00/14] at86rf230 cleanup Alexander Aring
[not found] ` <1398359358-11085-1-git-send-email-alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-04-24 17:09 ` [PATCH net-next 01/14] at86rf230: use irq_get_trigger_type Alexander Aring
2014-04-24 17:09 ` [PATCH net-next 02/14] devicetree: add at86rf230 bindings Alexander Aring
2014-04-24 17:09 ` [PATCH net-next 03/14] at86rf230: remove irq_type in request_irq Alexander Aring
2014-04-24 17:09 ` Alexander Aring [this message]
2014-04-24 17:09 ` [PATCH net-next 05/14] at86rf230: use devm_gpio_request_one Alexander Aring
2014-04-24 17:09 ` [PATCH net-next 06/14] at86rf230: add missing MODULE_DEVICE_TABLE Alexander Aring
2014-04-24 17:09 ` [PATCH net-next 07/14] at86rf230: make of_device_id const Alexander Aring
2014-04-24 17:09 ` [PATCH net-next 08/14] at86rf230: add at86rf230_device_id table Alexander Aring
2014-04-24 17:09 ` [PATCH net-next 09/14] at86rf230: remove #ifdef CONFIG_OF Alexander Aring
2014-04-24 17:09 ` [PATCH net-next 10/14] at86rf230: remove unnecessary assign Alexander Aring
2014-04-24 17:09 ` [PATCH net-next 11/14] at86rf230: reset irq line before irq request Alexander Aring
2014-04-24 17:09 ` [PATCH net-next 12/14] at86rf230: remove unnecessary spi_set_drvdata Alexander Aring
2014-04-24 17:09 ` [PATCH net-next 13/14] at86rf230: remove unnecessary state read Alexander Aring
2014-04-24 17:09 ` [PATCH net-next 14/14] at86rf230: remove function for setting irq polarity Alexander Aring
2014-04-26 16:21 ` [PATCH net-next 00/14] at86rf230 cleanup David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1398359358-11085-5-git-send-email-alex.aring@gmail.com \
--to=alex.aring-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).