mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 16:01:44 -04:00
Merge tag 'i2c-host-fixes-7.0-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux into i2c/for-current
i2c-fixes for v7.0-rc5 pxa: fix broken I2C communication on Armada 3700 with recovery fsi: fix device_node reference leak in probe cp2615: fix NULL-deref when serial string is missing
This commit is contained in:
@@ -298,6 +298,9 @@ cp2615_i2c_probe(struct usb_interface *usbif, const struct usb_device_id *id)
|
||||
if (!adap)
|
||||
return -ENOMEM;
|
||||
|
||||
if (!usbdev->serial)
|
||||
return -EINVAL;
|
||||
|
||||
strscpy(adap->name, usbdev->serial, sizeof(adap->name));
|
||||
adap->owner = THIS_MODULE;
|
||||
adap->dev.parent = &usbif->dev;
|
||||
|
||||
@@ -729,6 +729,7 @@ static int fsi_i2c_probe(struct fsi_device *fsi_dev)
|
||||
rc = i2c_add_adapter(&port->adapter);
|
||||
if (rc < 0) {
|
||||
dev_err(dev, "Failed to register adapter: %d\n", rc);
|
||||
of_node_put(np);
|
||||
kfree(port);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -268,6 +268,7 @@ struct pxa_i2c {
|
||||
struct pinctrl *pinctrl;
|
||||
struct pinctrl_state *pinctrl_default;
|
||||
struct pinctrl_state *pinctrl_recovery;
|
||||
bool reset_before_xfer;
|
||||
};
|
||||
|
||||
#define _IBMR(i2c) ((i2c)->reg_ibmr)
|
||||
@@ -1144,6 +1145,11 @@ static int i2c_pxa_xfer(struct i2c_adapter *adap,
|
||||
{
|
||||
struct pxa_i2c *i2c = adap->algo_data;
|
||||
|
||||
if (i2c->reset_before_xfer) {
|
||||
i2c_pxa_reset(i2c);
|
||||
i2c->reset_before_xfer = false;
|
||||
}
|
||||
|
||||
return i2c_pxa_internal_xfer(i2c, msgs, num, i2c_pxa_do_xfer);
|
||||
}
|
||||
|
||||
@@ -1521,7 +1527,16 @@ static int i2c_pxa_probe(struct platform_device *dev)
|
||||
}
|
||||
}
|
||||
|
||||
i2c_pxa_reset(i2c);
|
||||
/*
|
||||
* Skip reset on Armada 3700 when recovery is used to avoid
|
||||
* controller hang due to the pinctrl state changes done by
|
||||
* the generic recovery initialization code. The reset will
|
||||
* be performed later, prior to the first transfer.
|
||||
*/
|
||||
if (i2c_type == REGS_A3700 && i2c->adap.bus_recovery_info)
|
||||
i2c->reset_before_xfer = true;
|
||||
else
|
||||
i2c_pxa_reset(i2c);
|
||||
|
||||
ret = i2c_add_numbered_adapter(&i2c->adap);
|
||||
if (ret < 0)
|
||||
|
||||
Reference in New Issue
Block a user