From patchwork Fri Nov 16 04:55:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 12883 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C52C223FC1 for ; Fri, 16 Nov 2012 05:01:30 +0000 (UTC) Received: from mail-ia0-f180.google.com (mail-ia0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 5141AA18185 for ; Fri, 16 Nov 2012 05:01:30 +0000 (UTC) Received: by mail-ia0-f180.google.com with SMTP id f6so1391032iag.11 for ; Thu, 15 Nov 2012 21:01:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=ubpy6j0l49OxUtg52UTaROJqtvd7Y3TrsSCTTTOQKF8=; b=MLUfwb9ilF1z570zltHy9AzRsUlk+RTDPDLpn16HxxRyhR9dAqNGB8mjwJeVXT4eGw 6fzpdLyErM+kXOupAEB+608YHJR66NQjSU27crvNLBibfCYLG528KhYMQ8T3Gx+qF2RX GolO29O9EEYogJNkOFvCRKrHFTw2VKHTMhxsaZTEmHdbNT/uS0BNQe95bEmXaVOi7X+B YiOOfPA50mOMoujiYZGdkYD6S37rSLJmMAcuyedaq4a/PoofS4XUFWYCldogZ3yr4WRA VxPEEeTxrEzYQPs4LB1biHEr9ERH7XJ3TU/5BgmobzV/WQR/HxamSU+TkwkQP/wlCDWf xgdA== Received: by 10.50.213.34 with SMTP id np2mr2045977igc.57.1353042089766; Thu, 15 Nov 2012 21:01:29 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.67.148 with SMTP id n20csp14056igt; Thu, 15 Nov 2012 21:01:29 -0800 (PST) Received: by 10.66.90.73 with SMTP id bu9mr9431438pab.71.1353042088751; Thu, 15 Nov 2012 21:01:28 -0800 (PST) Received: from mail-pb0-f53.google.com (mail-pb0-f53.google.com [209.85.160.53]) by mx.google.com with ESMTPS id ka8si1146933pbc.335.2012.11.15.21.01.27 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Nov 2012 21:01:28 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.53 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.53; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.53 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by mail-pb0-f53.google.com with SMTP id jt11so1640965pbb.40 for ; Thu, 15 Nov 2012 21:01:27 -0800 (PST) Received: by 10.66.82.68 with SMTP id g4mr9753055pay.9.1353042087814; Thu, 15 Nov 2012 21:01:27 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id i10sm424739paz.17.2012.11.15.21.01.24 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 15 Nov 2012 21:01:27 -0800 (PST) From: Sachin Kamat To: linux-media@vger.kernel.org Cc: t.stanislaws@samsung.com, sachin.kamat@linaro.org, patches@linaro.org, sylvester.nawrocki@gmail.com, s.nawrocki@samsung.com Subject: [PATCH 1/1] [media] s5p-tv: Use devm_gpio_request in sii9234_drv.c Date: Fri, 16 Nov 2012 10:25:28 +0530 Message-Id: <1353041728-11032-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQnJ8yvWR0dlcKTuubCNUXgAS/WO5AP6FNClatHjC1qmBtHW893x3K/IDgAvrcuM6SvRx5Ub devm_gpio_request is a device managed function and will make error handling and cleanup a bit simpler. Signed-off-by: Sachin Kamat Acked-by: Tomasz Stanislawski --- drivers/media/platform/s5p-tv/sii9234_drv.c | 6 +----- 1 files changed, 1 insertions(+), 5 deletions(-) diff --git a/drivers/media/platform/s5p-tv/sii9234_drv.c b/drivers/media/platform/s5p-tv/sii9234_drv.c index 716d484..4597342 100644 --- a/drivers/media/platform/s5p-tv/sii9234_drv.c +++ b/drivers/media/platform/s5p-tv/sii9234_drv.c @@ -338,7 +338,7 @@ static int __devinit sii9234_probe(struct i2c_client *client, } ctx->gpio_n_reset = pdata->gpio_n_reset; - ret = gpio_request(ctx->gpio_n_reset, "MHL_RST"); + ret = devm_gpio_request(dev, ctx->gpio_n_reset, "MHL_RST"); if (ret) { dev_err(dev, "failed to acquire MHL_RST gpio\n"); return ret; @@ -370,7 +370,6 @@ fail_pm_get: fail_pm: pm_runtime_disable(dev); - gpio_free(ctx->gpio_n_reset); fail: dev_err(dev, "probe failed\n"); @@ -381,11 +380,8 @@ fail: static int __devexit sii9234_remove(struct i2c_client *client) { struct device *dev = &client->dev; - struct v4l2_subdev *sd = i2c_get_clientdata(client); - struct sii9234_context *ctx = sd_to_context(sd); pm_runtime_disable(dev); - gpio_free(ctx->gpio_n_reset); dev_info(dev, "remove successful\n");