All of lore.kernel.org
 help / color / mirror / Atom feed
From: Douglas Anderson <dianders@chromium.org>
To: balbi@kernel.org, johnyoun@synopsys.com
Cc: stefan.wahren@i2se.com, amstan@chromium.org,
	linux-rockchip@lists.infradead.org, gregkh@linuxfoundation.org,
	johan@kernel.org, eric@anholt.net, mka@chromium.org,
	john.stultz@linaro.org, linux-rpi-kernel@lists.infradead.org,
	jwerner@chromium.org, Douglas Anderson <dianders@chromium.org>,
	Kees Cook <keescook@chromium.org>,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH v3 2/2] usb: dwc2: host: Convert hcd_queue to timer_setup
Date: Mon, 30 Oct 2017 10:08:01 -0700	[thread overview]
Message-ID: <20171030170802.14489-2-dianders@chromium.org> (raw)
In-Reply-To: <20171030170802.14489-1-dianders@chromium.org>

Convert the timers in hcd_queue to use the new timer_setup() call
introduced in commit 686fef928bba ("timer: Prepare to change timer
callback argument type").

Suggested-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Cc: Kees Cook <keescook@chromium.org>
---

Changes in v3:
- Convert hcd_queue to timer_setup new for v3

 drivers/usb/dwc2/hcd_queue.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/usb/dwc2/hcd_queue.c b/drivers/usb/dwc2/hcd_queue.c
index bea0aadd756e..6f5b5c8b0467 100644
--- a/drivers/usb/dwc2/hcd_queue.c
+++ b/drivers/usb/dwc2/hcd_queue.c
@@ -1275,11 +1275,11 @@ static void dwc2_do_unreserve(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh)
  * release the reservation.  This worker is called after the appropriate
  * delay.
  *
- * @work: Pointer to a qh unreserve_work.
+ * @t: Pointer to unreserve_timer in a qh.
  */
-static void dwc2_unreserve_timer_fn(unsigned long data)
+static void dwc2_unreserve_timer_fn(struct timer_list *t)
 {
-	struct dwc2_qh *qh = (struct dwc2_qh *)data;
+	struct dwc2_qh *qh = from_timer(qh, t, unreserve_timer);
 	struct dwc2_hsotg *hsotg = qh->hsotg;
 	unsigned long flags;
 
@@ -1461,11 +1461,11 @@ static void dwc2_deschedule_periodic(struct dwc2_hsotg *hsotg,
  * to retry some time later.  This function handles that timer and moves the
  * qh back to the "inactive" list, then queues transactions.
  *
- * @data: Pointer to a qh to re-schedule.
+ * @t: Pointer to wait_timer in a qh.
  */
-static void dwc2_wait_timer_fn(unsigned long data)
+static void dwc2_wait_timer_fn(struct timer_list *t)
 {
-	struct dwc2_qh *qh = (struct dwc2_qh *)data;
+	struct dwc2_qh *qh = from_timer(qh, t, wait_timer);
 	struct dwc2_hsotg *hsotg = qh->hsotg;
 	unsigned long flags;
 
@@ -1518,9 +1518,8 @@ static void dwc2_qh_init(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh,
 
 	/* Initialize QH */
 	qh->hsotg = hsotg;
-	setup_timer(&qh->unreserve_timer, dwc2_unreserve_timer_fn,
-		    (unsigned long)qh);
-	setup_timer(&qh->wait_timer, dwc2_wait_timer_fn, (unsigned long)qh);
+	timer_setup(&qh->unreserve_timer, dwc2_unreserve_timer_fn, 0);
+	timer_setup(&qh->wait_timer, dwc2_wait_timer_fn, 0);
 	qh->ep_type = ep_type;
 	qh->ep_is_in = ep_is_in;
 
-- 
2.15.0.rc2.357.g7e34df9404-goog

  reply	other threads:[~2017-10-30 17:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-30 17:08 [PATCH v3 1/2] usb: dwc2: host: Don't retry NAKed transactions right away Douglas Anderson
2017-10-30 17:08 ` Douglas Anderson [this message]
2017-10-30 21:25   ` [PATCH v3 2/2] usb: dwc2: host: Convert hcd_queue to timer_setup Kees Cook
2017-10-30 21:25     ` Kees Cook
2017-12-05 16:18 ` [PATCH v3 1/2] usb: dwc2: host: Don't retry NAKed transactions right away Stefan Wahren
2017-12-06  6:06   ` John Youn
2017-12-06  6:06     ` John Youn
2017-12-06  6:06     ` John Youn
2017-12-12 11:06 ` Felipe Balbi
2017-12-12 11:06   ` Felipe Balbi
2017-12-12 18:31   ` Doug Anderson

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=20171030170802.14489-2-dianders@chromium.org \
    --to=dianders@chromium.org \
    --cc=amstan@chromium.org \
    --cc=balbi@kernel.org \
    --cc=eric@anholt.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=john.stultz@linaro.org \
    --cc=johnyoun@synopsys.com \
    --cc=jwerner@chromium.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=stefan.wahren@i2se.com \
    /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.