public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "weiyongjun (A)" <weiyongjun1@huawei.com>
To: Zhen Lei <thunder.leizhen@huawei.com>,
	Tony Lindgren <tony@atomide.com>,
	Haojian Zhuang <haojian.zhuang@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Manjunathappa Prakash <prakash.pm@ti.com>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
	linux-omap <linux-omap@vger.kernel.org>,
	linux-gpio <linux-gpio@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] pinctrl: single: Fix error return code in pcs_parse_bits_in_pinctrl_entry()
Date: Thu, 15 Jul 2021 19:49:27 +0800	[thread overview]
Message-ID: <55d02087-e2c7-9a0c-e20e-ff6f106703a3@huawei.com> (raw)
In-Reply-To: <20210715064206.3193-1-thunder.leizhen@huawei.com>

> Fix to return -ENOTSUPP instead of 0 when PCS_HAS_PINCONF is true, which
> is the same as that returned in pcs_parse_pinconf().
>
> In addition, I found the value of pcs->flags is not overwritten in
> pcs_parse_bits_in_pinctrl_entry() and its subfunctions, so moving this
> check to the beginning of the function eliminates unnecessary rollback
> operations.
>
> Fixes: 4e7e8017a80e ("pinctrl: pinctrl-single: enhance to configure multiple pins of different modules")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
>   drivers/pinctrl/pinctrl-single.c | 21 ++++++++-------------
>   1 file changed, 8 insertions(+), 13 deletions(-)
>
>
>   	npins_in_row = pcs->width / pcs->bits_per_pin;
>   
>   	vals = devm_kzalloc(pcs->dev,
> @@ -1212,29 +1217,19 @@ static int pcs_parse_bits_in_pinctrl_entry(struct pcs_device *pcs,
>   		goto free_pins;
>   	}
>   
> -	gsel = pinctrl_generic_add_group(pcs->pctl, np->name, pins, found, pcs);
> -	if (gsel < 0) {
> -		res = gsel;
> +	res = pinctrl_generic_add_group(pcs->pctl, np->name, pins, found, pcs);
> +	if (res < 0)
>   		goto free_function;
> -	}


This change cause 'gsel' not set.

Do not mix this cleanup with bugfix.




  reply	other threads:[~2021-07-15 11:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-15  6:42 [PATCH] pinctrl: single: Fix error return code in pcs_parse_bits_in_pinctrl_entry() Zhen Lei
2021-07-15 11:49 ` weiyongjun (A) [this message]
2021-07-16  1:04   ` Leizhen (ThunderTown)
2021-07-16  1:17   ` Leizhen (ThunderTown)

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=55d02087-e2c7-9a0c-e20e-ff6f106703a3@huawei.com \
    --to=weiyongjun1@huawei.com \
    --cc=haojian.zhuang@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=prakash.pm@ti.com \
    --cc=thunder.leizhen@huawei.com \
    --cc=tony@atomide.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