i2c: tegra: Register Err Injection driver based on DT
Register the error injection driver only if there is a reporter ID assigned to the I2C instance. Bug 5421820 Signed-off-by: Akhil R <akhilrajeev@nvidia.com> Change-Id: I990ca2014b98a922216e3c6bff0e16778921eba4 Reviewed-on: https://git-master.nvidia.com/r/c/3rdparty/canonical/linux-noble/+/3424404 GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com> Reviewed-by: Bibek Basu <bbasu@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
fd8f0c2eca
commit
fc722edbf3
@@ -2205,15 +2205,17 @@ static int tegra_i2c_probe(struct platform_device *pdev)
|
||||
if (err)
|
||||
goto release_rpm;
|
||||
|
||||
/* Register error reporting callback */
|
||||
err = hsierrrpt_reg_cb(IP_I2C, i2c_dev->adapter.nr, i2c_inject_err_fsi, i2c_dev);
|
||||
/* Register error reporting callback if a reporter ID is registered */
|
||||
if (i2c_dev->epl_reporter_id) {
|
||||
err = hsierrrpt_reg_cb(IP_I2C, i2c_dev->adapter.nr, i2c_inject_err_fsi, i2c_dev);
|
||||
|
||||
if (err != 0)
|
||||
dev_info(i2c_dev->dev, "Err inj callback registration failed: %d", err);
|
||||
/* Continue init despite err inj utility
|
||||
* registration failure, as the err inj support
|
||||
* is meant only for debug purposes.
|
||||
*/
|
||||
/* Continue init despite err inj utility
|
||||
* registration failure, as the err inj support
|
||||
* is meant only for debug purposes.
|
||||
*/
|
||||
if (err != 0)
|
||||
dev_info(i2c_dev->dev, "Err inj callback registration failed: %d", err);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user