Re: [PATCH 5/8] iio:magnetometer:bmc150_magn: add error handling on gpio probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 17/07/15 09:52, Hartmut Knaack wrote:
> bmc150_magn_gpio_probe() may return some error codes, so better check
> them.
> 
> Signed-off-by: Hartmut Knaack <knaack.h@xxxxxx>
Another kind of obvious improvement.  Obviously comments still welcome
from others.  Applied to the togreg branch of iio.git

Thanks,

Jonathan
> ---
>  drivers/iio/magnetometer/bmc150_magn.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/magnetometer/bmc150_magn.c b/drivers/iio/magnetometer/bmc150_magn.c
> index f1b6a4dc40ea..e1f804b2b244 100644
> --- a/drivers/iio/magnetometer/bmc150_magn.c
> +++ b/drivers/iio/magnetometer/bmc150_magn.c
> @@ -920,8 +920,13 @@ static int bmc150_magn_probe(struct i2c_client *client,
>  	indio_dev->modes = INDIO_DIRECT_MODE;
>  	indio_dev->info = &bmc150_magn_info;
>  
> -	if (client->irq <= 0)
> +	if (client->irq <= 0) {
>  		client->irq = bmc150_magn_gpio_probe(client);
> +		if (client->irq < 0) {
> +			ret = client->irq;
> +			goto err_poweroff;
> +		}
> +	}
>  
>  	if (client->irq > 0) {
>  		data->dready_trig = devm_iio_trigger_alloc(&client->dev,
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux