Skip to contentSkip to conversation

FAILED: patch "[PATCH] iio: pressure: ms5611: fixed value compensation bug" failed to apply to 5.10-stable tree

PATCH [email protected] 1 participant 1 message Nov 21, 2022

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 5.10-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

Possible dependencies:

17f442e7e475 ("iio: pressure: ms5611: fixed value compensation bug") dc19fa63ad80 ("iio: ms5611: Simplify IO callback parameters")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 17f442e7e47579d3881fc4d47354eaef09302e6f Mon Sep 17 00:00:00 2001
From: Mitja Spes <[email protected]>
Date: Fri, 21 Oct 2022 15:58:20 +0200
Subject: [PATCH] iio: pressure: ms5611: fixed value compensation bug

When using multiple instances of this driver the compensation PROM was overwritten by the last initialized sensor. Now each sensor has own PROM storage.

Fixes 9690d81a02dc ("iio: pressure: ms5611: add support for MS5607 temperature and pressure sensor")
drivers/iio/pressure/ms5611.h +4 -8
index cbc9349c342a..550b75b7186f 100644
@@ -25,13 +25,6 @@ enum {
 	MS5607,
 };
 
-struct ms5611_chip_info {
-	u16 prom[MS5611_PROM_WORDS_NB];
-
-	int (*temp_and_pressure_compensate)(struct ms5611_chip_info *chip_info,
-					    s32 *temp, s32 *pressure);
-};
-
 /*
  * OverSampling Rate descriptor.
  * Warning: cmd MUST be kept aligned on a word boundary (see
@@ -50,12 +43,15 @@ struct ms5611_state {
 	const struct ms5611_osr *pressure_osr;
 	const struct ms5611_osr *temp_osr;
 
+	u16 prom[MS5611_PROM_WORDS_NB];
+
 	int (*reset)(struct ms5611_state *st);
 	int (*read_prom_word)(struct ms5611_state *st, int index, u16 *word);
 	int (*read_adc_temp_and_pressure)(struct ms5611_state *st,
 					  s32 *temp, s32 *pressure);
 
-	struct ms5611_chip_info *chip_info;
+	int (*compensate_temp_and_pressure)(struct ms5611_state *st, s32 *temp,
+					  s32 *pressure);
 	struct regulator *vdd;
 };
 
drivers/iio/pressure/ms5611_core.c +27 -24

101 lines not on this page · raw message