usb langwell otg: use notifier chain of struct otg_transceiver
PATCH v2 1/1 usb langwell otg: use notifier chain of struct otg_transceiver
Use notifier chain in otg_transceiver instead of own notifier chain.
This patch depends on another patch which change otg_transceiver notifier chain to atomic one, please see:
https://lkml.org/lkml/2011/1/19/72
--- drivers/usb/otg/langwell_otg.c | 7 +++---- include/linux/usb/intel_mid_otg.h | 17 ----------------- 2 files changed, 3 insertions(+), 21 deletions(-)
drivers/usb/otg/langwell_otg.c +3 -4
@@ -2124,12 +2124,11 @@ static int langwell_otg_probe(struct pci }init_timer (&lnw->hsm_timer); -ATOMIC_INIT_NOTIFIER_HEAD (&lnw->iotg.iotg_notifier); +ATOMIC_INIT_NOTIFIER_HEAD (&lnw->iotg.otg.notifier); lnw->iotg_notifier.notifier_call = langwell_otg_iotg_notify; - retval =intel_mid_otg_register_notifier (&lnw->iotg, - &lnw->iotg_notifier); + retval =otg_register_notifier (&lnw->iotg.otg, &lnw->iotg_notifier);if (retval) {dev_dbg (lnw->dev,"Failed to register notifier\n" ); goto err;
@@ -2187,7 +2186,7 @@ static void langwell_otg_remove(struct pflush_workqueue (lnw->qwork);destroy_workqueue (lnw->qwork); } -intel_mid_otg_unregister_notifier (&lnw->iotg, &lnw->iotg_notifier); +otg_unregister_notifier (&lnw->iotg.otg, &lnw->iotg_notifier);langwell_otg_free_timers ();/* disable OTGSC interrupt as OTGSC doesn't change in reset */
include/linux/usb/intel_mid_otg.h +0 -17
@@ -117,9 +117,6 @@ struct intel_mid_otg_xceiv {/* ops to access ulpi */ struct iotg_ulpi_access_ops ulpi_ops; -/* atomic notifier for interrupt context */ -struct atomic_notifier_head iotg_notifier; -/* start/stop USB Host function */ int (*start_host)(struct intel_mid_otg_xceiv *iotg);int (*stop_host)(struct intel_mid_otg_xceiv *iotg);
@@ -163,18 +160,4 @@ struct intel_mid_otg_xceiv *otg_to_mid_x#define MID_OTG_NOTIFY_CLIENTADD 0x0009#define MID_OTG_NOTIFY_CLIENTREMOVE 0x000a -static inline int -intel_mid_otg_register_notifier (struct intel_mid_otg_xceiv *iotg, -struct notifier_block *nb) -{ -return atomic_notifier_chain_register (&iotg->iotg_notifier, nb); -} - -static inline void -intel_mid_otg_unregister_notifier (struct intel_mid_otg_xceiv *iotg, -struct notifier_block *nb) -{ -atomic_notifier_chain_unregister (&iotg->iotg_notifier, nb); -} -#endif /* __INTEL_MID_OTG_H */
Quoted 5 lines · Yang Ruirui
Use notifier chain in
otg_transceiverinstead of own notifier chain.This patch depends on another patch which change
otg_transceivernotifier chain to atomic one, please see:
https://lkml.org/lkml/2011/1/19/72
Looks good to me, no need to keep its own atomic notifier chain if struct otg_transceiver has one.
Quoted 2 lines
Signed-off-by Yang Ruirui <[email protected]>Reviewed-by Felipe Balbi <[email protected]>
Thanks
Hao
Hello.
Quoted 5 lines · Yang Ruirui
Use notifier chain in
otg_transceiverinstead of own notifier chain.This patch depends on another patch which change
otg_transceivernotifier chain to atomic one, please see:
https://lkml.org/lkml/2011/1/19/72
Such comments should generally follow the --- tearline.
Quoted 3 lines
Signed-off-by Yang Ruirui<[email protected]>Reviewed-by Felipe Balbi<[email protected]>---
WBR, Sergei
Quoted 11 lines · Sergei Shtylyov
Hello.
Quoted 5 lines · Yang Ruirui
Use notifier chain in
otg_transceiverinstead of own notifier chain.This patch depends on another patch which change
otg_transceivernotifier chain to atomic one, please see:
https://lkml.org/lkml/2011/1/19/72Such comments should generally follow the --- tearline.
Agree, I will resend. Thank you.
Quoted 6 lines
Quoted 4 lines
Signed-off-by Yang Ruirui<[email protected]>Reviewed-by Felipe Balbi<[email protected]>---
WBR, Sergei