Unnamed repository; edit this file 'description' to name the repository.
 help / color / mirror / Atom feed
* [PATCH v2] media: exynos4-is: Add missed check for pinctrl_lookup_state()
@ 2020-05-28  6:41 ` Chuhong Yuan
  2020-08-10  9:31   ` Sylwester Nawrocki
  0 siblings, 1 reply; 2+ messages in thread
From: Chuhong Yuan @ 2020-05-28  6:41 UTC (permalink / raw)
  Cc: Kyungmin Park, Sylwester Nawrocki, Mauro Carvalho Chehab,
	Kukjin Kim, Krzysztof Kozlowski, linux-media, linux-arm-kernel,
	linux-samsung-soc, linux-kernel, Chuhong Yuan

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);
+
 	return 0;
 }
 
-- 
2.26.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] media: exynos4-is: Add missed check for pinctrl_lookup_state()
  2020-05-28  6:41 ` [PATCH v2] media: exynos4-is: Add missed check for pinctrl_lookup_state() Chuhong Yuan
@ 2020-08-10  9:31   ` Sylwester Nawrocki
  0 siblings, 0 replies; 2+ messages in thread
From: Sylwester Nawrocki @ 2020-08-10  9:31 UTC (permalink / raw)
  To: Chuhong Yuan
  Cc: Kyungmin Park, Mauro Carvalho Chehab, Kukjin Kim,
	Krzysztof Kozlowski, linux-media, linux-arm-kernel,
	linux-samsung-soc, linux-kernel

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-10  9:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [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-08-10  9:31   ` Sylwester Nawrocki

Unnamed repository; edit this file 'description' to name the repository.

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://archive.lwn.net:8080/linux-media/0 linux-media/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-media linux-media/ http://archive.lwn.net:8080/linux-media \
		linux-media@vger.kernel.org lwn-linux-media@archive.lwn.net
	public-inbox-index linux-media

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://archive.lwn.net/lwn.kernel.linux-media


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git