diff mbox series

[v2,6/9] iio/drivers/hid-sensor: Use HZ macros

Message ID 20210224144222.23762-6-daniel.lezcano@linaro.org (mailing list archive)
State New
Headers show
Series None | expand

Commit Message

Daniel Lezcano Feb. 24, 2021, 2:42 p.m. UTC
HZ unit conversion macros are available in units.h, use them and
remove the duplicate definition.

Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
 drivers/iio/common/hid-sensors/hid-sensor-attributes.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Jonathan Cameron March 14, 2021, 5 p.m. UTC | #1
On Wed, 24 Feb 2021 15:42:16 +0100
Daniel Lezcano <daniel.lezcano@linaro.org> wrote:

> HZ unit conversion macros are available in units.h, use them and
> remove the duplicate definition.
> 
> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/iio/common/hid-sensors/hid-sensor-attributes.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
> index 442ff787f7af..dda3b67e494f 100644
> --- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
> +++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
> @@ -11,13 +11,12 @@
>  #include <linux/kernel.h>
>  #include <linux/slab.h>
>  #include <linux/time.h>
> +#include <linux/units.h>
>  
>  #include <linux/hid-sensor-hub.h>
>  #include <linux/iio/iio.h>
>  #include <linux/iio/sysfs.h>
>  
> -#define HZ_PER_MHZ	1000000L
> -
>  static struct {
>  	u32 usage_id;
>  	int unit; /* 0 for default others from HID sensor spec */
diff mbox series

Patch

diff --git a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
index 442ff787f7af..dda3b67e494f 100644
--- a/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
+++ b/drivers/iio/common/hid-sensors/hid-sensor-attributes.c
@@ -11,13 +11,12 @@ 
 #include <linux/kernel.h>
 #include <linux/slab.h>
 #include <linux/time.h>
+#include <linux/units.h>
 
 #include <linux/hid-sensor-hub.h>
 #include <linux/iio/iio.h>
 #include <linux/iio/sysfs.h>
 
-#define HZ_PER_MHZ	1000000L
-
 static struct {
 	u32 usage_id;
 	int unit; /* 0 for default others from HID sensor spec */