diff options
author | Dmitry Baryshkov <dbaryshkov@gmail.com> | 2008-04-12 15:08:16 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-04-19 06:29:08 -0400 |
commit | baf1c5d2a08c828d6333e0a37bcdf5afb3d5d003 (patch) | |
tree | 9d07c1803af80d1a33c1c5b2487775b2d30e6736 /drivers/net/irda/pxaficp_ir.c | |
parent | e21e2d467ab4dd050dd02620c74be1e2665d20b9 (diff) |
[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/pxaficp_ir.c')
-rw-r--r-- | drivers/net/irda/pxaficp_ir.c | 10 |
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) | |||
832 | if (err) | 832 | if (err) |
833 | goto err_mem_5; | 833 | goto err_mem_5; |
834 | 834 | ||
835 | if (si->pdata->startup) | ||
836 | err = si->pdata->startup(si->dev); | ||
837 | if (err) | ||
838 | goto err_startup; | ||
839 | |||
835 | dev->hard_start_xmit = pxa_irda_hard_xmit; | 840 | dev->hard_start_xmit = pxa_irda_hard_xmit; |
836 | dev->open = pxa_irda_start; | 841 | dev->open = pxa_irda_start; |
837 | dev->stop = pxa_irda_stop; | 842 | dev->stop = pxa_irda_stop; |
@@ -857,6 +862,9 @@ static int pxa_irda_probe(struct platform_device *pdev) | |||
857 | dev_set_drvdata(&pdev->dev, dev); | 862 | dev_set_drvdata(&pdev->dev, dev); |
858 | 863 | ||
859 | if (err) { | 864 | if (err) { |
865 | if (si->pdata->shutdown) | ||
866 | si->pdata->shutdown(si->dev); | ||
867 | err_startup: | ||
860 | kfree(si->tx_buff.head); | 868 | kfree(si->tx_buff.head); |
861 | err_mem_5: | 869 | err_mem_5: |
862 | kfree(si->rx_buff.head); | 870 | kfree(si->rx_buff.head); |
@@ -882,6 +890,8 @@ static int pxa_irda_remove(struct platform_device *_dev) | |||
882 | if (dev) { | 890 | if (dev) { |
883 | struct pxa_irda *si = netdev_priv(dev); | 891 | struct pxa_irda *si = netdev_priv(dev); |
884 | unregister_netdev(dev); | 892 | unregister_netdev(dev); |
893 | if (si->pdata->shutdown) | ||
894 | si->pdata->shutdown(si->dev); | ||
885 | kfree(si->tx_buff.head); | 895 | kfree(si->tx_buff.head); |
886 | kfree(si->rx_buff.head); | 896 | kfree(si->rx_buff.head); |
887 | clk_put(si->fir_clk); | 897 | clk_put(si->fir_clk); |