Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10117695ybi; Wed, 24 Jul 2019 16:23:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqyW014y+zWXV16ob3MlRnUOZt+m4vZojS1qlc4nIYoCsjAuaUTV2kBPBb8Ao8Rjy9a0ivYt X-Received: by 2002:a63:490a:: with SMTP id w10mr82217295pga.6.1564010632823; Wed, 24 Jul 2019 16:23:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564010632; cv=none; d=google.com; s=arc-20160816; b=Hf88j1eKZEt72sx2Rn+58uUOFV/dMRN+8c6utk4ZfbBHXizUkQ40LlM5+M1f6Z4Ol4 1ZAzzFN8TbOzceDEClk4doSX9QIERxY7tdM+LLJnTYleQ8BOf4M5SCoSJeZhjCIDg25S KDFZOIAohvIWboWGBUUkb3EvinvYPMos3oC9/Qr7WUKz5JFVyFkNszFkEhv77H1Imwt6 KYUfO5WdC6wyV9cFXxAGmKLJVGS9Lv7Xi+Z0kYp2nisAbbqjlbaT3lNgmFOTDVWRIzX6 tiLy1Hp4VkvRX4TNh7t4oRC1NRE6vqDgKDVfEEsk6yhdAKPdneUVwJ/gTtHKmpEGJ7oC T5cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yR3gLaNEBWKTwz/32a2/RM8Npd5CIyoIRgSIrU2OqmE=; b=bbhWHHsCcFKFM3Yff7i+rVkxSJdAzD3uIQvW8k+Y/num7LX2lONZ5UdV71dId77b56 vZhXpGcxXyPpYl9weJTi3R4314E/9tAgdl0/Rq0wdGlfMDVjlHJ/Hja1qJF7X8ppfX+h 9lDhgrdlpUwali4aRDGtvLNnxc0F7+Vty1EXLQMjTuqOOHwQH+TwtNqp4tr6zjNuudYP RSUitTdA1xbc3wGDOBljzln9ekghuUaUuJ2g9dalwDAWAJkFRgQZLsEBbFRCJibXwHDo IfbxZ24O1LZtpWAoFvm+fKND4SZdjwXRaaWJW1hou6CmAVYuPErluVweBghd4eNDalBO gGDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bSyzWraM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q10si13651539pls.42.2019.07.24.16.23.33; Wed, 24 Jul 2019 16:23:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bSyzWraM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728100AbfGXTZ4 (ORCPT + 99 others); Wed, 24 Jul 2019 15:25:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:42736 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729205AbfGXTZv (ORCPT ); Wed, 24 Jul 2019 15:25:51 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0362622387; Wed, 24 Jul 2019 19:25:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996350; bh=m33R6dhHb2VmmyzYBxUc5e1BtHoU4ndX6Brej0xYZtU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bSyzWraMCquUJUifG44TtAVrQT82SWW7ma8bo9tKyl86eERFuY+Oc4n+s69zU8VPO JKSSdhjG0UYRlZIy2gDEuVvUmhHNxzBoJJFeYyzk2w0WOavFnOXZensjvklOANX+yg o54uvpvy6O/K58PzSII4XOLWwJbnv6kJrSsGdPRI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fabio Estevam , Rui Miguel Silva , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.2 065/413] media: imx7-mipi-csis: Propagate the error if clock enabling fails Date: Wed, 24 Jul 2019 21:15:56 +0200 Message-Id: <20190724191739.849499604@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 2b393f91c651c16d5c09f5c7aa689e58a79df34e ] Currently the return value from clk_bulk_prepare_enable() is checked, but it is not propagate it in the case of failure. Fix it and also move the error message to the caller of mipi_csis_clk_enable(). Signed-off-by: Fabio Estevam Reviewed-by: Rui Miguel Silva Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/staging/media/imx/imx7-mipi-csis.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c index 19455f425416..7d7bdfdd852a 100644 --- a/drivers/staging/media/imx/imx7-mipi-csis.c +++ b/drivers/staging/media/imx/imx7-mipi-csis.c @@ -456,13 +456,9 @@ static void mipi_csis_set_params(struct csi_state *state) MIPI_CSIS_CMN_CTRL_UPDATE_SHADOW_CTRL); } -static void mipi_csis_clk_enable(struct csi_state *state) +static int mipi_csis_clk_enable(struct csi_state *state) { - int ret; - - ret = clk_bulk_prepare_enable(state->num_clks, state->clks); - if (ret < 0) - dev_err(state->dev, "failed to enable clocks\n"); + return clk_bulk_prepare_enable(state->num_clks, state->clks); } static void mipi_csis_clk_disable(struct csi_state *state) @@ -973,7 +969,11 @@ static int mipi_csis_probe(struct platform_device *pdev) if (ret < 0) return ret; - mipi_csis_clk_enable(state); + ret = mipi_csis_clk_enable(state); + if (ret < 0) { + dev_err(state->dev, "failed to enable clocks: %d\n", ret); + return ret; + } ret = devm_request_irq(dev, state->irq, mipi_csis_irq_handler, 0, dev_name(dev), state); -- 2.20.1