From patchwork Mon Sep 17 06:20:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 11457 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 BCF5C23E53 for ; Mon, 17 Sep 2012 06:24:09 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 12608A1809F for ; Mon, 17 Sep 2012 06:24:08 +0000 (UTC) Received: by iafj25 with SMTP id j25so4898672iaf.11 for ; Sun, 16 Sep 2012 23:24:08 -0700 (PDT) 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=+YcI6u7DhTv7sjAv8KjHAYkEvhFgAoe4C8rjKmz3Vfs=; b=g/FcahWPAD3svKh6n8vI3Z3e0ypWSiprEJp9XnJ0B+vG9Q/Um1NUA3fnQ7hUEDH693 oYeuIUYbR2GjHqI6P7uvdfxcwrcPl7BNRvs7bN/N90sDMpHemPyiF6eBLGiF4fe4BKcn JU+opH1F2GaSFTiVQ4fTPd0Ble6XJqVBsybFzzi3qV3v0Y9Q4pMVrxn50SAFEARwQT4b RRF7fizFj8D3ISfbPH0qHpldHeMdvunfd1aI3rWj8VgC6KmW9naNu+syYLrbaPye5uGO B2AcK2zdvd27gSn9wRORPV1Lv79QNYWrKOOo7UL4wmSZRV6UlVN4MLtVJEqcvea9nD7O pyPg== Received: by 10.42.109.194 with SMTP id m2mr7865324icp.48.1347863048386; Sun, 16 Sep 2012 23:24:08 -0700 (PDT) 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.184.232 with SMTP id ex8csp297728igc; Sun, 16 Sep 2012 23:24:07 -0700 (PDT) Received: by 10.66.81.66 with SMTP id y2mr18309419pax.62.1347863047624; Sun, 16 Sep 2012 23:24:07 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id pn6si14261278pbb.100.2012.09.16.23.24.07 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 16 Sep 2012 23:24:07 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) smtp.mail=sachin.kamat@linaro.org Received: by pbcmd12 with SMTP id md12so9792849pbc.37 for ; Sun, 16 Sep 2012 23:24:07 -0700 (PDT) Received: by 10.68.232.131 with SMTP id to3mr21043505pbc.58.1347863046974; Sun, 16 Sep 2012 23:24:06 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id gt2sm6426520pbc.62.2012.09.16.23.24.02 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 16 Sep 2012 23:24:06 -0700 (PDT) From: Sachin Kamat To: linux-fbdev@vger.kernel.org Cc: rpurdie@rpsys.net, FlorianSchandinat@gmx.de, akpm@linux-foundation.org, sachin.kamat@linaro.org, patches@linaro.org, Thierry Reding Subject: [PATCH Re-send] pwm-backlight: Use devm_pwm_get in pwm_bl.c Date: Mon, 17 Sep 2012 11:50:47 +0530 Message-Id: <1347862847-2774-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQmg/EtHkQqLiz8WrCCyVlc79UM9LQKUsUdmTjS/8248qK7JAhxpPCkon5UHEAuor3MeWO17 This file already makes use of device managed functions. Convert pwm_get() too to use it. Cc: Thierry Reding Signed-off-by: Sachin Kamat Acked-by: Jingoo Han --- drivers/video/backlight/pwm_bl.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 4965408..0c91023 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -218,7 +218,7 @@ static int pwm_backlight_probe(struct platform_device *pdev) pb->exit = data->exit; pb->dev = &pdev->dev; - pb->pwm = pwm_get(&pdev->dev, NULL); + pb->pwm = devm_pwm_get(&pdev->dev, NULL); if (IS_ERR(pb->pwm)) { dev_err(&pdev->dev, "unable to request PWM, trying legacy API\n"); @@ -251,7 +251,7 @@ static int pwm_backlight_probe(struct platform_device *pdev) if (IS_ERR(bl)) { dev_err(&pdev->dev, "failed to register backlight\n"); ret = PTR_ERR(bl); - goto err_bl; + goto err_alloc; } bl->props.brightness = data->dft_brightness; @@ -260,8 +260,6 @@ static int pwm_backlight_probe(struct platform_device *pdev) platform_set_drvdata(pdev, bl); return 0; -err_bl: - pwm_put(pb->pwm); err_alloc: if (data->exit) data->exit(&pdev->dev); @@ -276,7 +274,6 @@ static int pwm_backlight_remove(struct platform_device *pdev) backlight_device_unregister(bl); pwm_config(pb->pwm, 0, pb->period); pwm_disable(pb->pwm); - pwm_put(pb->pwm); if (pb->exit) pb->exit(&pdev->dev); return 0;