提交 68144e0c 编写于 作者: P Philipp Zabel 提交者: Greg Kroah-Hartman

USB: otg: add otg_put_transceiver()

As Russell King points out, calling put_device(otg_transceiver->dev)
directly in driver cleanup paths makes assumptions about otg_transceiver
internals.
Signed-off-by: NPhilipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: NDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 6084f1bf
......@@ -96,6 +96,12 @@ struct otg_transceiver *otg_get_transceiver(void)
}
EXPORT_SYMBOL(otg_get_transceiver);
void otg_put_transceiver(struct otg_transceiver *x)
{
put_device(x->dev);
}
EXPORT_SYMBOL(otg_put_transceiver);
int otg_set_transceiver(struct otg_transceiver *x)
{
if (xceiv && x)
......
......@@ -3006,7 +3006,7 @@ static int __init omap_udc_probe(struct platform_device *pdev)
cleanup0:
if (xceiv)
put_device(xceiv->dev);
otg_put_transceiver(xceiv);
if (cpu_is_omap16xx() || cpu_is_omap24xx()) {
clk_disable(hhc_clk);
......@@ -3034,7 +3034,7 @@ static int __exit omap_udc_remove(struct platform_device *pdev)
pullup_disable(udc);
if (udc->transceiver) {
put_device(udc->transceiver->dev);
otg_put_transceiver(udc->transceiver);
udc->transceiver = NULL;
}
omap_writew(0, UDC_SYSCON1);
......
......@@ -84,6 +84,7 @@ extern int otg_set_transceiver(struct otg_transceiver *);
/* for usb host and peripheral controller drivers */
extern struct otg_transceiver *otg_get_transceiver(void);
extern void otg_put_transceiver(struct otg_transceiver *);
static inline int
otg_start_hnp(struct otg_transceiver *otg)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册