]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
pinctrl: sh-pfc: r8a779[01]: Move 'union vin_data' to shared header file
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Fri, 2 Oct 2015 23:21:15 +0000 (02:21 +0300)
committerGeert Uytterhoeven <geert+renesas@glider.be>
Tue, 20 Oct 2015 14:03:10 +0000 (16:03 +0200)
R8A7790/1 PFC  drivers use almost identical  'union vin_data' and completely
identical VIN_DATA_PIN_GROUP() macro; we thus can  move them into the shared
header file...

Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
drivers/pinctrl/sh-pfc/pfc-r8a7790.c
drivers/pinctrl/sh-pfc/pfc-r8a7791.c
drivers/pinctrl/sh-pfc/sh_pfc.h

index 77a1493c62024c0b65170e2c0118c5940931685f..8e45e30252bc9441ae83f76e7c057bbfc44ea269 100644 (file)
@@ -3624,25 +3624,6 @@ static const unsigned int usb2_pins[] = {
 static const unsigned int usb2_mux[] = {
        USB2_PWEN_MARK, USB2_OVC_MARK,
 };
-
-union vin_data {
-       unsigned int data24[24];
-       unsigned int data20[20];
-       unsigned int data16[16];
-       unsigned int data12[12];
-       unsigned int data10[10];
-       unsigned int data8[8];
-       unsigned int data4[4];
-};
-
-#define VIN_DATA_PIN_GROUP(n, s)                               \
-       {                                                       \
-               .name = #n#s,                                   \
-               .pins = n##_pins.data##s,                       \
-               .mux = n##_mux.data##s,                         \
-               .nr_pins = ARRAY_SIZE(n##_pins.data##s),        \
-       }
-
 /* - VIN0 ------------------------------------------------------------------- */
 static const union vin_data vin0_data_pins = {
        .data24 = {
index 622841954f4b9ab497b09637f6457a374d1a75d0..a58a0dec6994ad4a261ae5ef86ab07413719894e 100644 (file)
@@ -3986,24 +3986,6 @@ static const unsigned int usb1_mux[] = {
        USB1_PWEN_MARK,
        USB1_OVC_MARK,
 };
-
-union vin_data {
-       unsigned int data24[24];
-       unsigned int data20[20];
-       unsigned int data16[16];
-       unsigned int data12[12];
-       unsigned int data10[10];
-       unsigned int data8[8];
-};
-
-#define VIN_DATA_PIN_GROUP(n, s)                               \
-       {                                                       \
-               .name = #n#s,                                   \
-               .pins = n##_pins.data##s,                       \
-               .mux = n##_mux.data##s,                         \
-               .nr_pins = ARRAY_SIZE(n##_pins.data##s),        \
-       }
-
 /* - VIN0 ------------------------------------------------------------------- */
 static const union vin_data vin0_data_pins = {
        .data24 = {
index e00a4b12279c3e7d9e3272a07e3ae3bc95eaf77e..6ab4b46583de3b51f20660c3c0e1813b8899047c 100644 (file)
@@ -52,6 +52,29 @@ struct sh_pfc_pin_group {
        unsigned int nr_pins;
 };
 
+/*
+ * Using union vin_data saves memory occupied by the VIN data pins.
+ * VIN_DATA_PIN_GROUP() is  a macro  used  to describe the VIN pin groups
+ * in this case.
+ */
+#define VIN_DATA_PIN_GROUP(n, s)                               \
+       {                                                       \
+               .name = #n#s,                                   \
+               .pins = n##_pins.data##s,                       \
+               .mux = n##_mux.data##s,                         \
+               .nr_pins = ARRAY_SIZE(n##_pins.data##s),        \
+       }
+
+union vin_data {
+       unsigned int data24[24];
+       unsigned int data20[20];
+       unsigned int data16[16];
+       unsigned int data12[12];
+       unsigned int data10[10];
+       unsigned int data8[8];
+       unsigned int data4[4];
+};
+
 #define SH_PFC_FUNCTION(n)                             \
        {                                               \
                .name = #n,                             \