Re: [PATCH 1/5] iio: pressure: bmp280: Add enumeration to handle chip variants

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

 



On Sun, Dec 25, 2022 at 05:56:07PM +0100, Angel Iglesias wrote:
> Adds enumeration to improve handling the different supported sensors
> on driver initialization. This avoid collisions if different variants
> share the same device idetifier on ID register.

...

>  static const struct of_device_id bmp280_of_i2c_match[] = {
> -	{ .compatible = "bosch,bmp085", .data = (void *)BMP180_CHIP_ID },
> -	{ .compatible = "bosch,bmp180", .data = (void *)BMP180_CHIP_ID },
> -	{ .compatible = "bosch,bmp280", .data = (void *)BMP280_CHIP_ID },
> -	{ .compatible = "bosch,bme280", .data = (void *)BME280_CHIP_ID },
> -	{ .compatible = "bosch,bmp380", .data = (void *)BMP380_CHIP_ID },
> +	{ .compatible = "bosch,bmp085", .data = (void *)BMP180 },
> +	{ .compatible = "bosch,bmp180", .data = (void *)BMP180 },
> +	{ .compatible = "bosch,bmp280", .data = (void *)BMP280 },
> +	{ .compatible = "bosch,bme280", .data = (void *)BME280 },
> +	{ .compatible = "bosch,bmp380", .data = (void *)BMP380 },

Seems an unneeded churn. If we want to have chip info, then provide a pointer
here. And in case it's done later, squash into this patch.

-- 
With Best Regards,
Andy Shevchenko





[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