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: 13107 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 44E1223FC1 for ; Fri, 23 Nov 2012 03:48:27 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id C0543A181DF for ; Fri, 23 Nov 2012 03:48:26 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id c10so1335312ieb.11 for ; Thu, 22 Nov 2012 19:48:26 -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:in-reply-to:references :x-gm-message-state; bh=4MYuqW4f4DINNi/CAuyWurKweHygyB+Vv0NQ2XntN0A=; b=gCFSNxRvdtDUDUOPU0oKee9htnW54becMYdAPl0OYZo2kFrWj9MsbxE2QdjXjEr6fe y7O+7DjpWnRF4T2+l3sH8Vl8dUBfRoGBk37lpF5m1XqoNLtQXMA4K6RFyhVsz0XI1Pkf Q2UaYqnHQykbKszOsjbveLUAGLO6R6tkaKQuULwc/LAs1uP3vR9k73SDX+k/5QyTBXgZ sAhOxf/4KI78IznFHUyY4fM1HMQL46BHkTPF2QJHf5b+GZozZQHIS3rRQCZtcOmb48aB 4Dgw5QmE8XFzSE+F8uI4dySvg6JUcbtsVqOwcb9TfyGXReR0LhQxJ6ymJymrCvsrIm8v ekfw== Received: by 10.50.152.137 with SMTP id uy9mr2306481igb.62.1353642506490; Thu, 22 Nov 2012 19:48:26 -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 n20csp296284igt; Thu, 22 Nov 2012 19:48:26 -0800 (PST) Received: by 10.68.191.10 with SMTP id gu10mr10374900pbc.115.1353642505891; Thu, 22 Nov 2012 19:48:25 -0800 (PST) Received: from mail-pa0-f48.google.com (mail-pa0-f48.google.com [209.85.220.48]) by mx.google.com with ESMTPS id n5si6796631paw.205.2012.11.22.19.48.25 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Nov 2012 19:48:25 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.48 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.220.48; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.48 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-pa0-f48.google.com with SMTP id fa1so1293993pad.21 for ; Thu, 22 Nov 2012 19:48:25 -0800 (PST) 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 Cc: inki.dae@samsung.com, jy0922.shim@samsung.com, airlied@linux.ie, sachin.kamat@linaro.org, patches@linaro.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: ALoCoQlV2kY6/qfP8OdgAMvWVy2DZr29yjfyMdM6DpSfFkb5x6tvoxw8+C3AW4DsDnoLn43ly+2d 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 */