From patchwork Sun Jun 13 18:09:27 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarkko Nikula X-Patchwork-Id: 105846 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 o5DI9fUs013113 for ; Sun, 13 Jun 2010 18:09:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754512Ab0FMSJ1 (ORCPT ); Sun, 13 Jun 2010 14:09:27 -0400 Received: from mail-ww0-f46.google.com ([74.125.82.46]:65302 "EHLO mail-ww0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754593Ab0FMSJ1 (ORCPT ); Sun, 13 Jun 2010 14:09:27 -0400 Received: by wwb18 with SMTP id 18so3028519wwb.19 for ; Sun, 13 Jun 2010 11:09:25 -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; bh=OhvyhB7WOgm8qpRhgEMcIxy5+h7jl36etlPk6U+q6Ok=; b=Jz/OcJHaByEDwO1UT5e1x9TiHpisyMVf0wxII3Qkg0b9qxbMVtZGtZlpgJ5v7NnBgr G3dj3lu4dm47pAW6Qx6MkMi/HTzMKRazo7+cGuMGROg7mboZ3HK1vOGZQwibWQJ5gvFw DhD58854YzHpMXOzvxcAEVlk8Ilj/rioNqPAQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=xtWCQjlpv1KM1V6nDfEPLvlYYvUL6hYRPwSblAGfISUwWIl2+RAWnK7Z3u0SlQqdy+ yQ2OaVzwKwRJwtIi7y2AdxFaGx4fwDmROGIwxtuYM0e1J3fLbHiYI63r1y9KtpuFXaj/ AqpUkuyf+yMXBkVXstXlqY4MFkmdbD32Gjrk4= Received: by 10.227.151.66 with SMTP id b2mr4602456wbw.158.1276452565504; Sun, 13 Jun 2010 11:09:25 -0700 (PDT) Received: from localhost (host-94-101-4-66.igua.fi [94.101.4.66]) by mx.google.com with ESMTPS id u36sm29630865wbv.6.2010.06.13.11.09.23 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 13 Jun 2010 11:09:24 -0700 (PDT) From: Jarkko Nikula To: linux-media@vger.kernel.org Cc: Jarkko Nikula , Eduardo Valentin Subject: [PATCH 1/2] V4L/DVB: radio-si4713: Release i2c adapter in driver cleanup paths Date: Sun, 13 Jun 2010 21:09:27 +0300 Message-Id: <1276452568-16366-1-git-send-email-jhnikula@gmail.com> X-Mailer: git-send-email 1.7.1 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, 13 Jun 2010 18:09:41 +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);