public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Axel Lin <axel.lin@ingics.com>, Kishon Vijay Abraham I <kishon@ti.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFT] phy: sun4i-usb: Use devm_gpiod_get_optional for optional GPIOs
Date: Fri, 21 Aug 2015 14:33:37 +0200	[thread overview]
Message-ID: <55D71AA1.9050607@redhat.com> (raw)
In-Reply-To: <1440146978.29130.1.camel@ingics.com>

Hi,

On 21-08-15 10:49, 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>

Thanks for the patch, looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
>   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,
>

      reply	other threads:[~2015-08-21 12:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-21  8:49 [PATCH RFT] phy: sun4i-usb: Use devm_gpiod_get_optional for optional GPIOs Axel Lin
2015-08-21 12:33 ` Hans de Goede [this message]

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=55D71AA1.9050607@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=axel.lin@ingics.com \
    --cc=kishon@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.ripard@free-electrons.com \
    /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