mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
ptp: ocp: Skip I2C flash read when there is no controller.
If an I2C controller isn't present, don't try and read the I2C flash. Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
498ad3f438
commit
1447149d65
1 changed files with 5 additions and 2 deletions
|
@ -228,8 +228,8 @@ static int ptp_ocp_ts_enable(void *priv, bool enable);
|
|||
* 3: GPS
|
||||
* 4: GPS2 (n/c)
|
||||
* 5: MAC
|
||||
* 6: SPI IMU (inertial measurement unit)
|
||||
* 7: I2C oscillator
|
||||
* 6: N/C
|
||||
* 7: I2C controller
|
||||
* 8: HWICAP
|
||||
* 9: SPI Flash
|
||||
*/
|
||||
|
@ -706,6 +706,9 @@ ptp_ocp_get_serial_number(struct ptp_ocp *bp)
|
|||
struct device *dev;
|
||||
int err;
|
||||
|
||||
if (!bp->i2c_ctrl)
|
||||
return;
|
||||
|
||||
dev = device_find_child(&bp->i2c_ctrl->dev, NULL, ptp_ocp_firstchild);
|
||||
if (!dev) {
|
||||
dev_err(&bp->pdev->dev, "Can't find I2C adapter\n");
|
||||
|
|
Loading…
Reference in a new issue