pwm: lpss: Make use of bits.h macros for all masks
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 27 Sep 2022 16:24:20 +0000 (19:24 +0300)
committerThierry Reding <thierry.reding@gmail.com>
Wed, 28 Sep 2022 14:19:43 +0000 (16:19 +0200)
Make use of the GENMASK() (far less error-prone, far more concise).

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-lpss.c

index a209154..accdef5 100644 (file)
@@ -10,6 +10,7 @@
  * Author: Alan Cox <alan@linux.intel.com>
  */
 
+#include <linux/bits.h>
 #include <linux/delay.h>
 #include <linux/io.h>
 #include <linux/iopoll.h>
@@ -26,7 +27,7 @@
 #define PWM_ENABLE                     BIT(31)
 #define PWM_SW_UPDATE                  BIT(30)
 #define PWM_BASE_UNIT_SHIFT            8
-#define PWM_ON_TIME_DIV_MASK           0x000000ff
+#define PWM_ON_TIME_DIV_MASK           GENMASK(7, 0)
 
 /* Size of each PWM register space if multiple */
 #define PWM_SIZE                       0x400