From patchwork Mon Sep 23 14:27:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 2928281 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 C00CEBFF05 for ; Mon, 23 Sep 2013 14:33:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1CACE201F8 for ; Mon, 23 Sep 2013 14:33:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D6B052014B for ; Mon, 23 Sep 2013 14:33:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752985Ab3IWO2c (ORCPT ); Mon, 23 Sep 2013 10:28:32 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:35539 "EHLO mail-lb0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752776Ab3IWO16 (ORCPT ); Mon, 23 Sep 2013 10:27:58 -0400 Received: by mail-lb0-f173.google.com with SMTP id o14so2718030lbi.18 for ; Mon, 23 Sep 2013 07:27:53 -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=DiqotP+lJMvhfNRLk9/dDmcYH5xTxLcooQ2EL5WrzIA=; b=Yf4lr655sfNxA4SgpQkBQ98Ky8EJqL3tQJTrCO8/nz1rxUPKHr2v1CZvHD8VXbisRq Bw03p1l3A/5LGvxSq3gu5zb3VAghuVTT7/Sdo7Yj0G8gnAY9FdGfMKaPLun5KIONWQ1V l/+cDh4CvsZM8l0eAg+3NilMvJfRRKQ6rpm6Pfoh2VfE7bGAu8mQwVy0UvTotAoDPQkf +5rfASUql112LxGmhvwhDd9uf3CESMr/fHNPjqhu8SeB1WJiEXTFzSMjEoFdSiwY67Cc tsFCBb9IhOEuxw7J1JYVEXDIUknbwYjix8U/RKfSiy0R5q5TFpOsKECzqiI8XRVWxZxm y/mA== X-Received: by 10.152.170.166 with SMTP id an6mr20388558lac.20.1379946473460; Mon, 23 Sep 2013 07:27:53 -0700 (PDT) Received: from xi.terra (c193-14-141-227.cust.tele2.se. [193.14.141.227]) by mx.google.com with ESMTPSA id ur6sm12233747lbc.5.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 23 Sep 2013 07:27:52 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.80.1) (envelope-from ) id 1VO775-0006gy-Cn; 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 , Eric Miao , Russell King , Haojian Zhuang , Felipe Balbi Subject: [PATCH 5/7] usb: gadget: pxa25x_udc: fix deferred probe from __init Date: Mon, 23 Sep 2013 16:27:30 +0200 Message-Id: <1379946452-25649-6-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=unavailable 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: Eric Miao Cc: Russell King Cc: Haojian Zhuang Cc: Felipe Balbi Signed-off-by: Johan Hovold --- drivers/usb/gadget/pxa25x_udc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/usb/gadget/pxa25x_udc.c b/drivers/usb/gadget/pxa25x_udc.c index cc92074..0ac6064 100644 --- a/drivers/usb/gadget/pxa25x_udc.c +++ b/drivers/usb/gadget/pxa25x_udc.c @@ -2054,7 +2054,7 @@ static struct pxa25x_udc memory = { /* * probe - binds to the platform device */ -static int __init pxa25x_udc_probe(struct platform_device *pdev) +static int pxa25x_udc_probe(struct platform_device *pdev) { struct pxa25x_udc *dev = &memory; int retval, irq; @@ -2203,7 +2203,7 @@ static void pxa25x_udc_shutdown(struct platform_device *_dev) pullup_off(); } -static int __exit pxa25x_udc_remove(struct platform_device *pdev) +static int pxa25x_udc_remove(struct platform_device *pdev) { struct pxa25x_udc *dev = platform_get_drvdata(pdev); @@ -2294,7 +2294,8 @@ static int pxa25x_udc_resume(struct platform_device *dev) static struct platform_driver udc_driver = { .shutdown = pxa25x_udc_shutdown, - .remove = __exit_p(pxa25x_udc_remove), + .probe = pxa25x_udc_probe, + .remove = pxa25x_udc_remove, .suspend = pxa25x_udc_suspend, .resume = pxa25x_udc_resume, .driver = { @@ -2303,7 +2304,7 @@ static struct platform_driver udc_driver = { }, }; -module_platform_driver_probe(udc_driver, pxa25x_udc_probe); +module_platform_driver(udc_driver); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_AUTHOR("Frank Becker, Robert Schwebel, David Brownell");