From patchwork Sat Aug 25 06:57:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 1373111 Return-Path: X-Original-To: patchwork-linux-sh@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 5E6383FD40 for ; Sat, 25 Aug 2012 06:57:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752009Ab2HYG5S (ORCPT ); Sat, 25 Aug 2012 02:57:18 -0400 Received: from kirsty.vergenet.net ([202.4.237.240]:49679 "EHLO kirsty.vergenet.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754484Ab2HYG5P (ORCPT ); Sat, 25 Aug 2012 02:57:15 -0400 Received: from ayumi.akashicho.tokyo.vergenet.net (p6117-ipbfp1901kobeminato.hyogo.ocn.ne.jp [114.172.117.117]) by kirsty.vergenet.net (Postfix) with ESMTP id 8953925BFAA; Sat, 25 Aug 2012 16:57:13 +1000 (EST) Received: by ayumi.akashicho.tokyo.vergenet.net (Postfix, from userid 7100) id 2A6D2EDE090; Sat, 25 Aug 2012 15:57:12 +0900 (JST) Date: Sat, 25 Aug 2012 15:57:12 +0900 From: Simon Horman To: Laurent Pinchart Cc: linux-sh@vger.kernel.org, Magnus Damm , Richard Purdie Subject: Re: [PATCH v2 4/6] pwm_backlight: Add deferred probe support Message-ID: <20120825065709.GG29755@verge.net.au> References: <1343140823-13754-1-git-send-email-laurent.pinchart@ideasonboard.com> <1343140823-13754-5-git-send-email-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1343140823-13754-5-git-send-email-laurent.pinchart@ideasonboard.com> Organisation: Horms Solutions Ltd. User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org On Tue, Jul 24, 2012 at 04:40:21PM +0200, Laurent Pinchart wrote: > If the PWM instance is not available yet at probe time, request a > deferred probe. > > A better way to fix might be to create a PWM subsystem (possibly > integrated into the GPIO subsystem) to support generic PWM objects, and > make sure the subsystem gets initialized first. Hi Richard, I am wondering if you have had a chance to review this change. I believe that it is a pre-requisite for work that Laurent has done to enable the backlight on the Armadillo 800 EVA board. If the change is ok I am happy to take it through my shmobile tree if that makes life easier for you. Below is an updated version of the patch which applies on top of 3.6-rc3. From: Laurent Pinchart pwm_backlight: Add deferred probe support If the PWM instance is not available yet at probe time, request a deferred probe. A better way to fix might be to create a PWM subsystem (possibly integrated into the GPIO subsystem) to support generic PWM objects, and make sure the subsystem gets initialized first. Signed-off-by: Laurent Pinchart Signed-off-by: Simon Horman --- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 995f016..cc71f87 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -221,6 +221,8 @@ static int pwm_backlight_probe(struct platform_device *pdev) if (IS_ERR(pb->pwm)) { dev_err(&pdev->dev, "unable to request legacy PWM\n"); ret = PTR_ERR(pb->pwm); + if (ret == -ENODEV) + ret = -EPROBE_DEFER; goto err_alloc; } }