mfd: mt6323: Replace boilerplate resource code with DEFINE_RES_* macros
authorJosef Friedl <josef.friedl@speed.at>
Sun, 18 Aug 2019 13:56:06 +0000 (15:56 +0200)
committerLee Jones <lee.jones@linaro.org>
Mon, 2 Sep 2019 10:20:40 +0000 (11:20 +0100)
Simplifies and reduces LoC.

Signed-off-by: Josef Friedl <josef.friedl@speed.at>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/mt6397-core.c

index 93c8881..7c81a20 100644 (file)
@@ -5,6 +5,7 @@
  */
 
 #include <linux/interrupt.h>
+#include <linux/ioport.h>
 #include <linux/module.h>
 #include <linux/of_device.h>
 #include <linux/of_irq.h>
 #define MT6397_RTC_SIZE                0x3e
 
 static const struct resource mt6397_rtc_resources[] = {
-       {
-               .start = MT6397_RTC_BASE,
-               .end   = MT6397_RTC_BASE + MT6397_RTC_SIZE,
-               .flags = IORESOURCE_MEM,
-       },
-       {
-               .start = MT6397_IRQ_RTC,
-               .end   = MT6397_IRQ_RTC,
-               .flags = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(MT6397_RTC_BASE, MT6397_RTC_SIZE),
+       DEFINE_RES_IRQ(MT6397_IRQ_RTC),
 };
 
 static const struct resource mt6323_keys_resources[] = {