Re: [PATCH] i2c: Modify error handling

2016-07-31 Thread Sakari Ailus
Hi Amitoj, On Sun, Jul 31, 2016 at 09:28:00AM +0530, Amitoj Kaur Chawla wrote: > devm_gpiod_get returns an ERR_PTR on error so a null check is > incorrect and an IS_ERR check is required. > > The Coccinelle semantic patch used to make this change is as follows: > @@ > expression e; > statement

Re: [PATCH] i2c: Modify error handling

2016-07-31 Thread Sakari Ailus
Hi Amitoj, On Sun, Jul 31, 2016 at 09:28:00AM +0530, Amitoj Kaur Chawla wrote: > devm_gpiod_get returns an ERR_PTR on error so a null check is > incorrect and an IS_ERR check is required. > > The Coccinelle semantic patch used to make this change is as follows: > @@ > expression e; > statement

[PATCH] i2c: Modify error handling

2016-07-30 Thread Amitoj Kaur Chawla
devm_gpiod_get returns an ERR_PTR on error so a null check is incorrect and an IS_ERR check is required. The Coccinelle semantic patch used to make this change is as follows: @@ expression e; statement S; @@ e = devm_gpiod_get(...); if( - !e + IS_ERR(e) ) { ... - return ...; +

[PATCH] i2c: Modify error handling

2016-07-30 Thread Amitoj Kaur Chawla
devm_gpiod_get returns an ERR_PTR on error so a null check is incorrect and an IS_ERR check is required. The Coccinelle semantic patch used to make this change is as follows: @@ expression e; statement S; @@ e = devm_gpiod_get(...); if( - !e + IS_ERR(e) ) { ... - return ...; +