From patchwork Wed Sep 5 08:25:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomi Valkeinen X-Patchwork-Id: 1406331 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id E9A1FDF264 for ; Wed, 5 Sep 2012 08:27:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758117Ab2IEI0d (ORCPT ); Wed, 5 Sep 2012 04:26:33 -0400 Received: from na3sys009aog121.obsmtp.com ([74.125.149.145]:55770 "EHLO na3sys009aog121.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758035Ab2IEI02 (ORCPT ); Wed, 5 Sep 2012 04:26:28 -0400 Received: from mail-lpp01m010-f46.google.com ([209.85.215.46]) (using TLSv1) by na3sys009aob121.postini.com ([74.125.148.12]) with SMTP ID DSNKUEcMsi64uDNpPwPh41Esz2vwNF3Mjq6U@postini.com; Wed, 05 Sep 2012 01:26:28 PDT Received: by lagy9 with SMTP id y9so139366lag.19 for ; Wed, 05 Sep 2012 01:26:25 -0700 (PDT) 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=Xt4uYVy28nKpKyxldPUcTiKmDiytj2OT02EYXxUm/4A=; b=X0wInIigWKa8CEzUFUmgSzfcESk81PU2H+aTYCrkgqXfGTA64qt2yPJP3kmMm9uV55 fp8cchx17f6FFgYWK2R/UyMuTGVnGMILO+VeQWC18O5hKoL/JF7lXZjFEvsM4gmKNzWx kmtzA5iLVe6YrGRmvJHw2cw4I8EldWHYkdMGGZ4FlsHMPuT9s54ErTp/pIPxxIm3MkK5 aDHVWGhAVsH01Jw8pRdeeQSFEMXaGVOVUTVMeLkDddp+eqykKvQfsY5PcpD4pO1HLGyu EMHv/tzQgGE7hM4BFz1bmNFxj6D6WK0d4ztxhV2kBhezCpFibOn8R7TAj/2M918V75ES 2Lpw== Received: by 10.112.103.68 with SMTP id fu4mr7532187lbb.56.1346833585472; Wed, 05 Sep 2012 01:26:25 -0700 (PDT) Received: from localhost.localdomain (a91-156-160-115.elisa-laajakaista.fi. [91.156.160.115]) by mx.google.com with ESMTPS id bc2sm279735lbb.3.2012.09.05.01.26.24 (version=SSLv3 cipher=OTHER); Wed, 05 Sep 2012 01:26:24 -0700 (PDT) From: Tomi Valkeinen To: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org, archit@ti.com Cc: Tomi Valkeinen Subject: [PATCH 08/17] OMAPDSS: TFP410: use devm_gpio_request_one Date: Wed, 5 Sep 2012 11:25:46 +0300 Message-Id: <1346833555-31258-9-git-send-email-tomi.valkeinen@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1346833555-31258-1-git-send-email-tomi.valkeinen@ti.com> References: <1346833555-31258-1-git-send-email-tomi.valkeinen@ti.com> X-Gm-Message-State: ALoCoQlZ7zEyxKOUNvhfrE1INR+URQ8KNge36fQCNqdxWDU3rjuiTNBe9W+2CXycdid77Ud68pJX Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Use devm_ version instead of the regular gpio_request_one to simplify the error handling. Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/displays/panel-tfp410.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/video/omap2/displays/panel-tfp410.c b/drivers/video/omap2/displays/panel-tfp410.c index 4be9a59..383811c 100644 --- a/drivers/video/omap2/displays/panel-tfp410.c +++ b/drivers/video/omap2/displays/panel-tfp410.c @@ -119,8 +119,8 @@ static int tfp410_probe(struct omap_dss_device *dssdev) } if (gpio_is_valid(ddata->pd_gpio)) { - r = gpio_request_one(ddata->pd_gpio, GPIOF_OUT_INIT_LOW, - "tfp410 pd"); + r = devm_gpio_request_one(&dssdev->dev, ddata->pd_gpio, + GPIOF_OUT_INIT_LOW, "tfp410 pd"); if (r) { dev_err(&dssdev->dev, "Failed to request PD GPIO %d\n", ddata->pd_gpio); @@ -135,8 +135,7 @@ static int tfp410_probe(struct omap_dss_device *dssdev) if (!adapter) { dev_err(&dssdev->dev, "Failed to get I2C adapter, bus %d\n", i2c_bus_num); - r = -EINVAL; - goto err_i2c; + return -EINVAL; } ddata->i2c_adapter = adapter; @@ -145,10 +144,6 @@ static int tfp410_probe(struct omap_dss_device *dssdev) dev_set_drvdata(&dssdev->dev, ddata); return 0; -err_i2c: - if (gpio_is_valid(ddata->pd_gpio)) - gpio_free(ddata->pd_gpio); - return r; } static void __exit tfp410_remove(struct omap_dss_device *dssdev) @@ -160,9 +155,6 @@ static void __exit tfp410_remove(struct omap_dss_device *dssdev) if (ddata->i2c_adapter) i2c_put_adapter(ddata->i2c_adapter); - if (gpio_is_valid(ddata->pd_gpio)) - gpio_free(ddata->pd_gpio); - dev_set_drvdata(&dssdev->dev, NULL); mutex_unlock(&ddata->lock);