public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: "Frank Schäfer" <fschaefer.oss@googlemail.com>
To: m.chehab@samsung.com
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH 4/4] em28xx-i2c: remove duplicate error printing code from em28xx_i2c_xfer()
Date: Sun, 09 Feb 2014 19:38:41 +0100	[thread overview]
Message-ID: <52F7CB31.4060608@googlemail.com> (raw)
In-Reply-To: <20140204165039.01ef46a0@samsung.com>


Am 04.02.2014 19:50, schrieb Mauro Carvalho Chehab:
> Em Sun, 19 Jan 2014 22:48:37 +0100
> Frank Schäfer <fschaefer.oss@googlemail.com> escreveu:
>
>> Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com>
>> ---
>>  drivers/media/usb/em28xx/em28xx-i2c.c |   11 +++--------
>>  1 Datei geändert, 3 Zeilen hinzugefügt(+), 8 Zeilen entfernt(-)
>>
>> diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c
>> index a26d7d4..1a514ca 100644
>> --- a/drivers/media/usb/em28xx/em28xx-i2c.c
>> +++ b/drivers/media/usb/em28xx/em28xx-i2c.c
>> @@ -535,14 +535,9 @@ static int em28xx_i2c_xfer(struct i2c_adapter *i2c_adap,
>>  			 * This code is only called during device probe.
>>  			 */
>>  			rc = i2c_check_for_device(i2c_bus, addr);
>> -			if (rc < 0) {
>> -				if (rc == -ENXIO) {
>> -					if (i2c_debug > 1)
>> -						printk(KERN_CONT " no device\n");
>> -				} else {
>> -					if (i2c_debug > 1)
>> -						printk(KERN_CONT " ERROR: %i\n", rc);
>> -				}
>> +			if (rc == -ENXIO) {
>> +				if (i2c_debug > 1)
>> +					printk(KERN_CONT " no device\n");
> Even if the previous patch were accepted, this one is wrong, as -ENXIO
> doesn't always mean that there's no device. Also, other return codes
> may happen here (like -EIO).
Mauro... please read the patch and the corresponding code again.
You will notice that there is absolutely no functional change.
The patch just removes duplicate code.
Hence your comment makes no sense.

If you insist on the weird -ENODEV/-ENXIO inconsistency you've
introduced, then of course the patch needs to be rebased.

>>  				rt_mutex_unlock(&dev->i2c_bus_lock);
>>  				return rc;
>>  			}


      reply	other threads:[~2014-02-09 18:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-19 21:48 [PATCH 0/4] em28xx: resolve the remaining issues with the i2c code Frank Schäfer
2014-01-19 21:48 ` [PATCH 1/4] em28xx-i2c: fix the i2c error description strings for -ENXIO Frank Schäfer
2014-01-19 21:48 ` [PATCH 2/4] em28xx-i2c: fix the error code for unknown errors Frank Schäfer
2014-01-19 21:48 ` [PATCH 3/4] em28xx-i2c: do not map -ENXIO errors to -ENODEV for empty i2c transfers Frank Schäfer
2014-02-04 18:47   ` Mauro Carvalho Chehab
2014-02-09 18:34     ` Frank Schäfer
2014-02-11 23:51       ` Antti Palosaari
2014-01-19 21:48 ` [PATCH 4/4] em28xx-i2c: remove duplicate error printing code from em28xx_i2c_xfer() Frank Schäfer
2014-02-04 18:50   ` Mauro Carvalho Chehab
2014-02-09 18:38     ` Frank Schäfer [this message]

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=52F7CB31.4060608@googlemail.com \
    --to=fschaefer.oss@googlemail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox