Skip to content
Commit a76e7c68 authored by Thomas Kavanagh's avatar Thomas Kavanagh Committed by Wolfram Sang
Browse files

i2c: algo: pca: Fix chip reset function for PCA9665



The parameter passed to pca9665_reset is adap->data (which is bus driver
specific), not i2c_algp_pca_data *adap. pca9665_reset expects it to be
i2c_algp_pca_data *adap. All other wrappers from the algo call back to
the bus driver, which knows to handle its custom data. Only pca9665_reset
resides inside the algorithm code and does not know how to handle a custom
data structure. This can result in a kernel crash.

Fix by re-factoring pca_reset() from a macro to a function handling chip
specific code, and only call adap->reset_chip() if the chip is not PCA9665.

Signed-off-by: default avatarThomas Kavanagh <tkavanagh@juniper.net>
Signed-off-by: default avatarGuenter Roeck <groeck@juniper.net>
Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
parent 0c25aefa
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment