From: Yang Ruirui <ruirui.r.yang@tieto.com>
To: Felipe Balbi <balbi@ti.com>, Greg Kroah-Hartman <gregkh@suse.de>,
Hao Wu <hao.wu@intel.com>, Alan Cox <alan@linux.intel.com>,
Alek Du <alek.du@intel.com>, <linux-usb@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH v2] usb langwell otg: use notifier chain of struct otg_transceiver
Date: Thu, 20 Jan 2011 15:05:13 +0800 [thread overview]
Message-ID: <20110120070513.GA24956@darkstar> (raw)
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
Signed-off-by: Yang Ruirui <ruirui.r.yang@tieto.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
---
drivers/usb/otg/langwell_otg.c | 7 +++----
include/linux/usb/intel_mid_otg.h | 17 -----------------
2 files changed, 3 insertions(+), 21 deletions(-)
--- linux-2.6.orig/drivers/usb/otg/langwell_otg.c 2010-12-15 15:43:36.000000000 +0800
+++ linux-2.6/drivers/usb/otg/langwell_otg.c 2011-01-20 13:33:28.346040564 +0800
@@ -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 p
flush_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 */
--- linux-2.6.orig/include/linux/usb/intel_mid_otg.h 2010-12-15 15:43:38.000000000 +0800
+++ linux-2.6/include/linux/usb/intel_mid_otg.h 2011-01-20 13:23:48.809375229 +0800
@@ -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 */
next reply other threads:[~2011-01-20 6:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-20 7:05 Yang Ruirui [this message]
2011-01-20 7:42 ` [PATCH v2] usb langwell otg: use notifier chain of struct otg_transceiver Wu, Hao
2011-01-20 12:09 ` Sergei Shtylyov
2011-01-21 1:58 ` Yang Ruirui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110120070513.GA24956@darkstar \
--to=ruirui.r.yang@tieto.com \
--cc=alan@linux.intel.com \
--cc=alek.du@intel.com \
--cc=balbi@ti.com \
--cc=gregkh@suse.de \
--cc=hao.wu@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.