From patchwork Fri Nov 23 03:41:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 1793921 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 323313FCDE for ; Fri, 23 Nov 2012 06:42:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 38F7AE6212 for ; Thu, 22 Nov 2012 22:42:46 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C098E5F37 for ; Thu, 22 Nov 2012 19:48:25 -0800 (PST) Received: by mail-pa0-f49.google.com with SMTP id bi1so3060302pad.36 for ; Thu, 22 Nov 2012 19:48:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=4MYuqW4f4DINNi/CAuyWurKweHygyB+Vv0NQ2XntN0A=; b=eic/5cqfC2DQfP+PsO+0ai/leLtedg/grR4qH4lZ8hCH4zSgMrY7lELHtjWH4+sjNn cdzwhGF4d0brW8vWKZiwyRnCcvG0G1C6FivqxDyJQcaHbx40BN/xDfoi6d394PUMg/us ZxGMxXXmVpfljIL9DC0iYj6mJ397BWaQJrss9iQ8Jr3pIp5tCHqFXMUDfH/OXItBeeSt 6PV34HOl9l7KsOnEcdIWTfd5aRnf8qjMAj2J30a8fBLrBaFCtn41Yp2LkVqos1xN1CjK U7MeR9zPUXQoJWxLHyFQQ7UlmJ9O0KWGM0oUNfyRctKj/L+8OWX+TzmuoRT4FY0wN6Rf s2OQ== Received: by 10.68.241.232 with SMTP id wl8mr10369776pbc.144.1353642505556; Thu, 22 Nov 2012 19:48:25 -0800 (PST) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id x8sm2937337paw.16.2012.11.22.19.48.22 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Nov 2012 19:48:24 -0800 (PST) From: Sachin Kamat To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/5] drm/exynos: Use devm_gpio_request in exynos_hdmi.c Date: Fri, 23 Nov 2012 09:11:56 +0530 Message-Id: <1353642119-10253-3-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1353642119-10253-1-git-send-email-sachin.kamat@linaro.org> References: <1353642119-10253-1-git-send-email-sachin.kamat@linaro.org> X-Gm-Message-State: ALoCoQkpDivk/VxUViljFK0QWKVa+rBwpBaDe6foDmOG+nBeTGMalh0eeYNwOwUAm3FMUY7B45dL X-Mailman-Approved-At: Thu, 22 Nov 2012 22:38:55 -0800 Cc: patches@linaro.org, sachin.kamat@linaro.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org devm_gpio_request is device managed and makes error handling and exit code simpler. Signed-off-by: Sachin Kamat --- drivers/gpu/drm/exynos/exynos_hdmi.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 59839cc..3fe2d61 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c @@ -2428,7 +2428,7 @@ static int __devinit hdmi_probe(struct platform_device *pdev) goto err_resource; } - ret = gpio_request(hdata->hpd_gpio, "HPD"); + ret = devm_gpio_request(&pdev->dev, hdata->hpd_gpio, "HPD"); if (ret) { DRM_ERROR("failed to request HPD gpio\n"); goto err_resource; @@ -2438,7 +2438,7 @@ static int __devinit hdmi_probe(struct platform_device *pdev) if (i2c_add_driver(&ddc_driver)) { DRM_ERROR("failed to register ddc i2c driver\n"); ret = -ENOENT; - goto err_gpio; + goto err_resource; } hdata->ddc_port = hdmi_ddc; @@ -2501,8 +2501,6 @@ err_hdmiphy: i2c_del_driver(&hdmiphy_driver); err_ddc: i2c_del_driver(&ddc_driver); -err_gpio: - gpio_free(hdata->hpd_gpio); err_resource: hdmi_resources_cleanup(hdata); err_data: @@ -2522,8 +2520,6 @@ static int __devexit hdmi_remove(struct platform_device *pdev) free_irq(hdata->internal_irq, hdata); free_irq(hdata->external_irq, hdata); - gpio_free(hdata->hpd_gpio); - hdmi_resources_cleanup(hdata); /* hdmiphy i2c driver */