mirror of
				https://github.com/DigitalDevices/dddvb.git
				synced 2025-03-01 10:35:23 +00:00 
			
		
		
		
	print the source of I2C errors
This commit is contained in:
		| @@ -73,7 +73,7 @@ static int i2c_write_reg(struct i2c_adapter *adapter, u8 adr, | ||||
| 	struct i2c_msg msg = {.addr = adr, .flags = 0, .buf = m, .len = 2}; | ||||
|  | ||||
| 	if (i2c_transfer(adapter, &msg, 1) != 1) { | ||||
| 		pr_err("Failed to write to I2C register %02x@%02x!\n", | ||||
| 		pr_err("cxd2099: failed to write to I2C register %02x@%02x!\n", | ||||
| 		       reg, adr); | ||||
| 		return -1; | ||||
| 	} | ||||
| @@ -86,7 +86,7 @@ static int i2c_write(struct i2c_adapter *adapter, u8 adr, | ||||
| 	struct i2c_msg msg = {.addr = adr, .flags = 0, .buf = data, .len = len}; | ||||
|  | ||||
| 	if (i2c_transfer(adapter, &msg, 1) != 1) { | ||||
| 		pr_err("Failed to write to I2C!\n"); | ||||
| 		pr_err("cxd2099: i2c_write error\n"); | ||||
| 		return -1; | ||||
| 	} | ||||
| 	return 0; | ||||
| @@ -101,7 +101,7 @@ static int i2c_read_reg(struct i2c_adapter *adapter, u8 adr, | ||||
| 				   .buf = val, .len = 1} }; | ||||
|  | ||||
| 	if (i2c_transfer(adapter, msgs, 2) != 2) { | ||||
| 		pr_err("error in i2c_read_reg\n"); | ||||
| 		pr_err("cxd2099: i2c_read_reg error\n"); | ||||
| 		return -1; | ||||
| 	} | ||||
| 	return 0; | ||||
| @@ -116,7 +116,7 @@ static int i2c_read(struct i2c_adapter *adapter, u8 adr, | ||||
| 				   .buf = data, .len = n} }; | ||||
| 	 | ||||
| 	if (i2c_transfer(adapter, msgs, 2) != 2) { | ||||
| 		pr_err("error in i2c_read\n"); | ||||
| 		pr_err("cxd2099: i2c_read error\n"); | ||||
| 		return -1; | ||||
| 	} | ||||
| 	return 0; | ||||
|   | ||||
| @@ -191,13 +191,13 @@ static int read_register_unlocked(struct mxl *state, u32 reg, u32 *val) | ||||
| 	stat = i2cwrite(state, data, | ||||
| 			MXL_HYDRA_REG_SIZE_IN_BYTES + MXL_HYDRA_I2C_HDR_SIZE); | ||||
| 	if (stat) | ||||
| 		pr_err("i2c read error 1\n"); | ||||
| 		pr_err("mxl5xx: i2c read error 1\n"); | ||||
| 	if (!stat) | ||||
| 		stat = i2cread(state, (u8 *) val, | ||||
| 			       MXL_HYDRA_REG_SIZE_IN_BYTES); | ||||
| 	le32_to_cpus(val); | ||||
| 	if (stat) | ||||
| 		pr_err("i2c read error 2\n"); | ||||
| 		pr_err("mxl5xx: i2c read error 2\n"); | ||||
| 	return stat; | ||||
| } | ||||
|  | ||||
| @@ -245,7 +245,7 @@ static int write_register(struct mxl *state, u32 reg, u32 val) | ||||
| 	stat = i2cwrite(state, data, sizeof(data)); | ||||
| 	mutex_unlock(&state->base->i2c_lock); | ||||
| 	if (stat) | ||||
| 		pr_err("i2c write error\n"); | ||||
| 		pr_err("mxl5xx: i2c write error\n"); | ||||
| 	return stat; | ||||
| } | ||||
|  | ||||
| @@ -292,7 +292,7 @@ static int write_firmware_block(struct mxl *state, | ||||
| 			MXL_HYDRA_REG_SIZE_IN_BYTES + size); | ||||
| 	mutex_unlock(&state->base->i2c_lock); | ||||
| 	if (stat) | ||||
| 		pr_err("fw block write failed\n"); | ||||
| 		pr_err("mxl5xx: fw block write failed\n"); | ||||
| 	return stat; | ||||
| } | ||||
|  | ||||
| @@ -309,14 +309,14 @@ static int read_register(struct mxl *state, u32 reg, u32 *val) | ||||
| 	stat = i2cwrite(state, data, | ||||
| 			MXL_HYDRA_REG_SIZE_IN_BYTES + MXL_HYDRA_I2C_HDR_SIZE); | ||||
| 	if (stat) | ||||
| 		pr_err("i2c read error 1\n"); | ||||
| 		pr_err("mxl5xx: i2c read error 1\n"); | ||||
| 	if (!stat) | ||||
| 		stat = i2cread(state, (u8 *) val, | ||||
| 			       MXL_HYDRA_REG_SIZE_IN_BYTES); | ||||
| 	mutex_unlock(&state->base->i2c_lock); | ||||
| 	le32_to_cpus(val); | ||||
| 	if (stat) | ||||
| 		pr_err("i2c read error 2\n"); | ||||
| 		pr_err("mxl5xx: i2c read error 2\n"); | ||||
| 	return stat; | ||||
| } | ||||
|  | ||||
| @@ -976,7 +976,7 @@ static int do_firmware_download(struct mxl *state, u8 *mbinBufferPtr, | ||||
| 	MXL_BOOL_E xcpuFwFlag = MXL_FALSE; | ||||
|    | ||||
| 	if (mbinPtr->header.id != MBIN_FILE_HEADER_ID) { | ||||
| 		pr_err("%s: Invalid file header ID (%c)\n", | ||||
| 		pr_err("mxl5xx(%s): Invalid file header ID (%c)\n", | ||||
| 		       __func__, mbinPtr->header.id); | ||||
| 		return -EINVAL; | ||||
| 	} | ||||
| @@ -986,7 +986,7 @@ static int do_firmware_download(struct mxl *state, u8 *mbinBufferPtr, | ||||
| 	segmentPtr = (MBIN_SEGMENT_T *) (&mbinPtr->data[0]); | ||||
| 	for (index = 0; index < mbinPtr->header.numSegments; index++) { | ||||
| 		if (segmentPtr->header.id != MBIN_SEGMENT_HEADER_ID) { | ||||
| 			pr_err("%s: Invalid segment header ID (%c)\n", | ||||
| 			pr_err("mxl5xx(%s): Invalid segment header ID (%c)\n", | ||||
| 			       __func__, segmentPtr->header.id); | ||||
| 			return -EINVAL; | ||||
| 		} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user