* [PATCH RESEND] phy: sun4i-usb: Use devm_gpiod_get_optional for optional GPIOs
@ 2015-09-25 0:47 Axel Lin
2015-10-06 14:22 ` Kishon Vijay Abraham I
0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2015-09-25 0:47 UTC (permalink / raw)
To: Kishon Vijay Abraham I
Cc: Hans de Goede, Maxime Ripard, linux-arm-kernel, linux-kernel
Both data->id_det_gpio and data->vbus_det_gpio are optional, so use
devm_gpiod_get_optional for them.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
---
This patch was sent on https://lkml.org/lkml/2015/8/21/177
drivers/phy/phy-sun4i-usb.c | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c
index 731b395..b12964b 100644
--- a/drivers/phy/phy-sun4i-usb.c
+++ b/drivers/phy/phy-sun4i-usb.c
@@ -551,19 +551,15 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
if (IS_ERR(data->base))
return PTR_ERR(data->base);
- data->id_det_gpio = devm_gpiod_get(dev, "usb0_id_det", GPIOD_IN);
- if (IS_ERR(data->id_det_gpio)) {
- if (PTR_ERR(data->id_det_gpio) == -EPROBE_DEFER)
- return -EPROBE_DEFER;
- data->id_det_gpio = NULL;
- }
-
- data->vbus_det_gpio = devm_gpiod_get(dev, "usb0_vbus_det", GPIOD_IN);
- if (IS_ERR(data->vbus_det_gpio)) {
- if (PTR_ERR(data->vbus_det_gpio) == -EPROBE_DEFER)
- return -EPROBE_DEFER;
- data->vbus_det_gpio = NULL;
- }
+ data->id_det_gpio = devm_gpiod_get_optional(dev, "usb0_id_det",
+ GPIOD_IN);
+ if (IS_ERR(data->id_det_gpio))
+ return PTR_ERR(data->id_det_gpio);
+
+ data->vbus_det_gpio = devm_gpiod_get_optional(dev, "usb0_vbus_det",
+ GPIOD_IN);
+ if (IS_ERR(data->vbus_det_gpio))
+ return PTR_ERR(data->vbus_det_gpio);
if (of_find_property(np, "usb0_vbus_power-supply", NULL)) {
data->vbus_power_supply = devm_power_supply_get_by_phandle(dev,
--
2.1.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH RESEND] phy: sun4i-usb: Use devm_gpiod_get_optional for optional GPIOs
2015-09-25 0:47 [PATCH RESEND] phy: sun4i-usb: Use devm_gpiod_get_optional for optional GPIOs Axel Lin
@ 2015-10-06 14:22 ` Kishon Vijay Abraham I
0 siblings, 0 replies; 2+ messages in thread
From: Kishon Vijay Abraham I @ 2015-10-06 14:22 UTC (permalink / raw)
To: Axel Lin; +Cc: Hans de Goede, Maxime Ripard, linux-arm-kernel, linux-kernel
Hi,
On Friday 25 September 2015 06:17 AM, Axel Lin wrote:
> Both data->id_det_gpio and data->vbus_det_gpio are optional, so use
> devm_gpiod_get_optional for them.
>
> Signed-off-by: Axel Lin <axel.lin@ingics.com>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
merged this to linux-phy tree.
Thanks
Kishon
> ---
> This patch was sent on https://lkml.org/lkml/2015/8/21/177
>
> drivers/phy/phy-sun4i-usb.c | 22 +++++++++-------------
> 1 file changed, 9 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c
> index 731b395..b12964b 100644
> --- a/drivers/phy/phy-sun4i-usb.c
> +++ b/drivers/phy/phy-sun4i-usb.c
> @@ -551,19 +551,15 @@ static int sun4i_usb_phy_probe(struct platform_device *pdev)
> if (IS_ERR(data->base))
> return PTR_ERR(data->base);
>
> - data->id_det_gpio = devm_gpiod_get(dev, "usb0_id_det", GPIOD_IN);
> - if (IS_ERR(data->id_det_gpio)) {
> - if (PTR_ERR(data->id_det_gpio) == -EPROBE_DEFER)
> - return -EPROBE_DEFER;
> - data->id_det_gpio = NULL;
> - }
> -
> - data->vbus_det_gpio = devm_gpiod_get(dev, "usb0_vbus_det", GPIOD_IN);
> - if (IS_ERR(data->vbus_det_gpio)) {
> - if (PTR_ERR(data->vbus_det_gpio) == -EPROBE_DEFER)
> - return -EPROBE_DEFER;
> - data->vbus_det_gpio = NULL;
> - }
> + data->id_det_gpio = devm_gpiod_get_optional(dev, "usb0_id_det",
> + GPIOD_IN);
> + if (IS_ERR(data->id_det_gpio))
> + return PTR_ERR(data->id_det_gpio);
> +
> + data->vbus_det_gpio = devm_gpiod_get_optional(dev, "usb0_vbus_det",
> + GPIOD_IN);
> + if (IS_ERR(data->vbus_det_gpio))
> + return PTR_ERR(data->vbus_det_gpio);
>
> if (of_find_property(np, "usb0_vbus_power-supply", NULL)) {
> data->vbus_power_supply = devm_power_supply_get_by_phandle(dev,
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-10-06 14:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-25 0:47 [PATCH RESEND] phy: sun4i-usb: Use devm_gpiod_get_optional for optional GPIOs Axel Lin
2015-10-06 14:22 ` Kishon Vijay Abraham I
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).