spi: s3c64xx: fix uninitialized value of slave mode
authorChanho Park <chanho61.park@samsung.com>
Mon, 30 Jul 2018 09:58:10 +0000 (18:58 +0900)
committerChanho Park <chanho61.park@samsung.com>
Mon, 10 Sep 2018 07:16:10 +0000 (16:16 +0900)
Fixes: f343320f9e47 ("spi: s3c64xx: Add slave mode support")

This patch fixes uninitialized value checking of the slave mode.

Change-Id: I0fd06bf1d3fd075a0b283df5c39c0d3ab2e46d6c
Signed-off-by: Chanho Park <chanho61.park@samsung.com>
drivers/spi/spi-s3c64xx.c

index aa1f2ff..ee8fb61 100644 (file)
@@ -491,11 +491,11 @@ static int wait_for_dma(struct s3c64xx_spi_driver_data *sdd,
                        struct spi_transfer *xfer)
 {
        void __iomem *regs = sdd->regs;
-       unsigned long val;
+       unsigned long val = 1;
        u32 status;
        int ms;
 
-       if(spi_controller_is_slave(sdd->master)) {
+       if (spi_controller_is_slave(sdd->master)) {
                /* Slave mode */
                if (wait_for_completion_interruptible(&sdd->xfer_completion) ||
                                sdd->slave_aborted) {