Skip to contentSkip to conversation

iio: accel: adxl355: Replace custom definitions with generic from units.h

PATCH Applied Andy Shevchenko 2 participants 2 messages Feb 2, 2022 – Feb 5, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: accel: adxl355: Replace custom definitions with generic from units.h

The units.h provides MEGA and TERA. Replace custom ones.

---
 drivers/iio/accel/adxl355_core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/iio/accel/adxl355_core.c +2 -3
index 4f485909f459..7023de888835 100644
@@ -20,6 +20,8 @@
 #include <linux/mod_devicetable.h>
 #include <linux/of_irq.h>
 #include <linux/regmap.h>
+#include <linux/units.h>
+
 #include <asm/unaligned.h>
 
 #include "adxl355.h"
@@ -60,9 +62,6 @@
 #define ADXL355_PARTID_VAL		0xED
 #define ADXL355_RESET_CODE		0x52
 
-#define MEGA 1000000UL
-#define TERA 1000000000000ULL
-
 static const struct regmap_range adxl355_read_reg_range[] = {
 	regmap_reg_range(ADXL355_DEVID_AD_REG, ADXL355_FIFO_DATA_REG),
 	regmap_reg_range(ADXL355_OFFSET_X_H_REG, ADXL355_SELF_TEST_REG),
Signature · 1 line
2.34.1
maintainer Applied
#1 lore raw
Quoted 3 lines · On Wed, 2 Feb 2022 19:37:23 +0200 Andy Shevchenko…

The units.h provides MEGA and TERA. Replace custom ones.

Applied,

Thanks,

Jonathan

Quoted 27 lines
---
 drivers/iio/accel/adxl355_core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/iio/accel/adxl355_core.c +2 -3
index 4f485909f459..7023de888835 100644
@@ -20,6 +20,8 @@
 #include <linux/mod_devicetable.h>
 #include <linux/of_irq.h>
 #include <linux/regmap.h>
+#include <linux/units.h>
+
 #include <asm/unaligned.h>
 
 #include "adxl355.h"
@@ -60,9 +62,6 @@
 #define ADXL355_PARTID_VAL		0xED
 #define ADXL355_RESET_CODE		0x52
 
-#define MEGA 1000000UL
-#define TERA 1000000000000ULL
-
 static const struct regmap_range adxl355_read_reg_range[] = {
 	regmap_reg_range(ADXL355_DEVID_AD_REG, ADXL355_FIFO_DATA_REG),
 	regmap_reg_range(ADXL355_OFFSET_X_H_REG, ADXL355_SELF_TEST_REG),