From patchwork Sun Mar 28 11:29:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 88752 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2SBTMW4029580 for ; Sun, 28 Mar 2010 11:29:22 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754099Ab0C1L3U (ORCPT ); Sun, 28 Mar 2010 07:29:20 -0400 Received: from mail-bw0-f209.google.com ([209.85.218.209]:59895 "EHLO mail-bw0-f209.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751647Ab0C1L3T (ORCPT ); Sun, 28 Mar 2010 07:29:19 -0400 Received: by bwz1 with SMTP id 1so2876701bwz.21 for ; Sun, 28 Mar 2010 04:29:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=T15gUQ+x0wBJRaiVaGePvR+UUCG+2fsmxfAOQyNxmwA=; b=q8WoTyY7Xuxe2WQOdqiYaP7/LFFPuMhdbkSg0XLC3OJ8cl6+jkSWaY6EGyydYp8VSU lDwgFTqinE+EkN4bFvlF0Gy2NLgjsHslQ+8zOkvDm1s99pwV4FnDYGNcMKZ+2c00n719 6hGxRgs4M8+E5372S1szdcUIzRx8ST7gmFNZ8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=ebCmLBH0K23vB2eFG4DPcAdkN/57eDDicT1o/5BMpNCDeS1pv09fzsXpjE4KTgpnXi SXaCAuF71ZfFwGnOj77mTZhb2eVOfyEJby7+/9iBSn8EoylR5Lg4wvPMKaJZJlvIfov+ jtXFITPjrPCFgDkonO5tXRuq6KaC7m3ILVpro= Received: by 10.204.36.208 with SMTP id u16mr4423255bkd.168.1269775757304; Sun, 28 Mar 2010 04:29:17 -0700 (PDT) Received: from bicker ([196.43.68.224]) by mx.google.com with ESMTPS id l1sm27193329bkl.20.2010.03.28.04.29.14 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 28 Mar 2010 04:29:16 -0700 (PDT) Date: Sun, 28 Mar 2010 14:29:09 +0300 From: Dan Carpenter To: Mauro Carvalho Chehab Cc: Dean Anderson , Laurent Pinchart , Mike Isely , =?iso-8859-1?Q?Andr=E9?= Goddard Rosa , linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] video/s255drv: cleanup. remove uneeded NULL check Message-ID: <20100328112909.GP5069@bicker> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sun, 28 Mar 2010 11:29:23 +0000 (UTC) diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c index fb742f1..e70af5d 100644 --- a/drivers/media/video/s2255drv.c +++ b/drivers/media/video/s2255drv.c @@ -2582,8 +2582,9 @@ error: /* disconnect routine. when board is removed physically or with rmmod */ static void s2255_disconnect(struct usb_interface *interface) { - struct s2255_dev *dev = NULL; + struct s2255_dev *dev; int i; + dprintk(1, "s2255: disconnect interface %p\n", interface); dev = usb_get_intfdata(interface); @@ -2602,11 +2603,9 @@ static void s2255_disconnect(struct usb_interface *interface) usb_set_intfdata(interface, NULL); mutex_unlock(&dev->open_lock); - if (dev) { - kref_put(&dev->kref, s2255_destroy); - dprintk(1, "s2255drv: disconnect\n"); - dev_info(&interface->dev, "s2255usb now disconnected\n"); - } + kref_put(&dev->kref, s2255_destroy); + dprintk(1, "s2255drv: disconnect\n"); + dev_info(&interface->dev, "s2255usb now disconnected\n"); } static struct usb_driver s2255_driver = {