Skip to content

Commit 1fe1c28

Browse files
geertuYuryNorov
authored andcommitted
iio: mlx90614: Convert to common field_{get,prep}() helpers
Drop the driver-specific field_get() and field_prep() macros, in favor of the globally available variants from <linux/bitfield.h>. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> Acked-by: Crt Mori <cmo@melexis.com> Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
1 parent 54bfd90 commit 1fe1c28

1 file changed

Lines changed: 1 addition & 6 deletions

File tree

drivers/iio/temperature/mlx90614.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
* the "wakeup" GPIO is not given, power management will be disabled.
2323
*/
2424

25+
#include <linux/bitfield.h>
2526
#include <linux/delay.h>
2627
#include <linux/err.h>
2728
#include <linux/gpio/consumer.h>
@@ -68,12 +69,6 @@
6869
#define MLX90614_CONST_SCALE 20 /* Scale in milliKelvin (0.02 * 1000) */
6970
#define MLX90614_CONST_FIR 0x7 /* Fixed value for FIR part of low pass filter */
7071

71-
/* Non-constant mask variant of FIELD_GET() and FIELD_PREP() */
72-
#undef field_get
73-
#define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1))
74-
#undef field_prep
75-
#define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask))
76-
7772
struct mlx_chip_info {
7873
/* EEPROM offsets with 16-bit data, MSB first */
7974
/* emissivity correction coefficient */

0 commit comments

Comments
 (0)