From patchwork Tue Sep 21 08:49:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 196652 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8L8nbEV007789 for ; Tue, 21 Sep 2010 08:49:37 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756356Ab0IUItg (ORCPT ); Tue, 21 Sep 2010 04:49:36 -0400 Received: from mail-ew0-f46.google.com ([209.85.215.46]:52317 "EHLO mail-ew0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756104Ab0IUItf (ORCPT ); Tue, 21 Sep 2010 04:49:35 -0400 Received: by ewy23 with SMTP id 23so1843056ewy.19 for ; Tue, 21 Sep 2010 01:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:subject:date :message-id:x-mailer:in-reply-to:references; bh=N3T8ZYzCfLxHfAYo6mtv0PQLLAiQVdUr8awTHKtoSCs=; b=fLuqYgFa8wFJWhr5Mth+wMmbAYKvif5JoNF9YVt7Bpd4fpoRjjyTH9HtD7kFefkc1T 1pwuaHMnSqlHHAYE3PcXWnxTtolLkLEWGHi65AlWZCV+MVDx1Pf8OH/LhWXioSEBu8ph eYaBlsbE2QTi8meKq91vpxdEnniP65sWCBI6k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=hMZRkPJfTsL/4u0ULh1NWQzEVtfy2IUCb1vuE+oW1nZkxFXfHFaBSw26/IU3FtaxLo 5fKlV4fslcU4S4FKl35t0EGyn2z9oHoa0m93+FlMPkB9bvm2eN18ICwPSPhHAVz9gPxn 7haGPiQtk/tCjhlIGMd9Y9WowkDtTDeAt3icI= Received: by 10.213.56.6 with SMTP id w6mr3554065ebg.32.1285058974158; Tue, 21 Sep 2010 01:49:34 -0700 (PDT) Received: from localhost (host-94-101-4-66.igua.fi [94.101.4.66]) by mx.google.com with ESMTPS id a48sm12467505eei.1.2010.09.21.01.49.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 21 Sep 2010 01:49:33 -0700 (PDT) From: Jarkko Nikula To: linux-media@vger.kernel.org Cc: Mauro Carvalho Chehab , Eduardo Valentin , Jarkko Nikula Subject: [PATCHv2 1/2] V4L/DVB: radio-si4713: Release i2c adapter in driver cleanup paths Date: Tue, 21 Sep 2010 11:49:42 +0300 Message-Id: <1285058983-28657-2-git-send-email-jhnikula@gmail.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1285058983-28657-1-git-send-email-jhnikula@gmail.com> References: <1285058983-28657-1-git-send-email-jhnikula@gmail.com> 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 (demeter1.kernel.org [140.211.167.41]); Tue, 21 Sep 2010 08:49:38 +0000 (UTC) diff --git a/drivers/media/radio/radio-si4713.c b/drivers/media/radio/radio-si4713.c index 13554ab..0a9fc4d 100644 --- a/drivers/media/radio/radio-si4713.c +++ b/drivers/media/radio/radio-si4713.c @@ -296,14 +296,14 @@ static int radio_si4713_pdriver_probe(struct platform_device *pdev) if (!sd) { dev_err(&pdev->dev, "Cannot get v4l2 subdevice\n"); rval = -ENODEV; - goto unregister_v4l2_dev; + goto put_adapter; } rsdev->radio_dev = video_device_alloc(); if (!rsdev->radio_dev) { dev_err(&pdev->dev, "Failed to alloc video device.\n"); rval = -ENOMEM; - goto unregister_v4l2_dev; + goto put_adapter; } memcpy(rsdev->radio_dev, &radio_si4713_vdev_template, @@ -320,6 +320,8 @@ static int radio_si4713_pdriver_probe(struct platform_device *pdev) free_vdev: video_device_release(rsdev->radio_dev); +put_adapter: + i2c_put_adapter(adapter); unregister_v4l2_dev: v4l2_device_unregister(&rsdev->v4l2_dev); free_rsdev: @@ -335,8 +337,12 @@ static int __exit radio_si4713_pdriver_remove(struct platform_device *pdev) struct radio_si4713_device *rsdev = container_of(v4l2_dev, struct radio_si4713_device, v4l2_dev); + struct v4l2_subdev *sd = list_entry(v4l2_dev->subdevs.next, + struct v4l2_subdev, list); + struct i2c_client *client = v4l2_get_subdevdata(sd); video_unregister_device(rsdev->radio_dev); + i2c_put_adapter(client->adapter); v4l2_device_unregister(&rsdev->v4l2_dev); kfree(rsdev);