From patchwork Sun May 20 06:50:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 49718 Received: from vger.kernel.org ([209.132.180.67]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fKIC2-0002Rj-3B; Sun, 20 May 2018 06:51:46 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751675AbeETGus (ORCPT + 1 other); Sun, 20 May 2018 02:50:48 -0400 Received: from sauhun.de ([88.99.104.3]:41522 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751537AbeETGup (ORCPT ); Sun, 20 May 2018 02:50:45 -0400 Received: from localhost (p54B33698.dip0.t-ipconnect.de [84.179.54.152]) by pokefinder.org (Postfix) with ESMTPSA id 72FBC3640AA; Sun, 20 May 2018 08:50:43 +0200 (CEST) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: Peter Rosin , Wolfram Sang , Hans Verkuil , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/7] media: hdpvr: don't check number of messages in the driver Date: Sun, 20 May 2018 08:50:36 +0200 Message-Id: <20180520065039.7989-6-wsa@the-dreams.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180520065039.7989-1-wsa@the-dreams.de> References: <20180520065039.7989-1-wsa@the-dreams.de> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Since commit 1eace8344c02 ("i2c: add param sanity check to i2c_transfer()"), the I2C core does this check now. We can remove it from drivers. Signed-off-by: Wolfram Sang --- Only build tested. drivers/media/usb/hdpvr/hdpvr-i2c.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/media/usb/hdpvr/hdpvr-i2c.c b/drivers/media/usb/hdpvr/hdpvr-i2c.c index 4720d79b0282..c97dcf981b3f 100644 --- a/drivers/media/usb/hdpvr/hdpvr-i2c.c +++ b/drivers/media/usb/hdpvr/hdpvr-i2c.c @@ -117,9 +117,6 @@ static int hdpvr_transfer(struct i2c_adapter *i2c_adapter, struct i2c_msg *msgs, struct hdpvr_device *dev = i2c_get_adapdata(i2c_adapter); int retval = 0, addr; - if (num <= 0) - return 0; - mutex_lock(&dev->i2c_mutex); addr = msgs[0].addr << 1;