Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

iio: common: scmi_sensors: use HZ macro from units.h

Remove duplicated definition of UHZ_PER_HZ, because it's available in
the units.h as MICROHZ_PER_HZ.

Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20220812165243.22177-5-ddrokosov@sberdevices.ru
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

authored by

Dmitry Rokosov and committed by
Jonathan Cameron
c05c3e5d fe49ce7a

+4 -4
+4 -4
drivers/iio/common/scmi_sensors/scmi_iio.c
··· 18 18 #include <linux/scmi_protocol.h> 19 19 #include <linux/time.h> 20 20 #include <linux/types.h> 21 + #include <linux/units.h> 21 22 22 23 #define SCMI_IIO_NUM_OF_AXIS 3 23 24 ··· 131 130 static int scmi_iio_set_odr_val(struct iio_dev *iio_dev, int val, int val2) 132 131 { 133 132 struct scmi_iio_priv *sensor = iio_priv(iio_dev); 134 - const unsigned long UHZ_PER_HZ = 1000000UL; 135 133 u64 sec, mult, uHz, sf; 136 134 u32 sensor_config; 137 135 char buf[32]; ··· 145 145 return err; 146 146 } 147 147 148 - uHz = val * UHZ_PER_HZ + val2; 148 + uHz = val * MICROHZ_PER_HZ + val2; 149 149 150 150 /* 151 151 * The seconds field in the sensor interval in SCMI is 16 bits long ··· 156 156 * count the number of characters 157 157 */ 158 158 sf = (u64)uHz * 0xFFFF; 159 - do_div(sf, UHZ_PER_HZ); 159 + do_div(sf, MICROHZ_PER_HZ); 160 160 mult = scnprintf(buf, sizeof(buf), "%llu", sf) - 1; 161 161 162 - sec = int_pow(10, mult) * UHZ_PER_HZ; 162 + sec = int_pow(10, mult) * MICROHZ_PER_HZ; 163 163 do_div(sec, uHz); 164 164 if (sec == 0) { 165 165 dev_err(&iio_dev->dev,