Re: [PATCH v4 1/4] iio: magnetometer: ak8975: Relax failure on unknown id

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

 



On Mon, 19 Aug 2024 00:29:39 +0200
Barnabás Czémán <barnabas.czeman@xxxxxxxxxxxxxx> wrote:

> Relax failure when driver gets an unknown device id for
> allow probe for register compatible devices.
> 
> Signed-off-by: Barnabás Czémán <barnabas.czeman@xxxxxxxxxxxxxx>
> ---
>  drivers/iio/magnetometer/ak8975.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
> index ccbebe5b66cd..8eef4d5dd9e2 100644
> --- a/drivers/iio/magnetometer/ak8975.c
> +++ b/drivers/iio/magnetometer/ak8975.c
> @@ -484,10 +484,13 @@ static int ak8975_who_i_am(struct i2c_client *client,
>  		if (wia_val[1] == AK09916_DEVICE_ID)
>  			return 0;
>  		break;
> -	default:
> -		dev_err(&client->dev, "Type %d unknown\n", type);
>  	}
> -	return -ENODEV;
> +
> +	dev_info(&client->dev, "Device ID %x is unknown.\n", wia_val[1]);
> +	/* Let driver to probe on unknown id for support more register
Comment style wrong, I'll fix it up.

With that tweak applied to the togreg branch of iio.git

Thanks,

Jonathan


> +	 * compatible variants.
> +	 */
> +	return 0;
>  }
>  
>  /*
> 






[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux