From: Johan Hovold <jhovold@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-fbdev@vger.kernel.org, linux-usb@vger.kernel.org,
Mark Brown <broonie@linaro.org>, Johan Hovold <jhovold@gmail.com>,
linux-pcmcia@lists.infradead.org, linux-mmc@vger.kernel.org,
linux-kernel@vger.kernel.org, Felipe Balbi <balbi@ti.com>,
linux-mtd@lists.infradead.org,
Grant Likely <grant.likely@linaro.org>
Subject: [PATCH 6/7] usb: phy: gpio-vbus: fix deferred probe from __init
Date: Mon, 23 Sep 2013 14:27:31 +0000 [thread overview]
Message-ID: <1379946452-25649-7-git-send-email-jhovold@gmail.com> (raw)
In-Reply-To: <1379946452-25649-1-git-send-email-jhovold@gmail.com>
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")
and 04bf3011 ("regulator: Support driver probe deferral") this driver
might return -EPROBE_DEFER if a gpio_request or regulator_get fails.
Cc: Felipe Balbi <balbi@ti.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
---
drivers/usb/phy/phy-gpio-vbus-usb.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/usb/phy/phy-gpio-vbus-usb.c b/drivers/usb/phy/phy-gpio-vbus-usb.c
index b2f29c9..02799a5 100644
--- a/drivers/usb/phy/phy-gpio-vbus-usb.c
+++ b/drivers/usb/phy/phy-gpio-vbus-usb.c
@@ -241,7 +241,7 @@ static int gpio_vbus_set_suspend(struct usb_phy *phy, int suspend)
/* platform driver interface */
-static int __init gpio_vbus_probe(struct platform_device *pdev)
+static int gpio_vbus_probe(struct platform_device *pdev)
{
struct gpio_vbus_mach_info *pdata = dev_get_platdata(&pdev->dev);
struct gpio_vbus_data *gpio_vbus;
@@ -349,7 +349,7 @@ err_gpio:
return err;
}
-static int __exit gpio_vbus_remove(struct platform_device *pdev)
+static int gpio_vbus_remove(struct platform_device *pdev)
{
struct gpio_vbus_data *gpio_vbus = platform_get_drvdata(pdev);
struct gpio_vbus_mach_info *pdata = dev_get_platdata(&pdev->dev);
@@ -398,8 +398,6 @@ static const struct dev_pm_ops gpio_vbus_dev_pm_ops = {
};
#endif
-/* NOTE: the gpio-vbus device may *NOT* be hotplugged */
-
MODULE_ALIAS("platform:gpio-vbus");
static struct platform_driver gpio_vbus_driver = {
@@ -410,10 +408,11 @@ static struct platform_driver gpio_vbus_driver = {
.pm = &gpio_vbus_dev_pm_ops,
#endif
},
- .remove = __exit_p(gpio_vbus_remove),
+ .probe = gpio_vbus_probe,
+ .remove = gpio_vbus_remove,
};
-module_platform_driver_probe(gpio_vbus_driver, gpio_vbus_probe);
+module_platform_driver(gpio_vbus_driver);
MODULE_DESCRIPTION("simple GPIO controlled OTG transceiver driver");
MODULE_AUTHOR("Philipp Zabel");
--
1.8.3.2
next prev parent reply other threads:[~2013-09-23 14:27 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20130923134028.GF21013@sirena.org.uk>
2013-09-23 14:27 ` [PATCH 0/7] driver core: prevent deferred probe with platform_driver_probe Johan Hovold
2013-09-23 14:27 ` [PATCH 1/7] " Johan Hovold
2013-09-23 14:27 ` [PATCH 2/7] mmc: mvsdio: fix deferred probe from __init Johan Hovold
[not found] ` <1379946452-25649-1-git-send-email-jhovold-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-09-23 14:27 ` [PATCH 3/7] mtd: atmel_nand: " Johan Hovold
2013-09-23 14:27 ` [PATCH 5/7] usb: gadget: pxa25x_udc: " Johan Hovold
2013-09-23 14:27 ` [PATCH 4/7] pcmcia: at91_cf: " Johan Hovold
2013-09-23 16:53 ` Nicolas Ferre
2013-09-23 14:27 ` Johan Hovold [this message]
2013-09-23 14:27 ` [PATCH 7/7] backlight: atmel-pwm-bl: " Johan Hovold
2013-09-23 14:50 ` [PATCH 0/7] driver core: prevent deferred probe with platform_driver_probe Sascha Hauer
2013-09-23 15:20 ` Johan Hovold
2013-09-23 15:24 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1379946452-25649-7-git-send-email-jhovold@gmail.com \
--to=jhovold@gmail.com \
--cc=balbi@ti.com \
--cc=broonie@linaro.org \
--cc=grant.likely@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=linux-pcmcia@lists.infradead.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).