All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Németh Márton" <nm127@freemail.hu>
To: Jean-Francois Moine <moinejf@free.fr>
Cc: V4L Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH] gspca main: reorganize loop
Date: Sun, 29 Nov 2009 12:19:46 +0100	[thread overview]
Message-ID: <4B1258D2.7060706@freemail.hu> (raw)
In-Reply-To: <20091129113834.6b47767a@tele>

Jean-Francois Moine wrote:
> On Sun, 29 Nov 2009 11:24:31 +0100
> Németh Márton <nm127@freemail.hu> wrote:
> 
>> From: Márton Németh <nm127@freemail.hu>
>>
>> Eliminate redundant code by reorganizing the loop.
>>
>> Signed-off-by: Márton Németh <nm127@freemail.hu>
>> ---
>> diff -r 064a82aa2daa linux/drivers/media/video/gspca/gspca.c
>> --- a/linux/drivers/media/video/gspca/gspca.c	Thu Nov 26
>> 19:36:40 2009 +0100 +++
>> b/linux/drivers/media/video/gspca/gspca.c	Sun Nov 29 11:09:33
>> 2009 +0100 @@ -623,12 +623,12 @@ if (ret < 0)
>>  			goto out;
>>  	}
>> -	ep = get_ep(gspca_dev);
>> -	if (ep == NULL) {
>> -		ret = -EIO;
>> -		goto out;
>> -	}
>>  	for (;;) {
>> +		ep = get_ep(gspca_dev);
>> +		if (ep == NULL) {
>> +			ret = -EIO;
>> +			goto out;
>> +		}
>>  		PDEBUG(D_STREAM, "init transfer alt %d",
>> gspca_dev->alt); ret = create_urbs(gspca_dev, ep);
>>  		if (ret < 0)
>> @@ -677,12 +677,6 @@
>>  			ret =
>> gspca_dev->sd_desc->isoc_nego(gspca_dev); if (ret < 0)
>>  				goto out;
>> -		} else {
>> -			ep = get_ep(gspca_dev);
>> -			if (ep == NULL) {
>> -				ret = -EIO;
>> -				goto out;
>> -			}
>>  		}
>>  	}
>>  out:
> 
> Hello Márton,
> 
> As you may see, in the loop, get_ep() is called only when isoc_nego()
> is not called. So, your patch does not work.

You are right, I overseen that.

Is there any subdriver where the isoc_nego() is implemented? I couldn't find
one. What would be the task of the isoc_nego() function? Should it set
the interface by calling usb_set_interface() as the get_ep() does? Should
it create URBs for the endpoint?

Although I found the patch where the isoc_nego() was introduced
( http://linuxtv.org/hg/v4l-dvb/rev/5a5b23605bdb56aec86c9a89de8ca8b8ae9cb925 )
it is not clear how the "ep" pointer is updated when not the isoc_nego() is
called instead of get_ep() in the current implementation.

Regards,

	Márton Németh

  reply	other threads:[~2009-11-29 11:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-29 10:24 [PATCH] gspca main: reorganize loop Németh Márton
2009-11-29 10:38 ` Jean-Francois Moine
2009-11-29 11:19   ` Németh Márton [this message]
2009-11-29 12:15     ` Jean-Francois Moine
2009-11-29 16:33       ` Hans de Goede

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=4B1258D2.7060706@freemail.hu \
    --to=nm127@freemail.hu \
    --cc=linux-media@vger.kernel.org \
    --cc=moinejf@free.fr \
    /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.