]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
habanalabs: return error when failing to read/write i2c
authorOded Gabbay <oded.gabbay@gmail.com>
Tue, 26 Feb 2019 09:23:34 +0000 (11:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 26 Feb 2019 10:35:03 +0000 (11:35 +0100)
commit4398e7057d66050b4121b97da048bfe3fdaf4c8d
tree87dfea73893e480b56102f03d42335c44a8b49ac
parent8737d037209fe97a98863047cc2789b38c3d3681
habanalabs: return error when failing to read/write i2c

The driver can't read/write from i2c if the device is in reset or
disabled. Therefore, return -EBUSY in those cases instead of 0.

This change also fixes a smatch warning about uninitialized variable.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/habanalabs/debugfs.c