From patchwork Tue Sep 11 08:42:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sachin Kamat X-Patchwork-Id: 11290 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 5E2C723E00 for ; Tue, 11 Sep 2012 08:45:33 +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 0BB1FA18A22 for ; Tue, 11 Sep 2012 08:45:32 +0000 (UTC) Received: by iafj25 with SMTP id j25so207753iaf.11 for ; Tue, 11 Sep 2012 01:45:32 -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=vet6oa2+43ZkN1nIVNuHf0mFgqe8BdiYi7YtJ2mEgnE=; b=W5tF16TsoXPnlBf60PaAXdd7QBm0DMofYZXOPh7xc8SSv9UzL11tOmzbyT/ZZIR57K r8xNdhUECHTvyLHsEn0dz4dV3DoTXDfsq4UguccWOjN/PvQsqkoI2b/Mq/SMG9WZ4+gZ F+jw9vFM1cQK4W6FxIV0bkcbq5UgmkftSb3G+XGycl9kdPkW+iUEHc4sQx1QbOAzHu+d cf5Ks2v6GLx6Pj6F3VDwvzMLOALghA1mwavxuaMwR5x0oNaAe9qLHAPVs9gkjrH9L42x ykNiawKIwsn1rgqOUd4R9gKCJHkfVVHU2QgZvwN7iZs4ykx4OKg9e/uXq56fFl2/CzEu uk1A== Received: by 10.50.180.129 with SMTP id do1mr15668624igc.28.1347353132292; Tue, 11 Sep 2012 01:45:32 -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 ex8csp3182igc; Tue, 11 Sep 2012 01:45:31 -0700 (PDT) Received: by 10.68.138.131 with SMTP id qq3mr10274255pbb.47.1347353131625; Tue, 11 Sep 2012 01:45:31 -0700 (PDT) Received: from mail-pz0-f50.google.com (mail-pz0-f50.google.com [209.85.210.50]) by mx.google.com with ESMTPS id sb7si24072395pbc.1.2012.09.11.01.45.31 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 11 Sep 2012 01:45:31 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of sachin.kamat@linaro.org) client-ip=209.85.210.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.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 dade7 with SMTP id e7so218970dad.37 for ; Tue, 11 Sep 2012 01:45:31 -0700 (PDT) Received: by 10.68.225.104 with SMTP id rj8mr10313159pbc.97.1347353131133; Tue, 11 Sep 2012 01:45:31 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id hr1sm9437350pbc.23.2012.09.11.01.45.27 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 11 Sep 2012 01:45:29 -0700 (PDT) From: Sachin Kamat To: linux-fbdev@vger.kernel.org Cc: rpurdie@rpsys.net, akpm@linux-foundation.org, sachin.kamat@linaro.org, patches@linaro.org Subject: [PATCH] pwm-backlight: Use devm_pwm_get in pwm_bl.c Date: Tue, 11 Sep 2012 14:12:29 +0530 Message-Id: <1347352949-17515-1-git-send-email-sachin.kamat@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQluVbp8bLgrt0QfIGxwSODjVi++bx6+ZrNfhzMPcc69qzEDvQ1kLA7UXr+NpJoNrngBTRfC This file already makes use of device managed functions. Convert pwm_get() too to use it. 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;