summaryrefslogtreecommitdiffstats
path: root/drivers/net/irda
diff options
context:
space:
mode:
authorDmitry Baryshkov <dbaryshkov@gmail.com>2008-04-12 20:08:16 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2008-04-19 11:29:08 +0100
commitbaf1c5d2a08c828d6333e0a37bcdf5afb3d5d003 (patch)
tree9d07c1803af80d1a33c1c5b2487775b2d30e6736 /drivers/net/irda
parente21e2d467ab4dd050dd02620c74be1e2665d20b9 (diff)
downloadlinux-baf1c5d2a08c828d6333e0a37bcdf5afb3d5d003.tar.gz
linux-baf1c5d2a08c828d6333e0a37bcdf5afb3d5d003.tar.bz2
linux-baf1c5d2a08c828d6333e0a37bcdf5afb3d5d003.zip
[ARM] 4971/1: pxaficp_ir: provide startup and shutdown hooks
Let platform do some specific initialisation and cleanup things during pxaficp_ir probing and removing. E.g. this can be usefull to request/free gpios used by the platform to control the transceiver. Signed-off-by: Dmitry Baryshkov <dbaryshkov@gmail.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/net/irda')
-rw-r--r--drivers/net/irda/pxaficp_ir.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/net/irda/pxaficp_ir.c b/drivers/net/irda/pxaficp_ir.c
index 8239c520f1ef..8db71ab20456 100644
--- a/drivers/net/irda/pxaficp_ir.c
+++ b/drivers/net/irda/pxaficp_ir.c
@@ -832,6 +832,11 @@ static int pxa_irda_probe(struct platform_device *pdev)
if (err)
goto err_mem_5;
+ if (si->pdata->startup)
+ err = si->pdata->startup(si->dev);
+ if (err)
+ goto err_startup;
+
dev->hard_start_xmit = pxa_irda_hard_xmit;
dev->open = pxa_irda_start;
dev->stop = pxa_irda_stop;
@@ -857,6 +862,9 @@ static int pxa_irda_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, dev);
if (err) {
+ if (si->pdata->shutdown)
+ si->pdata->shutdown(si->dev);
+err_startup:
kfree(si->tx_buff.head);
err_mem_5:
kfree(si->rx_buff.head);
@@ -882,6 +890,8 @@ static int pxa_irda_remove(struct platform_device *_dev)
if (dev) {
struct pxa_irda *si = netdev_priv(dev);
unregister_netdev(dev);
+ if (si->pdata->shutdown)
+ si->pdata->shutdown(si->dev);
kfree(si->tx_buff.head);
kfree(si->rx_buff.head);
clk_put(si->fir_clk);