From patchwork Mon Sep 23 14:27:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 2928111 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 289959F289 for ; Mon, 23 Sep 2013 14:27:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 01D1F20397 for ; Mon, 23 Sep 2013 14:27:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 799FB2010B for ; Mon, 23 Sep 2013 14:27:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752685Ab3IWO1x (ORCPT ); Mon, 23 Sep 2013 10:27:53 -0400 Received: from mail-la0-f49.google.com ([209.85.215.49]:42493 "EHLO mail-la0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752338Ab3IWO1w (ORCPT ); Mon, 23 Sep 2013 10:27:52 -0400 Received: by mail-la0-f49.google.com with SMTP id ev20so2530847lab.36 for ; Mon, 23 Sep 2013 07:27:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=03Ls27JMCh8j4IgN3JhBt7QZqpqCH5Af7+T9HDdPnNs=; b=cmBrm4GxTJKiPwKa+97mzOijpjanfCKC+PgTUg1fhgORDd11uDL//bzvERfSRk33/X Y1LGbvTo3xHaeTJd+m+GvMkpMnfpDaxFf9505Z56ICLjzXctSODMQuD0gdQh8hKFinJu CpZ4DSUH22UfW3X6Em71VHLxvOmoar/aVN/vdRT0E3UD6ZIpIp4eEhF0cjNm1qBuTT+m PAC1CpL/Kgs0kM19W7xL4TnOc3HBNrN0r8pT74Fqv1j3hfDc4hY5HjJdOy678HpB1xSe aId9Ebbt47dDz6P7iQeyBdgRadanEbXVzOm58bYEZxmsb7pCfLODDI+KETQ1YfvE9yDp 4ZPQ== X-Received: by 10.112.158.225 with SMTP id wx1mr1571447lbb.37.1379946470533; Mon, 23 Sep 2013 07:27:50 -0700 (PDT) Received: from xi.terra (c193-14-141-227.cust.tele2.se. [193.14.141.227]) by mx.google.com with ESMTPSA id l10sm12230234lbh.13.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 23 Sep 2013 07:27:50 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.80.1) (envelope-from ) id 1VO775-0006hA-Ea; Mon, 23 Sep 2013 16:27:47 +0200 From: Johan Hovold To: Greg Kroah-Hartman Cc: Grant Likely , Mark Brown , linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-mtd@lists.infradead.org, linux-pcmcia@lists.infradead.org, linux-usb@vger.kernel.org, linux-fbdev@vger.kernel.org, Johan Hovold , Richard Purdie , Jingoo Han , Jean-Christophe Plagniol-Villard Subject: [PATCH 7/7] backlight: atmel-pwm-bl: fix deferred probe from __init Date: Mon, 23 Sep 2013 16:27:32 +0200 Message-Id: <1379946452-25649-8-git-send-email-jhovold@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1379946452-25649-1-git-send-email-jhovold@gmail.com> References: <20130923134028.GF21013@sirena.org.uk> <1379946452-25649-1-git-send-email-jhovold@gmail.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, KHOP_BIG_TO_CC, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID,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 Move probe out of __init section and don't use platform_driver_probe which cannot be used with deferred probing. Since commit e9354576 ("gpiolib: Defer failed gpio requests by default") this driver might return -EPROBE_DEFER if a gpio_request fails. Cc: Richard Purdie Cc: Jingoo Han Cc: Jean-Christophe Plagniol-Villard Signed-off-by: Johan Hovold --- drivers/video/backlight/atmel-pwm-bl.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/video/backlight/atmel-pwm-bl.c b/drivers/video/backlight/atmel-pwm-bl.c index 0393d82..f7447f7 100644 --- a/drivers/video/backlight/atmel-pwm-bl.c +++ b/drivers/video/backlight/atmel-pwm-bl.c @@ -118,7 +118,7 @@ static const struct backlight_ops atmel_pwm_bl_ops = { .update_status = atmel_pwm_bl_set_intensity, }; -static int __init atmel_pwm_bl_probe(struct platform_device *pdev) +static int atmel_pwm_bl_probe(struct platform_device *pdev) { struct backlight_properties props; const struct atmel_pwm_bl_platform_data *pdata; @@ -202,7 +202,7 @@ err_free_mem: return retval; } -static int __exit atmel_pwm_bl_remove(struct platform_device *pdev) +static int atmel_pwm_bl_remove(struct platform_device *pdev) { struct atmel_pwm_bl *pwmbl = platform_get_drvdata(pdev); @@ -220,10 +220,11 @@ static struct platform_driver atmel_pwm_bl_driver = { .name = "atmel-pwm-bl", }, /* REVISIT add suspend() and resume() */ - .remove = __exit_p(atmel_pwm_bl_remove), + .probe = atmel_pwm_bl_probe, + .remove = atmel_pwm_bl_remove, }; -module_platform_driver_probe(atmel_pwm_bl_driver, atmel_pwm_bl_probe); +module_platform_driver(atmel_pwm_bl_driver); MODULE_AUTHOR("Hans-Christian egtvedt "); MODULE_DESCRIPTION("Atmel PWM backlight driver");