i2c: jz4780: drop superfluous init
authorWolfram Sang <wsa@the-dreams.de>
Sun, 5 Jun 2016 09:41:42 +0000 (11:41 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Mon, 13 Jun 2016 20:32:09 +0000 (22:32 +0200)
David reported that the length for memset was incorrect (element sizes
were not taken into account). Then I saw that we are clearing kzalloced
memory, so we can simply drop this code.

Reported-by: David Binderman <dcb314@hotmail.com>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/busses/i2c-jz4780.c

index ba14a863b451f943ea862bb94d2f808554a397d0..cd9872594fe2a057b5c0b646c1b38ca56cc54814 100644 (file)
@@ -791,10 +791,6 @@ static int jz4780_i2c_probe(struct platform_device *pdev)
 
        jz4780_i2c_writew(i2c, JZ4780_I2C_INTM, 0x0);
 
-       i2c->cmd = 0;
-       memset(i2c->cmd_buf, 0, BUFSIZE);
-       memset(i2c->data_buf, 0, BUFSIZE);
-
        i2c->irq = platform_get_irq(pdev, 0);
        ret = devm_request_irq(&pdev->dev, i2c->irq, jz4780_i2c_irq, 0,
                               dev_name(&pdev->dev), i2c);