All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Chuhong Yuan <hslester96@gmail.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Kukjin Kim <kgene@kernel.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	linux-media@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] media: exynos4-is: Add missed check for pinctrl_lookup_state()
Date: Mon, 10 Aug 2020 11:31:30 +0200	[thread overview]
Message-ID: <7ffcd1f8-91ba-ab9b-8a5e-98c206669666@samsung.com> (raw)
In-Reply-To: <20200528064147.547158-1-hslester96@gmail.com>

Hi,

On 28.05.2020 08:41, Chuhong Yuan wrote:
> fimc_md_get_pinctrl() misses a check for pinctrl_lookup_state().
> Add the missed check to fix it.
> 
> Fixes: 4163851f7b99 ("[media] s5p-fimc: Use pinctrl API for camera ports configuration]") 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
> Changes in v2:
>   - Add fixes tag.
> 
>  drivers/media/platform/exynos4-is/media-dev.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c
> index 9aaf3b8060d5..9c31d950cddf 100644
> --- a/drivers/media/platform/exynos4-is/media-dev.c
> +++ b/drivers/media/platform/exynos4-is/media-dev.c
> @@ -1270,6 +1270,9 @@ static int fimc_md_get_pinctrl(struct fimc_md *fmd)
>  
>  	pctl->state_idle = pinctrl_lookup_state(pctl->pinctrl,
>  					PINCTRL_STATE_IDLE);
> +	if (IS_ERR(pctl->state_idle))
> +		return PTR_ERR(pctl->state_idle);

Unfortunately this is not correct, with that change the driver currently 
fails to initialize. The "idle" pinctrl state is optional and might not 
be specified in DT, as explained in the DT binding documentation added
by the patch you mentioned in the "Fixes" tag.
Actually the "idle" state is now not used in any mainline dts, I will 
post a patch that removes related code in the driver.

-- 
Thanks,
Sylwester

WARNING: multiple messages have this Message-ID (diff)
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: Chuhong Yuan <hslester96@gmail.com>
Cc: linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Kukjin Kim <kgene@kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-media@vger.kernel.org
Subject: Re: [PATCH v2] media: exynos4-is: Add missed check for pinctrl_lookup_state()
Date: Mon, 10 Aug 2020 11:31:30 +0200	[thread overview]
Message-ID: <7ffcd1f8-91ba-ab9b-8a5e-98c206669666@samsung.com> (raw)
In-Reply-To: <20200528064147.547158-1-hslester96@gmail.com>

Hi,

On 28.05.2020 08:41, Chuhong Yuan wrote:
> fimc_md_get_pinctrl() misses a check for pinctrl_lookup_state().
> Add the missed check to fix it.
> 
> Fixes: 4163851f7b99 ("[media] s5p-fimc: Use pinctrl API for camera ports configuration]") 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
> Changes in v2:
>   - Add fixes tag.
> 
>  drivers/media/platform/exynos4-is/media-dev.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/media/platform/exynos4-is/media-dev.c b/drivers/media/platform/exynos4-is/media-dev.c
> index 9aaf3b8060d5..9c31d950cddf 100644
> --- a/drivers/media/platform/exynos4-is/media-dev.c
> +++ b/drivers/media/platform/exynos4-is/media-dev.c
> @@ -1270,6 +1270,9 @@ static int fimc_md_get_pinctrl(struct fimc_md *fmd)
>  
>  	pctl->state_idle = pinctrl_lookup_state(pctl->pinctrl,
>  					PINCTRL_STATE_IDLE);
> +	if (IS_ERR(pctl->state_idle))
> +		return PTR_ERR(pctl->state_idle);

Unfortunately this is not correct, with that change the driver currently 
fails to initialize. The "idle" pinctrl state is optional and might not 
be specified in DT, as explained in the DT binding documentation added
by the patch you mentioned in the "Fixes" tag.
Actually the "idle" state is now not used in any mainline dts, I will 
post a patch that removes related code in the driver.

-- 
Thanks,
Sylwester

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-08-10  9:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20200528064613eucas1p268b1692ad11d7d2be863280be7d378c1@eucas1p2.samsung.com>
2020-05-28  6:41 ` [PATCH v2] media: exynos4-is: Add missed check for pinctrl_lookup_state() Chuhong Yuan
2020-05-28  6:41   ` Chuhong Yuan
2020-08-10  9:31   ` Sylwester Nawrocki [this message]
2020-08-10  9:31     ` Sylwester Nawrocki

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=7ffcd1f8-91ba-ab9b-8a5e-98c206669666@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=hslester96@gmail.com \
    --cc=kgene@kernel.org \
    --cc=krzk@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mchehab@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 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.