From patchwork Sun Aug 27 16:30:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 9923943 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8018560329 for ; Sun, 27 Aug 2017 16:31:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6772E28633 for ; Sun, 27 Aug 2017 16:31:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C4B42863D; Sun, 27 Aug 2017 16:31:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 684D328633 for ; Sun, 27 Aug 2017 16:31:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751240AbdH0QbA (ORCPT ); Sun, 27 Aug 2017 12:31:00 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:33730 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751182AbdH0QbA (ORCPT ); Sun, 27 Aug 2017 12:31:00 -0400 Received: by mail-qk0-f195.google.com with SMTP id i69so2322893qkh.0 for ; Sun, 27 Aug 2017 09:31:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=keyhLpEz9KWyAR4SCPyoJ/25VxqEtfRSCWtLuP4zbRk=; b=MVbj4xI2dPl2FDdJGY8AjMBAzN8D826OI8s67zXcB4i6L5MHITHmKqlgwikdtmEAQL iLlcy8+w9wkQ8PiceYhwKxL7NIx4htdVy8XRb2xhdSgl75DnacRy7ZDBWcFL8H4rzv6W vynSlLhckeGQgizSf6GmrKDWnE6mUCgl/jeVOu9VeBjr0yxmCy3cOpFTIIn9ucYmhB+M KlNCaWDGOBJCsGDUPUvPoqVCwGi9JRJZYlHzDXFSjB29gJoau4W5QjOYw9eY1z5JLU1Z llBUH0Sf7PJ2Xg27f8T1IlO0Rr3sHaFbkplx7yUdG/KvgQQ1B5LfUQDI1YUsyhuo5TJx mcNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=keyhLpEz9KWyAR4SCPyoJ/25VxqEtfRSCWtLuP4zbRk=; b=Y2fUpYkLjeFMuSqCCoaYAem0/5XPLp0ccY/ttXojPmcRY/938KoQY0sM8rG33+q8qr gzgYOmGGp5AcuYYyRLQLZiFlqc9ZkD4n1QOPbyS3rGK8DBtg109OWg0mezqoXJYplthv pKXNNjQKP3W2fmcT+JAgcwEUbuvtk+z7BFrI78XuT0/4S5snAH4tIseIe7tSEcqVLJ/H 85+2GvlwFK7umQ0/gksu1ZJ25ouS5cYMoVdM1Ub+4KfxUKKWJLqQZKBomwARK0aOj9NA NjYnvZNbjx7DCz7swenxhhzgYO1iBJdr4giQ4LktalLmP9d3NHHqpYA+PPd5sUoTwkVU dffw== X-Gm-Message-State: AHYfb5gLXKV0/B+07XTC9ZtkeGOB3t6xW1OLCi1ipDF/foXR4d6RKSMZ qARXtFGnR1BHbA== X-Received: by 10.233.222.69 with SMTP id s66mr6400685qkf.30.1503851459427; Sun, 27 Aug 2017 09:30:59 -0700 (PDT) Received: from localhost.localdomain ([187.180.183.214]) by smtp.gmail.com with ESMTPSA id f187sm6952640qkb.97.2017.08.27.09.30.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 27 Aug 2017 09:30:58 -0700 (PDT) From: Fabio Estevam To: mchehab@kernel.org Cc: hans.verkuil@cisco.com, sakari.ailus@linux.intel.com, linux-media@vger.kernel.org, Fabio Estevam Subject: [PATCH 1/4] [media] max2175: Propagate the real error on devm_clk_get() failure Date: Sun, 27 Aug 2017 13:30:35 -0300 Message-Id: <1503851438-4949-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam When devm_clk_get() fails we should return the real error code instead of always returning -ENODEV. This allows defer probe to happen in the case the clock provider has not been enabled by the time max2175 driver gets probed. Signed-off-by: Fabio Estevam --- drivers/media/i2c/max2175.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/i2c/max2175.c b/drivers/media/i2c/max2175.c index a4736a8..bf0e821 100644 --- a/drivers/media/i2c/max2175.c +++ b/drivers/media/i2c/max2175.c @@ -1319,7 +1319,7 @@ static int max2175_probe(struct i2c_client *client, if (IS_ERR(clk)) { ret = PTR_ERR(clk); dev_err(&client->dev, "cannot get clock %d\n", ret); - return -ENODEV; + return ret; } regmap = devm_regmap_init_i2c(client, &max2175_regmap_config);