Re: [PATCH] media: st-mipid02: add a check for devm_gpiod_get_optional

2019-10-17 Thread Mickael GUENE
Hello Chuhong, Sorry I missed 'if (PTR_ERR(desc) == -ENOENT)' check Can you in this case add an error message ? Regards Mickael On 10/17/19 09:48, Chuhong Yuan wrote: > On Thu, Oct 17, 2019 at 1:43 PM Mickael GUENE wrote: >> >> Hello Chuhong, >> >> Is this check necessary ? >> since lo

Re: [PATCH] media: st-mipid02: add a check for devm_gpiod_get_optional

2019-10-17 Thread Chuhong Yuan
On Thu, Oct 17, 2019 at 1:43 PM Mickael GUENE wrote: > > Hello Chuhong, > > Is this check necessary ? > since looking into code it seems to me devm_gpiod_get_optional() can only > return NULL in case of error due to following check in > devm_gpiod_get_index_optional() > if (IS_ERR(desc))

Re: [PATCH] media: st-mipid02: add a check for devm_gpiod_get_optional

2019-10-16 Thread Mickael GUENE
Hello Chuhong, Is this check necessary ? since looking into code it seems to me devm_gpiod_get_optional() can only return NULL in case of error due to following check in devm_gpiod_get_index_optional() if (IS_ERR(desc)) { if (PTR_ERR(desc) == -ENOENT)

[PATCH] media: st-mipid02: add a check for devm_gpiod_get_optional

2019-10-16 Thread Chuhong Yuan
mipid02_probe misses a check for devm_gpiod_get_optional and may miss the failure. Add a check to fix the problem. Signed-off-by: Chuhong Yuan --- drivers/media/i2c/st-mipid02.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/media/i2c/st-mipid02.c b/drivers/media/i2c/st-mipid02.c