From patchwork Sun Jan 19 21:48:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Frank_Sch=C3=A4fer?= X-Patchwork-Id: 3510431 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 63ECC9F2E9 for ; Sun, 19 Jan 2014 21:47:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A0E082010E for ; Sun, 19 Jan 2014 21:47:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D5F322010B for ; Sun, 19 Jan 2014 21:47:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752250AbaASVrs (ORCPT ); Sun, 19 Jan 2014 16:47:48 -0500 Received: from mail-ea0-f182.google.com ([209.85.215.182]:61780 "EHLO mail-ea0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752055AbaASVrq (ORCPT ); Sun, 19 Jan 2014 16:47:46 -0500 Received: by mail-ea0-f182.google.com with SMTP id r15so1909730ead.27 for ; Sun, 19 Jan 2014 13:47:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=UKhGSvPXeMm1gS8y3v/6Q5jVh1xtCrXD9UOHgeNNdVQ=; b=V0HW5aHMHhZ5ol6MD7r/8Qh7k0T7UE6ldSI5LzbzC2tPMYAqw2EY4Q/HDy2LsP1uHS N3yDHVlH/e/YFJe/R1J/4J3xvKN6XhwFKzZLAZUa1bi/LXDpU9WgDJcLzVaUe9ZsK5KR SDMZrcDpB5Nv3DJa7O8V4t9oGJ80BcsgUHU5VMqLvAg+kmVAqe5TY5QZ/i7r1YsNwtS7 PKK3xmCro04vGEauPWRkLiJ4S22lmGYsSWyRbQdhdZLoNN7/7f6+UGVohrUaIkHFP/93 TKKSbCoIPvtxfkUv2rkuqctmmIWhOXnAzm5twtj1nmInrxJKg4ln19FDZmGzXg4E1dAC z6Xg== X-Received: by 10.15.111.6 with SMTP id ci6mr14190155eeb.59.1390168065126; Sun, 19 Jan 2014 13:47:45 -0800 (PST) Received: from Athlon64X2-5000.site (ip-178-201-83-195.unitymediagroup.de. [178.201.83.195]) by mx.google.com with ESMTPSA id j46sm47007878eew.18.2014.01.19.13.47.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Jan 2014 13:47:44 -0800 (PST) From: =?UTF-8?q?Frank=20Sch=C3=A4fer?= To: m.chehab@samsung.com Cc: linux-media@vger.kernel.org, =?UTF-8?q?Frank=20Sch=C3=A4fer?= Subject: [PATCH 3/4] em28xx-i2c: do not map -ENXIO errors to -ENODEV for empty i2c transfers Date: Sun, 19 Jan 2014 22:48:36 +0100 Message-Id: <1390168117-2925-4-git-send-email-fschaefer.oss@googlemail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1390168117-2925-1-git-send-email-fschaefer.oss@googlemail.com> References: <1390168117-2925-1-git-send-email-fschaefer.oss@googlemail.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Commit e63b009d6e "" changed the error codes i2c ACK errors from -ENODEV to -ENXIO. But it also introduced a line that maps -ENXIO back to -ENODEV in case of empty i2c messages, which makes no sense, because 1.) an ACK error is an ACK error no matter what the i2c message content is 2.) -ENXIO is perfectly suited for probing, too 3.) we are loosing the ability to distinguish USB device disconnects Signed-off-by: Frank Schäfer --- drivers/media/usb/em28xx/em28xx-i2c.c | 1 - 1 Datei geändert, 1 Zeile entfernt(-) diff --git a/drivers/media/usb/em28xx/em28xx-i2c.c b/drivers/media/usb/em28xx/em28xx-i2c.c index ba6433c..a26d7d4 100644 --- a/drivers/media/usb/em28xx/em28xx-i2c.c +++ b/drivers/media/usb/em28xx/em28xx-i2c.c @@ -539,7 +539,6 @@ static int em28xx_i2c_xfer(struct i2c_adapter *i2c_adap, if (rc == -ENXIO) { if (i2c_debug > 1) printk(KERN_CONT " no device\n"); - rc = -ENODEV; } else { if (i2c_debug > 1) printk(KERN_CONT " ERROR: %i\n", rc);