Skip to content

Commit

Permalink
[ARM] 4971/1: pxaficp_ir: provide startup and shutdown hooks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Baryshkov authored and Russell King committed Apr 19, 2008
1 parent e21e2d4 commit baf1c5d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions drivers/net/irda/pxaficp_ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand All @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions include/asm-arm/arch-pxa/irda.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
struct pxaficp_platform_data {
int transceiver_cap;
void (*transceiver_mode)(struct device *dev, int mode);
int (*startup)(struct device *dev);
void (*shutdown)(struct device *dev);
};

extern void pxa_set_ficp_info(struct pxaficp_platform_data *info);
Expand Down

0 comments on commit baf1c5d

Please sign in to comment.