public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Kevin Baradon <kevin.baradon@gmail.com>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/4] Revert "media/rc/imon.c: make send_packet() delay larger for 15c2:0036"
Date: Tue, 23 Apr 2013 17:34:25 -0300	[thread overview]
Message-ID: <5176F051.4030902@redhat.com> (raw)
In-Reply-To: <1366661386-6720-2-git-send-email-kevin.baradon@gmail.com>

Hi Kevin,

Em 22-04-2013 17:09, Kevin Baradon escreveu:
> This reverts commit d92f150f9cb80b4df56331d1f42442da78e351f0.
> It seems send_packet() is used during initialization, before send_packet_delay is set.
>
> This will be fixed by another patch.

Reverting patches is a resource that we generally use only when
there's something deadly wrong, as it makes the git history
dirtier, hides the reasons why a change is needed, and might be bad
for git bisecting.

In this specific case, by applying both the revert patch and your newer
one, it is clear that your intent is to move the logic that changes
the send packet delay, because it needs to happen earlier.

So, instead of applying both patches, I'll fold them into one,
as enclosed.

-

From: Kevin Baradon <kevin.baradon@gmail.com>

[media] imon: Use large delays earlier

send_packet() is used during initialization, before send_packet_delay
is set. So, move ictx->send_packet_delay to happen earlier.

[mchehab@redhat.com: fold two patches into one to make git history clearer]
Signed-off-by: Kevin Baradon <kevin.baradon@gmail.com>

diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c
index b8f9f85..624fd33 100644
--- a/drivers/media/rc/imon.c
+++ b/drivers/media/rc/imon.c
@@ -2093,7 +2093,8 @@ static bool imon_find_endpoints(struct imon_context *ictx,
  
  }
  
-static struct imon_context *imon_init_intf0(struct usb_interface *intf)
+static struct imon_context *imon_init_intf0(struct usb_interface *intf,
+					    const struct usb_device_id *id)
  {
  	struct imon_context *ictx;
  	struct urb *rx_urb;
@@ -2133,6 +2134,10 @@ static struct imon_context *imon_init_intf0(struct usb_interface *intf)
  	ictx->vendor  = le16_to_cpu(ictx->usbdev_intf0->descriptor.idVendor);
  	ictx->product = le16_to_cpu(ictx->usbdev_intf0->descriptor.idProduct);
  
+	/* default send_packet delay is 5ms but some devices need more */
+	ictx->send_packet_delay = id->driver_info & IMON_NEED_20MS_PKT_DELAY ?
+				  20 : 5;
+
  	ret = -ENODEV;
  	iface_desc = intf->cur_altsetting;
  	if (!imon_find_endpoints(ictx, iface_desc)) {
@@ -2311,7 +2316,7 @@ static int imon_probe(struct usb_interface *interface,
  	first_if_ctx = usb_get_intfdata(first_if);
  
  	if (ifnum == 0) {
-		ictx = imon_init_intf0(interface);
+		ictx = imon_init_intf0(interface, id);
  		if (!ictx) {
  			pr_err("failed to initialize context!\n");
  			ret = -ENODEV;
@@ -2329,10 +2334,6 @@ static int imon_probe(struct usb_interface *interface,
  
  	}
  
-	/* default send_packet delay is 5ms but some devices need more */
-	ictx->send_packet_delay = id->driver_info & IMON_NEED_20MS_PKT_DELAY ?
-				  20 : 5;
-
  	usb_set_intfdata(interface, ictx);
  
  	if (ifnum == 0) {



  reply	other threads:[~2013-04-23 20:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-22 20:09 [PATCH 0/4] Revert buggy patch and fix other issues with imon driver Kevin Baradon
2013-04-22 20:09 ` [PATCH 1/4] Revert "media/rc/imon.c: make send_packet() delay larger for 15c2:0036" Kevin Baradon
2013-04-23 20:34   ` Mauro Carvalho Chehab [this message]
2013-04-22 20:09 ` [PATCH 2/4] media/rc/imon.c: make send_packet() delay larger for 15c2:0036 [v2] Kevin Baradon
2013-04-22 20:09 ` [PATCH 3/4] media/rc/imon.c: do not try to register 2nd intf if 1st intf failed Kevin Baradon
2013-04-22 20:09 ` [PATCH 4/4] media/rc/imon.c: kill urb when send_packet() is interrupted Kevin Baradon

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=5176F051.4030902@redhat.com \
    --to=mchehab@redhat.com \
    --cc=kevin.baradon@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox