fix kernel compile error with old gcc version
authorAustin Zhang <austin.zhang@intel.com>
Thu, 22 Aug 2013 10:59:59 +0000 (18:59 +0800)
committerYin Kangkai <kangkai.yin@linux.intel.com>
Thu, 26 Dec 2013 14:33:49 +0000 (22:33 +0800)
Signed-off-by: Peng Li <peng.li@intel.com>
Signed-off-by: Austin Zhang <austin.zhang@intel.com>
arch/x86/platform/intel-mid/device_libs/platform_edlp_modem.c
arch/x86/platform/intel-mid/device_libs/platform_ffl_modem.c
arch/x86/platform/intel-mid/device_libs/platform_hsi_modem.c
arch/x86/platform/intel-mid/device_libs/platform_logical_modem.c
drivers/hsi/clients/hsi_ffl_tty.c
drivers/hsi/controllers/intel_mid_hsi.c
drivers/media/video/v4l2-ioctl.c
include/linux/hsi/hsi.h

index 8b83455..e5965fd 100644 (file)
@@ -34,8 +34,8 @@ void *edlp_modem_platform_data(void *data)
                        .tx_cfg.speed = 200000, /* tx clock, kHz */
                        .tx_cfg.channels = 8,
                        .tx_cfg.mode = HSI_MODE_FRAME,
-                       .tx_cfg.arb_mode = HSI_ARB_RR,
-                       .rx_cfg.flow = HSI_FLOW_SYNC,
+                       .tx_cfg.u.arb_mode = HSI_ARB_RR,
+                       .rx_cfg.u.flow = HSI_FLOW_SYNC,
                        .rx_cfg.mode = HSI_MODE_FRAME,
                        .rx_cfg.channels = 8
                },
@@ -47,8 +47,8 @@ void *edlp_modem_platform_data(void *data)
                        .tx_cfg.speed = 100000, /* tx clock, kHz */
                        .tx_cfg.channels = 8,
                        .tx_cfg.mode = HSI_MODE_FRAME,
-                       .tx_cfg.arb_mode = HSI_ARB_RR,
-                       .rx_cfg.flow = HSI_FLOW_SYNC,
+                       .tx_cfg.u.arb_mode = HSI_ARB_RR,
+                       .rx_cfg.u.flow = HSI_FLOW_SYNC,
                        .rx_cfg.mode = HSI_MODE_FRAME,
                        .rx_cfg.channels = 8
                }
index dacc8bb..3ef06b7 100644 (file)
@@ -34,8 +34,8 @@ void *ffl_modem_platform_data(void *data)
                        .tx_cfg.speed = 200000, /* tx clock, kHz */
                        .tx_cfg.channels = 8,
                        .tx_cfg.mode = HSI_MODE_FRAME,
-                       .tx_cfg.arb_mode = HSI_ARB_RR,
-                       .rx_cfg.flow = HSI_FLOW_SYNC,
+                       .tx_cfg.u.arb_mode = HSI_ARB_RR,
+                       .rx_cfg.u.flow = HSI_FLOW_SYNC,
                        .rx_cfg.mode = HSI_MODE_FRAME,
                        .rx_cfg.channels = 8
                },
@@ -47,8 +47,8 @@ void *ffl_modem_platform_data(void *data)
                        .tx_cfg.speed = 100000, /* tx clock, kHz */
                        .tx_cfg.channels = 8,
                        .tx_cfg.mode = HSI_MODE_FRAME,
-                       .tx_cfg.arb_mode = HSI_ARB_RR,
-                       .rx_cfg.flow = HSI_FLOW_SYNC,
+                       .tx_cfg.u.arb_mode = HSI_ARB_RR,
+                       .rx_cfg.u.flow = HSI_FLOW_SYNC,
                        .rx_cfg.mode = HSI_MODE_FRAME,
                        .rx_cfg.channels = 8
                }
index 50ca5a2..69a95c3 100644 (file)
@@ -53,8 +53,8 @@ void *hsi_modem_platform_data(void *data)
                        .tx_cfg.speed = 200000, /* tx clock, kHz */
                        .tx_cfg.channels = 8,
                        .tx_cfg.mode = HSI_MODE_FRAME,
-                       .tx_cfg.arb_mode = HSI_ARB_RR,
-                       .rx_cfg.flow = HSI_FLOW_SYNC,
+                       .tx_cfg.u.arb_mode = HSI_ARB_RR,
+                       .rx_cfg.u.flow = HSI_FLOW_SYNC,
                        .rx_cfg.mode = HSI_MODE_FRAME,
                        .rx_cfg.channels = 8
                },
@@ -67,8 +67,8 @@ void *hsi_modem_platform_data(void *data)
                        .tx_cfg.speed = 100000, /* tx clock, kHz */
                        .tx_cfg.channels = 8,
                        .tx_cfg.mode = HSI_MODE_FRAME,
-                       .tx_cfg.arb_mode = HSI_ARB_RR,
-                       .rx_cfg.flow = HSI_FLOW_SYNC,
+                       .tx_cfg.u.arb_mode = HSI_ARB_RR,
+                       .rx_cfg.u.flow = HSI_FLOW_SYNC,
                        .rx_cfg.mode = HSI_MODE_FRAME,
                        .rx_cfg.channels = 8
                }
@@ -81,8 +81,8 @@ void *hsi_modem_platform_data(void *data)
                        .tx_cfg.speed = 100000, /* tx clock, kHz */
                        .tx_cfg.channels = 8,
                        .tx_cfg.mode = HSI_MODE_FRAME,
-                       .tx_cfg.arb_mode = HSI_ARB_RR,
-                       .rx_cfg.flow = HSI_FLOW_SYNC,
+                       .tx_cfg.u.arb_mode = HSI_ARB_RR,
+                       .rx_cfg.u.flow = HSI_FLOW_SYNC,
                        .rx_cfg.mode = HSI_MODE_FRAME,
                        .rx_cfg.channels = 8
                }
index ec21d03..fee94d6 100644 (file)
@@ -33,86 +33,66 @@ static struct hsi_board_info hsi_info[HSI_MID_MAX_CLIENTS] = {
                .name = "client0",
                .hsi_id = 0,
                .port = 0,
-               .tx_cfg = {
-                       .mode           = HSI_MODE_FRAME,
-                       .channels       = 8,
-                       .speed          = 200000, /* 200 MHz */
-                       .arb_mode       = HSI_ARB_RR,
-               },
-               .rx_cfg = {
-                       .mode           = HSI_MODE_FRAME,
-                       .channels       = 8,
-                       .speed          = 200000, /* 200 MHz but used in tx */
-                       .flow   = HSI_FLOW_PIPE,
-               },
+               .tx_cfg.mode            = HSI_MODE_FRAME,
+               .tx_cfg.channels        = 8,
+               .tx_cfg.speed           = 200000, /* 200 MHz */
+               .tx_cfg.u.arb_mode      = HSI_ARB_RR,
+               .rx_cfg.mode            = HSI_MODE_FRAME,
+               .rx_cfg.channels        = 8,
+               .rx_cfg.speed           = 200000, /* 200 MHz but used in tx */
+               .rx_cfg.u.flow  = HSI_FLOW_PIPE,
        },
        [1] =   {
                .name = "client1",
                .hsi_id = 0,
                .port = 0,
-               .tx_cfg = {
-                       .mode           = HSI_MODE_FRAME,
-                       .channels       = 8,
-                       .speed          = 200000, /* 200 MHz */
-                       .arb_mode       = HSI_ARB_RR,
-               },
-               .rx_cfg = {
-                       .mode           = HSI_MODE_FRAME,
-                       .channels       = 8,
-                       .speed          = 200000, /* 200 MHz but used in tx */
-                       .flow   = HSI_FLOW_PIPE,
-               },
+               .tx_cfg.mode            = HSI_MODE_FRAME,
+               .tx_cfg.channels        = 8,
+               .tx_cfg.speed           = 200000, /* 200 MHz */
+               .tx_cfg.u.arb_mode      = HSI_ARB_RR,
+               .rx_cfg.mode            = HSI_MODE_FRAME,
+               .rx_cfg.channels        = 8,
+               .rx_cfg.speed           = 200000, /* 200 MHz but used in tx */
+               .rx_cfg.u.flow  = HSI_FLOW_PIPE,
        },
        [2] =   {
                .name = "client2",
                .hsi_id = 0,
                .port = 0,
-               .tx_cfg = {
-                       .mode           = HSI_MODE_FRAME,
-                       .channels       = 8,
-                       .speed          = 200000, /* 200 MHz */
-                       .arb_mode       = HSI_ARB_RR,
-               },
-               .rx_cfg = {
-                       .mode           = HSI_MODE_FRAME,
-                       .channels       = 8,
-                       .speed          = 200000, /* 200 MHz but used in tx */
-                       .flow   = HSI_FLOW_PIPE,
-               },
+               .tx_cfg.mode            = HSI_MODE_FRAME,
+               .tx_cfg.channels        = 8,
+               .tx_cfg.speed           = 200000, /* 200 MHz */
+               .tx_cfg.u.arb_mode      = HSI_ARB_RR,
+               .rx_cfg.mode            = HSI_MODE_FRAME,
+               .rx_cfg.channels        = 8,
+               .rx_cfg.speed           = 200000, /* 200 MHz but used in tx */
+               .rx_cfg.u.flow  = HSI_FLOW_PIPE,
        },
        [3] =   {
                .name = "client3",
                .hsi_id = 0,
                .port = 0,
-               .tx_cfg = {
-                       .mode           = HSI_MODE_FRAME,
-                       .channels       = 8,
-                       .speed          = 200000, /* 200 MHz */
-                       .arb_mode       = HSI_ARB_RR,
-               },
-               .rx_cfg = {
-                       .mode           = HSI_MODE_FRAME,
-                       .channels       = 8,
-                       .speed          = 200000, /* 200 MHz but used in tx */
-                       .flow   = HSI_FLOW_PIPE,
-               },
+               .tx_cfg.mode            = HSI_MODE_FRAME,
+               .tx_cfg.channels        = 8,
+               .tx_cfg.speed           = 200000, /* 200 MHz */
+               .tx_cfg.u.arb_mode      = HSI_ARB_RR,
+               .rx_cfg.mode            = HSI_MODE_FRAME,
+               .rx_cfg.channels        = 8,
+               .rx_cfg.speed           = 200000, /* 200 MHz but used in tx */
+               .rx_cfg.u.flow  = HSI_FLOW_PIPE,
        },
        [4] = {
                .name = "hsi_flash",
                .hsi_id = 0,
                .port = 0,
-               .tx_cfg = {
-                       .mode           = HSI_MODE_FRAME,
-                       .channels       = 1,
-                       .speed          = 5000, /* 5 MHz */
-                       .arb_mode       = HSI_ARB_RR,
-               },
-               .rx_cfg = {
-                       .mode           = HSI_MODE_FRAME,
-                       .channels       = 1,
-                       .speed          = 0,
-                       .flow   = HSI_FLOW_SYNC,
-               },
+               .tx_cfg.mode            = HSI_MODE_FRAME,
+               .tx_cfg.channels        = 1,
+               .tx_cfg.speed           = 5000, /* 5 MHz */
+               .tx_cfg.u.arb_mode      = HSI_ARB_RR,
+               .rx_cfg.mode            = HSI_MODE_FRAME,
+               .rx_cfg.channels        = 1,
+               .rx_cfg.speed           = 0,
+               .rx_cfg.u.flow  = HSI_FLOW_SYNC,
        },
 };
 
index f4a1c01..7db3179 100644 (file)
@@ -2674,7 +2674,7 @@ static int ffl_tty_ioctl(struct tty_struct *tty,
                case HSI_FLOW_SYNC:
                case HSI_FLOW_PIPE:
                        spin_lock_irqsave(&ctx->tx.lock, flags);
-                       ctx->tx.config.flow = arg;
+                       ctx->tx.config.u.flow = arg;
                        spin_unlock_irqrestore(&ctx->tx.lock, flags);
                        break;
                default:
@@ -2684,7 +2684,7 @@ static int ffl_tty_ioctl(struct tty_struct *tty,
 
        case FFL_TTY_GET_TX_FLOW:
                spin_lock_irqsave(&ctx->tx.lock, flags);
-               data = ctx->tx.config.flow;
+               data = ctx->tx.config.u.flow;
                spin_unlock_irqrestore(&ctx->tx.lock, flags);
                return put_user(data, (unsigned int __user *) arg);
                break;
@@ -2694,7 +2694,7 @@ static int ffl_tty_ioctl(struct tty_struct *tty,
                case HSI_FLOW_SYNC:
                case HSI_FLOW_PIPE:
                        spin_lock_irqsave(&ctx->rx.lock, flags);
-                       ctx->client->rx_cfg.flow = arg;
+                       ctx->client->rx_cfg.u.flow = arg;
                        spin_unlock_irqrestore(&ctx->rx.lock, flags);
                        break;
                default:
@@ -2704,7 +2704,7 @@ static int ffl_tty_ioctl(struct tty_struct *tty,
 
        case FFL_TTY_GET_RX_FLOW:
                spin_lock_irqsave(&ctx->rx.lock, flags);
-               data = ctx->rx.config.flow;
+               data = ctx->rx.config.u.flow;
                spin_unlock_irqrestore(&ctx->rx.lock, flags);
                return put_user(data, (unsigned int __user *) arg);
                break;
@@ -2844,7 +2844,7 @@ static int ffl_tty_ioctl(struct tty_struct *tty,
                case HSI_ARB_RR:
                case HSI_ARB_PRIO:
                        spin_lock_irqsave(&ctx->tx.lock, flags);
-                       ctx->tx.config.arb_mode = arg;
+                       ctx->tx.config.u.arb_mode = arg;
                        spin_unlock_irqrestore(&ctx->tx.lock, flags);
                        break;
                default:
@@ -2854,7 +2854,7 @@ static int ffl_tty_ioctl(struct tty_struct *tty,
 
        case FFL_TTY_GET_TX_ARB_MODE:
                spin_lock_irqsave(&ctx->tx.lock, flags);
-               data = ctx->tx.config.arb_mode;
+               data = ctx->tx.config.u.arb_mode;
                spin_unlock_irqrestore(&ctx->tx.lock, flags);
                return put_user(data, (unsigned int __user *) arg);
                break;
index 5c49c01..73cfecc 100644 (file)
@@ -2958,7 +2958,7 @@ static int hsi_mid_setup(struct hsi_client *cl)
        intel_hsi->tx_speed = cl->tx_cfg.speed;
 
        /* Compute the arbiter control register */
-       arb_cfg = cl->tx_cfg.arb_mode;
+       arb_cfg = cl->tx_cfg.u.arb_mode;
 
        /* Compute the RX timeout value (for inserting RX error) */
 
@@ -2977,7 +2977,7 @@ static int hsi_mid_setup(struct hsi_client *cl)
        /* Compute the program, FIFO , DMA and interrupt registers */
        prg_cfg         = ARASAN_RX_TIMEOUT_CNT(rx_timeout) |
                          ARASAN_TX_MODE(cl->tx_cfg.mode) |
-                         ARASAN_RX_FLOW(cl->rx_cfg.flow) |
+                         ARASAN_RX_FLOW(cl->rx_cfg.u.flow) |
                          ARASAN_RX_MODE(cl->rx_cfg.mode);
        irq_cfg         = ARASAN_IRQ_RX_WAKE;
        err_cfg         = ARASAN_IRQ_BREAK | ARASAN_IRQ_RX_ERROR;
index 70e0efb..f67535d 100644 (file)
@@ -1806,7 +1806,7 @@ struct v4l2_ioctl_info {
                u32 offset;
                int (*func)(const struct v4l2_ioctl_ops *ops,
                                struct file *file, void *fh, void *p);
-       };
+       } u;
        void (*debug)(const void *arg, bool write_only);
 };
 
@@ -1831,7 +1831,7 @@ struct v4l2_ioctl_info {
                .ioctl = _ioctl,                                        \
                .flags = _flags | INFO_FL_STD,                          \
                .name = #_ioctl,                                        \
-               .offset = offsetof(struct v4l2_ioctl_ops, _vidioc),     \
+               .u.offset = offsetof(struct v4l2_ioctl_ops, _vidioc),   \
                .debug = _debug,                                        \
        }
 
@@ -1840,7 +1840,7 @@ struct v4l2_ioctl_info {
                .ioctl = _ioctl,                                        \
                .flags = _flags | INFO_FL_FUNC,                         \
                .name = #_ioctl,                                        \
-               .func = _func,                                          \
+               .u.func = _func,                                                \
                .debug = _debug,                                        \
        }
 
@@ -2038,11 +2038,11 @@ static long __video_do_ioctl(struct file *file,
        if (info->flags & INFO_FL_STD) {
                typedef int (*vidioc_op)(struct file *file, void *fh, void *p);
                const void *p = vfd->ioctl_ops;
-               const vidioc_op *vidioc = p + info->offset;
+               const vidioc_op *vidioc = p + info->u.offset;
 
                ret = (*vidioc)(file, fh, arg);
        } else if (info->flags & INFO_FL_FUNC) {
-               ret = info->func(ops, file, fh, arg);
+               ret = info->u.func(ops, file, fh, arg);
        } else if (!ops->vidioc_default) {
                ret = -ENOTTY;
        } else {
index 88ca231..bf3b46c 100644 (file)
@@ -82,7 +82,7 @@ struct hsi_config {
        union {
                unsigned int    flow;           /* RX only */
                unsigned int    arb_mode;       /* TX only */
-       };
+       } u;
 };
 
 /**