i2c: altera: use proper variable to hold errno
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Fri, 27 Mar 2020 22:28:26 +0000 (23:28 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 2 May 2020 06:48:47 +0000 (08:48 +0200)
commit6cdded333de6818ca64ca5996a0deb756853191b
treef685866e58e4da7c779730f5d9997a63fd857e08
parentdb2426f86d44fc423aa36fd8b8302aa7155e161f
i2c: altera: use proper variable to hold errno

commit edb2c9dd3948738ef030c32b948543e84f4d3f81 upstream.

device_property_read_u32() returns errno or 0, so we should use the
integer variable 'ret' and not the u32 'val' to hold the retval.

Fixes: 0560ad576268 ("i2c: altera: Add Altera I2C Controller driver")
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Thor Thayer <thor.thayer@linux.intel.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/busses/i2c-altera.c