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: 1465451 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 4E9723FCFC for ; Mon, 17 Sep 2012 06:24:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753060Ab2IQGYI (ORCPT ); Mon, 17 Sep 2012 02:24:08 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:45555 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752453Ab2IQGYH (ORCPT ); Mon, 17 Sep 2012 02:24:07 -0400 Received: by pbbrr13 with SMTP id rr13so8533924pbb.19 for ; Sun, 16 Sep 2012 23:24:07 -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:x-gm-message-state; bh=+YcI6u7DhTv7sjAv8KjHAYkEvhFgAoe4C8rjKmz3Vfs=; b=Jnnfgk842wKdZF0AK+tdaSskdyuKkdJfdOFyewSZ3brqVuZsHgvW1kbeul5x2OzOOe Wtm0Skiup3PlCyWEg8GDkQ5iqQzrem0lsKancsQwxePRBTarbMWOTxx7NCBu+kWmUnrd Be6jIU7auUy32r1CjhgXvpEBDwWnhjPnORJZ0BLpurGBlO+Fv+w912jP9G5XCHpNAxRe F3ypBsPg3ZhL2KsHzZt8bV3aHAt/sfTb+9TPmUAEUtYvvcoO0k6+roLN6ifOP2YU1zPK SeGxhNonZEqzBX0FjJlGdEIBFMjOlQ0GByBAObHOwyh/I+ZQFFFmiym2yBYvlh0cT0j+ 483g== 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: ALoCoQnK4zgvVKeOj/oHeX+BIDu7awN6Kxgd7oZ+5vf5Om1awcF143ybyDfQsmmjxJyHZzn/u+Fr Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org 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;