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: 1436041 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 D20A14025E for ; Tue, 11 Sep 2012 08:45:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751244Ab2IKIpd (ORCPT ); Tue, 11 Sep 2012 04:45:33 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:65240 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750898Ab2IKIpb (ORCPT ); Tue, 11 Sep 2012 04:45:31 -0400 Received: by dady13 with SMTP id y13so174659dad.19 for ; Tue, 11 Sep 2012 01:45:31 -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=vet6oa2+43ZkN1nIVNuHf0mFgqe8BdiYi7YtJ2mEgnE=; b=f46KZEtWqFWyAu4JAGSC02ZP/6S2JRKplQX85us1q8cGGqEbudM9LirGP9H3+H/Zcb tqO0ZK2/gI3e1xGQS9yKJtx9Vdit3yIW2fV0bGRZOUJVj/TaHFb6DX2vO59L9Bvj981r 6Yq4L2NYP4y1erQnEhAzK9LbocpcgKat7RCLIcTTqLXLw+mMkqZ+jbYiOK7LED9irzlf L47f+cTqst8HTMs4sFCklZUtLQz96ryCngi+EfLVDALepNeXvGReekr9S2YUXGFxzhSv S0J7w3TlMloyjyHrI8ecJKqhiceFXr9MDBJ6KoGhCyNJXxqlb2I8wCFIE3SSlIyoSpqS hBRQ== 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: ALoCoQmfbPC+tmoNpitdZPlM3ciuH0uOgtYoGoJTdeb89iW8mAf1Wm7rgnh3recBCHWSJ5UO9Kvr 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. 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;