summaryrefslogtreecommitdiffstats
path: root/drivers/video/edid.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/edid.c')
-rw-r--r--drivers/video/edid.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/video/edid.c b/drivers/video/edid.c
index 1baff7317b..7e6747ccd5 100644
--- a/drivers/video/edid.c
+++ b/drivers/video/edid.c
@@ -1,3 +1,4 @@
+// SPDX-License-Identifier: GPL-2.0-only
/*
* drivers/video/edid.c
*
@@ -20,11 +21,6 @@
*
* GTF Spreadsheet by Andy Morrish (1/5/97)
* available at http://www.vesa.org
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file COPYING in the main directory of this archive
- * for more details.
- *
*/
#define pr_fmt(fmt) "EDID: " fmt
@@ -851,20 +847,27 @@ edid_do_read_i2c(struct i2c_adapter *adapter, unsigned char *buf,
ret = i2c_transfer(adapter, &msgs[3 - xfers], xfers);
} while (ret != xfers && --retries);
- return ret == xfers ? 0 : -1;
+ if (ret == 0)
+ ret = -EPROTO;
+
+ return ret == xfers ? 0 : ret;
}
void *edid_read_i2c(struct i2c_adapter *adapter)
{
u8 *block;
+ int ret;
if (!IS_ENABLED(CONFIG_I2C))
return NULL;
block = xmalloc(EDID_LENGTH);
- if (edid_do_read_i2c(adapter, block, 0, EDID_LENGTH))
+ ret = edid_do_read_i2c(adapter, block, 0, EDID_LENGTH);
+ if (ret) {
+ dev_dbg(&adapter->dev, "EDID readout failed: %pe\n", ERR_PTR(ret));
goto out;
+ }
return block;
out: