From patchwork Sat Oct 11 13:46:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 5069011 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D6F00C11AC for ; Sat, 11 Oct 2014 13:46:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0F0B6201C0 for ; Sat, 11 Oct 2014 13:46:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7E09520204 for ; Sat, 11 Oct 2014 13:46:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752049AbaJKNqp (ORCPT ); Sat, 11 Oct 2014 09:46:45 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:61165 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752152AbaJKNqj (ORCPT ); Sat, 11 Oct 2014 09:46:39 -0400 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1Xcx0I-0005tH-BO from Vladimir_Zapolskiy@mentor.com ; Sat, 11 Oct 2014 06:46:38 -0700 Received: from eyas.fin.mentorg.com (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server (TLS) id 14.3.181.6; Sat, 11 Oct 2014 14:46:37 +0100 From: Vladimir Zapolskiy To: , CC: Thierry Reding , Jingoo Han , Bryan Wu , Lee Jones , Subject: [PATCH 1/2] backlight: pwm: don't call legacy pwm request for device defined in dt Date: Sat, 11 Oct 2014 16:46:25 +0300 Message-ID: <1413035186-11771-2-git-send-email-vladimir_zapolskiy@mentor.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1413035186-11771-1-git-send-email-vladimir_zapolskiy@mentor.com> References: <1413035186-11771-1-git-send-email-vladimir_zapolskiy@mentor.com> MIME-Version: 1.0 X-Originating-IP: [137.202.0.76] Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Platform PWM backlight data provided by board's device tree should be complete enough to successfully request a pwm device using pwm_get() API. Based on initial implementation done by Dmitry Eremin-Solenikov. Reported-by: Dmitry Eremin-Solenikov Signed-off-by: Vladimir Zapolskiy Cc: Thierry Reding Cc: Jingoo Han Cc: Bryan Wu Cc: Lee Jones Acked-by: Thierry Reding --- drivers/video/backlight/pwm_bl.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index cb5ae4c..dd7aaf7 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -272,15 +272,15 @@ static int pwm_backlight_probe(struct platform_device *pdev) } pb->pwm = devm_pwm_get(&pdev->dev, NULL); - if (IS_ERR(pb->pwm)) { + if (IS_ERR(pb->pwm) && !pdev->dev.of_node) { dev_err(&pdev->dev, "unable to request PWM, trying legacy API\n"); - pb->pwm = pwm_request(data->pwm_id, "pwm-backlight"); - if (IS_ERR(pb->pwm)) { - dev_err(&pdev->dev, "unable to request legacy PWM\n"); - ret = PTR_ERR(pb->pwm); - goto err_alloc; - } + } + + if (IS_ERR(pb->pwm)) { + dev_err(&pdev->dev, "unable to request PWM\n"); + ret = PTR_ERR(pb->pwm); + goto err_alloc; } dev_dbg(&pdev->dev, "got pwm for backlight\n");