diff options
-rw-r--r-- | drivers/net/irda/pxaficp_ir.c | 10 | ||||
-rw-r--r-- | include/asm-arm/arch-pxa/irda.h | 2 |
2 files changed, 12 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); |
diff --git a/include/asm-arm/arch-pxa/irda.h b/include/asm-arm/arch-pxa/irda.h index 748406f384c2..99f4f423a8e1 100644 --- a/include/asm-arm/arch-pxa/irda.h +++ b/include/asm-arm/arch-pxa/irda.h | |||
@@ -10,6 +10,8 @@ | |||
10 | struct pxaficp_platform_data { | 10 | struct pxaficp_platform_data { |
11 | int transceiver_cap; | 11 | int transceiver_cap; |
12 | void (*transceiver_mode)(struct device *dev, int mode); | 12 | void (*transceiver_mode)(struct device *dev, int mode); |
13 | int (*startup)(struct device *dev); | ||
14 | void (*shutdown)(struct device *dev); | ||
13 | }; | 15 | }; |
14 | 16 | ||
15 | extern void pxa_set_ficp_info(struct pxaficp_platform_data *info); | 17 | extern void pxa_set_ficp_info(struct pxaficp_platform_data *info); |