|
@@ -122,6 +122,7 @@ static int sun4i_mdio_probe(struct platform_device *pdev)
|
|
|
return -EPROBE_DEFER;
|
|
|
|
|
|
dev_info(&pdev->dev, "no regulator found\n");
|
|
|
+ data->regulator = NULL;
|
|
|
} else {
|
|
|
ret = regulator_enable(data->regulator);
|
|
|
if (ret)
|
|
@@ -137,7 +138,8 @@ static int sun4i_mdio_probe(struct platform_device *pdev)
|
|
|
return 0;
|
|
|
|
|
|
err_out_disable_regulator:
|
|
|
- regulator_disable(data->regulator);
|
|
|
+ if (data->regulator)
|
|
|
+ regulator_disable(data->regulator);
|
|
|
err_out_free_mdiobus:
|
|
|
mdiobus_free(bus);
|
|
|
return ret;
|