diff mbox

[v1.1,3/5] smiapp: Return -EPROBE_DEFER if the clock cannot be obtained

Message ID 1472648277-25888-1-git-send-email-sakari.ailus@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Sakari Ailus Aug. 31, 2016, 12:57 p.m. UTC
The clock may be provided by a driver which is yet to probe. Print the
actual error code as well.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
since v1:
- Add printing of the original error code

 drivers/media/i2c/smiapp/smiapp-core.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Sebastian Reichel Aug. 31, 2016, 1:57 p.m. UTC | #1
Hi,

On Wed, Aug 31, 2016 at 03:57:57PM +0300, Sakari Ailus wrote:
> The clock may be provided by a driver which is yet to probe. Print the
> actual error code as well.
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
>
> ---
> since v1:
> - Add printing of the original error code

Reviewed-By: Sebastian Reichel <sre@kernel.org>
diff mbox

Patch

diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c
index 92a6859..103e335 100644
--- a/drivers/media/i2c/smiapp/smiapp-core.c
+++ b/drivers/media/i2c/smiapp/smiapp-core.c
@@ -2557,8 +2557,9 @@  static int smiapp_init(struct smiapp_sensor *sensor)
 	if (!sensor->hwcfg->set_xclk) {
 		sensor->ext_clk = devm_clk_get(&client->dev, NULL);
 		if (IS_ERR(sensor->ext_clk)) {
-			dev_err(&client->dev, "could not get clock\n");
-			return PTR_ERR(sensor->ext_clk);
+			dev_err(&client->dev, "could not get clock (%ld)\n",
+				PTR_ERR(sensor->ext_clk));
+			return -EPROBE_DEFER;
 		}
 
 		rval = clk_set_rate(sensor->ext_clk,