Commit a5df3771 authored by Martin Kepplinger's avatar Martin Kepplinger
Browse files

hi846: improve error output with errno values

parent eb2f049c
......@@ -1206,20 +1206,23 @@ static int __maybe_unused hi846_resume(struct device *dev)
ret = hi846_regulator_enable(hi846);
if (ret) {
dev_err(dev, "enable regulator failed\n");
dev_err(dev, "enable regulator failed: %d\n", ret);
return ret;
}
ret = clk_prepare_enable(hi846->clock);
if (ret < 0)
if (ret < 0) {
dev_err(dev, "enable clk failed: %d\n", ret);
goto error_regulator;
}
msleep(100);
if (hi846->streaming) {
ret = hi846_start_streaming(hi846);
if (ret) {
dev_err(dev, "%s: start streaming failed\n", __func__);
dev_err(dev, "%s: start streaming failed: %d\n",
__func__, ret);
goto error;
}
}
......@@ -1228,7 +1231,6 @@ static int __maybe_unused hi846_resume(struct device *dev)
error:
hi846_stop_streaming(hi846);
dev_err(dev, "%s: stopped streaming\n", __func__);
hi846->streaming = 0;
error_regulator:
......@@ -1460,7 +1462,8 @@ static int hi846_parse_gpios(struct hi846_gpio *gpios, struct device *dev)
for (i = 0; i < NUM_GPIOS; ++i) {
ret = of_get_named_gpio_flags(node, names[i], 0, &flags);
if (ret < 0) {
dev_err(dev, "no %s GPIO pin provided\n", names[i]);
dev_err(dev, "no %s GPIO pin provided: %d\n", names[i],
ret);
return ret;
}
gpios[i].gpio = ret;
......@@ -1623,7 +1626,7 @@ static int hi846_probe(struct i2c_client *client)
ret = hi846_parse_gpios(hi846->gpios, &client->dev);
if (ret < 0) {
dev_err(&client->dev, "parse gpios failed\n");
dev_err(&client->dev, "parse gpios failed: %d\n", ret);
return ret;
}
......
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