Commit 1447149d authored by Jonathan Lemon's avatar Jonathan Lemon Committed by David S. Miller

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: default avatarJonathan Lemon <jonathan.lemon@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 498ad3f4
...@@ -228,8 +228,8 @@ static int ptp_ocp_ts_enable(void *priv, bool enable); ...@@ -228,8 +228,8 @@ static int ptp_ocp_ts_enable(void *priv, bool enable);
* 3: GPS * 3: GPS
* 4: GPS2 (n/c) * 4: GPS2 (n/c)
* 5: MAC * 5: MAC
* 6: SPI IMU (inertial measurement unit) * 6: N/C
* 7: I2C oscillator * 7: I2C controller
* 8: HWICAP * 8: HWICAP
* 9: SPI Flash * 9: SPI Flash
*/ */
...@@ -706,6 +706,9 @@ ptp_ocp_get_serial_number(struct ptp_ocp *bp) ...@@ -706,6 +706,9 @@ ptp_ocp_get_serial_number(struct ptp_ocp *bp)
struct device *dev; struct device *dev;
int err; int err;
if (!bp->i2c_ctrl)
return;
dev = device_find_child(&bp->i2c_ctrl->dev, NULL, ptp_ocp_firstchild); dev = device_find_child(&bp->i2c_ctrl->dev, NULL, ptp_ocp_firstchild);
if (!dev) { if (!dev) {
dev_err(&bp->pdev->dev, "Can't find I2C adapter\n"); dev_err(&bp->pdev->dev, "Can't find I2C adapter\n");
......
Markdown is supported
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