From patchwork Sat Sep 26 19:24:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Jarzmik X-Patchwork-Id: 7269591 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 81E1E9F372 for ; Sat, 26 Sep 2015 19:37:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B2B93207E3 for ; Sat, 26 Sep 2015 19:37:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D558F207DE for ; Sat, 26 Sep 2015 19:37:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753418AbbIZThb (ORCPT ); Sat, 26 Sep 2015 15:37:31 -0400 Received: from smtp09.smtpout.orange.fr ([80.12.242.131]:35059 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753415AbbIZThb (ORCPT ); Sat, 26 Sep 2015 15:37:31 -0400 X-Greylist: delayed 450 seconds by postgrey-1.27 at vger.kernel.org; Sat, 26 Sep 2015 15:37:30 EDT Received: from belgarion.home ([109.222.127.209]) by mwinf5d69 with ME id MvVy1r00C4XCJNd03vVyYZ; Sat, 26 Sep 2015 21:29:59 +0200 X-ME-Helo: belgarion.home X-ME-Date: Sat, 26 Sep 2015 21:29:59 +0200 X-ME-IP: 109.222.127.209 From: Robert Jarzmik To: Thierry Reding , Jingoo Han , Lee Jones , Jean-Christophe Plagniol-Villard , Tomi Valkeinen Cc: linux-pwm@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Jarzmik Subject: [PATCH] Revert "backlight: pwm: Handle EPROBE_DEFER while requesting the PWM" Date: Sat, 26 Sep 2015 21:24:42 +0200 Message-Id: <1443295482-18687-1-git-send-email-robert.jarzmik@free.fr> X-Mailer: git-send-email 2.1.4 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI, 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 This reverts commit 68feaca0b13e453aa14ee064c1736202b48b342f. This commit breaks legacy platforms, for which : (a) no pwm table is added (legacy platforms) (b) in this case, in pwm_get(), pmw_lookup_list is empty, and therefore chosen == NULL, and therefore pwm_get() returns NULL, and pwm_get() returns -EPROBE_DEFER (c) as a consequence, this code is unreachable in pwm_bl.c : if (IS_ERR(pb->pwm)) { ret = PTR_ERR(pb->pwm); dev_info(&pdev->dev, "%s:%d(): %d\n", __func__, __LINE__, ret); if (ret == -EPROBE_DEFER) goto err_alloc; dev_err(&pdev->dev, "unable to request PWM, trying legacy API\n"); pb->legacy = true; pb->pwm = pwm_request(data->pwm_id, "pwm-backlight"); As this code is unreachable, all legacy platforms relying on pwm_id are broken, amongst which pxa have been tested as broken. Signed-off-by: Robert Jarzmik --- drivers/video/backlight/pwm_bl.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index eff379b234cc..57cb9ec8be43 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -272,10 +272,6 @@ static int pwm_backlight_probe(struct platform_device *pdev) pb->pwm = devm_pwm_get(&pdev->dev, NULL); if (IS_ERR(pb->pwm)) { - ret = PTR_ERR(pb->pwm); - if (ret == -EPROBE_DEFER) - goto err_alloc; - dev_err(&pdev->dev, "unable to request PWM, trying legacy API\n"); pb->legacy = true; pb->pwm = pwm_request(data->pwm_id, "pwm-backlight");