The patch groups similar macros into enum data types. Signed-off-by: sayli karnik <karniksayli1995@xxxxxxxxx> --- Changes in v2: Corrected the order of both the enums. Used enum data type names instead of unsigned int inside struct ad7280_platform_data. drivers/staging/iio/adc/ad7280a.h | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/staging/iio/adc/ad7280a.h b/drivers/staging/iio/adc/ad7280a.h index ccfb90d..e22694f 100644 --- a/drivers/staging/iio/adc/ad7280a.h +++ b/drivers/staging/iio/adc/ad7280a.h @@ -13,15 +13,19 @@ * TODO: struct ad7280_platform_data needs to go into include/linux/iio */ -#define AD7280A_ACQ_TIME_400ns 0 -#define AD7280A_ACQ_TIME_800ns 1 -#define AD7280A_ACQ_TIME_1200ns 2 -#define AD7280A_ACQ_TIME_1600ns 3 +enum ad7280a_acq_time { + AD7280A_ACQ_TIME_400ns = 0, + AD7280A_ACQ_TIME_800ns, + AD7280A_ACQ_TIME_1200ns, + AD7280A_ACQ_TIME_1600ns, +}; -#define AD7280A_CONV_AVG_DIS 0 -#define AD7280A_CONV_AVG_2 1 -#define AD7280A_CONV_AVG_4 2 -#define AD7280A_CONV_AVG_8 3 +enum ad7280a_conv_avg { + AD7280A_CONV_AVG_DIS = 0, + AD7280A_CONV_AVG_2, + AD7280A_CONV_AVG_4, + AD7280A_CONV_AVG_8, +}; #define AD7280A_ALERT_REMOVE_VIN5 BIT(2) #define AD7280A_ALERT_REMOVE_VIN4_VIN5 BIT(3) @@ -29,8 +33,8 @@ #define AD7280A_ALERT_REMOVE_AUX4_AUX5 BIT(1) struct ad7280_platform_data { - unsigned int acquisition_time; - unsigned int conversion_averaging; + enum ad7280a_acq_time acquisition_time; + enum ad7280a_conv_avg conversion_averaging; unsigned int chain_last_alert_ignore; bool thermistor_term_en; }; -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html