All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishad Kamdar <nishadkamdar@gmail.com>
To: Johan Hovold <johan@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Alex Elder <elder@kernel.org>,
	Rui Miguel Silva <rmfrfs@gmail.com>,
	greybus-dev@lists.linaro.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org,
	Nishad Kamdar <nishadkamdar@gmail.com>
Subject: Re: [PATCH v5 3/3] staging: greybus: arche-platform: Switch to the gpio descriptor interface
Date: Sun, 13 Jan 2019 18:22:11 +0530	[thread overview]
Message-ID: <20190113125208.GA16542@nishad> (raw)
In-Reply-To: <20190111084821.GD3383@localhost>

On Fri, Jan 11, 2019 at 09:48:21AM +0100, Johan Hovold wrote:
> On Thu, Jan 10, 2019 at 11:23:07PM +0530, Nishad Kamdar wrote:
> > Use the gpiod interface instead of the deprecated old non-descriptor
> > interface while continuing to ignore gpio flags from device tree in
> > "svc_reset_onoff()" for now.
> > 
> > Signed-off-by: Nishad Kamdar <nishadkamdar@gmail.com>
> > ---
> > Changes in v5:
> >   - Change the commit message.
> >   - Restore the names of the gpio device-tree properties without
> >     the "-gpio" suffix.
> > Changes in v4:
> >  - Move 'gpio_desc *svc_sysboot' below the reset flag
> >    as it is more logical to have reset flag below
> >    reset gpio.
> >  - Remove a few unnecessary line breaks.
> > Changes in v3:
> >  - Add this patch to a patchset.
> > Changes in v2:
> >  - Move comment to the same line as to what it applies to.
> > ---
> 
> Also looks good. Some really minor comments to a couple of the error
> messages. The issues are there in the current code, but since you modify
> these messages anyway you might as well fix them up. Please fix that and
> resend with my
> 
> Reviewed-by: Johan Hovold <johan@kernel.org>
> 
Ok, I'll do that.

> Really good job with this!
> 
Thank you.
> > @@ -435,6 +428,7 @@ static int arche_platform_probe(struct platform_device *pdev)
> >  	struct device *dev = &pdev->dev;
> >  	struct device_node *np = dev->of_node;
> >  	int ret;
> > +	unsigned int flags;
> >  
> >  	arche_pdata = devm_kzalloc(&pdev->dev, sizeof(*arche_pdata),
> >  				   GFP_KERNEL);
> > @@ -444,61 +438,33 @@ static int arche_platform_probe(struct platform_device *pdev)
> >  	/* setup svc reset gpio */
> >  	arche_pdata->is_reset_act_hi = of_property_read_bool(np,
> >  							     "svc,reset-active-high");
> > -	arche_pdata->svc_reset_gpio = of_get_named_gpio(np,
> > -							"svc,reset-gpio",
> > -							0);
> > -	if (!gpio_is_valid(arche_pdata->svc_reset_gpio)) {
> > -		dev_err(dev, "failed to get reset-gpio\n");
> > -		return arche_pdata->svc_reset_gpio;
> > -	}
> > -	ret = devm_gpio_request(dev, arche_pdata->svc_reset_gpio, "svc-reset");
> > -	if (ret) {
> > -		dev_err(dev, "failed to request svc-reset gpio:%d\n", ret);
> > -		return ret;
> > -	}
> > -	ret = gpio_direction_output(arche_pdata->svc_reset_gpio,
> > -				    arche_pdata->is_reset_act_hi);
> > -	if (ret) {
> > -		dev_err(dev, "failed to set svc-reset gpio dir:%d\n", ret);
> > +	if (arche_pdata->is_reset_act_hi)
> > +		flags = GPIOD_OUT_HIGH;
> > +	else
> > +		flags = GPIOD_OUT_LOW;
> > +
> > +	arche_pdata->svc_reset = devm_gpiod_get(dev, "svc,reset", flags);
> > +	if (IS_ERR(arche_pdata->svc_reset)) {
> > +		ret = PTR_ERR(arche_pdata->svc_reset);
> > +		dev_err(dev, "failed to request svc-reset GPIO:%d\n", ret);
> 
> Add a space after ':' for consistency.
> 
Ok. I'll do that.
> > @@ -515,19 +481,11 @@ static int arche_platform_probe(struct platform_device *pdev)
> >  	arche_pdata->num_apbs = of_get_child_count(np);
> >  	dev_dbg(dev, "Number of APB's available - %d\n", arche_pdata->num_apbs);
> >  
> > -	arche_pdata->wake_detect_gpio = of_get_named_gpio(np,
> > -							  "svc,wake-detect-gpio",
> > -							  0);
> > -	if (arche_pdata->wake_detect_gpio < 0) {
> > -		dev_err(dev, "failed to get wake detect gpio\n");
> > -		return arche_pdata->wake_detect_gpio;
> > -	}
> > -
> > -	ret = devm_gpio_request(dev, arche_pdata->wake_detect_gpio,
> > -				"wake detect");
> > -	if (ret) {
> > -		dev_err(dev, "Failed requesting wake_detect gpio %d\n",
> > -			arche_pdata->wake_detect_gpio);
> > +	arche_pdata->wake_detect = devm_gpiod_get(dev, "svc,wake-detect",
> > +						  GPIOD_IN);
> > +	if (IS_ERR(arche_pdata->wake_detect)) {
> > +		ret = PTR_ERR(arche_pdata->wake_detect);
> > +		dev_err(dev, "Failed requesting wake_detect GPIO %d\n", ret);
> 
> Add colon after "GPIO" for consistency (and to avoid ambiguity).
> 

Ok, I'll do that.

Thanks for the review,
Nishad
> >  		return ret;
> >  	}
> 
> Thanks,
> Johan

      reply	other threads:[~2019-01-13 12:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-10 17:49 [PATCH v5 0/3] greybus: gpio: Switch to the gpio descriptor interface Nishad Kamdar
2019-01-10 17:50 ` [PATCH v5 1/3] staging: greybus: gpio: switch GPIO portions to use GPIOLIB_IRQCHIP Nishad Kamdar
2019-01-10 17:54   ` Nishad Kamdar
2019-01-11  8:36   ` Johan Hovold
2019-01-10 17:51 ` [PATCH v5 2/3] staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor interface Nishad Kamdar
2019-01-11  8:41   ` Johan Hovold
2019-01-13 12:54     ` Nishad Kamdar
2019-01-10 17:53 ` [PATCH v5 3/3] staging: greybus: arche-platform: " Nishad Kamdar
2019-01-11  8:48   ` Johan Hovold
2019-01-13 12:52     ` Nishad Kamdar [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=20190113125208.GA16542@nishad \
    --to=nishadkamdar@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=elder@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmfrfs@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.