Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp252428ybi; Wed, 29 May 2019 20:41:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqz9YuxZPZ//4YhgbRDUmDNidgy/qe2RhSbE7ndkpuwZ6ltdygpFBrChjRp4i4Kh5y93L5/V X-Received: by 2002:a63:4509:: with SMTP id s9mr1695631pga.231.1559187705039; Wed, 29 May 2019 20:41:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559187705; cv=none; d=google.com; s=arc-20160816; b=ojAfQ/ageO+BZ4GdRFYZeqluH0UZK7iPit3hiQT8Lz9/PL5cEa6zhlmbg1oDiHZMzV s0vvU3ZIcEoajKwmq3JF+yqPX0YuO1lAp14FVGkVjjYFJlot22JhQLmB/YX02Gf+GMIb tkWrQ/UvgFLCbcErQshuykzaRb+l61Ugs+nXS0kkeuS1y5shCHBa03rIYldjEPbGkt/X cq+kk3amJsvCiuJgzmQZvo4PQhkZh8Gw2AOdIheIbSTF7TMKv5WVvqWzOLlLTAQtamby bjssznXfg/SSoT7eRKsClBIv83/YMTwzrynuEXeHHPG7ZqxwIGbb8Ti/ivVdL8tv0owt zgqA== 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=AItEsyKiMhthFslHRWhxVm3AbFyl06lDNM6R5bTJ3Lg=; b=dtuCOS4ZrHqlTAD1fRRKB6xPxkt+CL9hEGYm/qb6I7Z6zoz0SGVYyH9vt8u8rJ63LB AcfCfFZqqxwqvRKZDRrPHtUnImDHK8w3Aw/rmIU0P9H4kzxFBo1/BHDOmpUMr2Ko7hs/ VEG0cfTkb2sk5hiAJEs0cpM11ePBXrRit587jTaCGYONvKkoOkxkUDrScbxN1DAuQaAW VRFNXVeHbjO08Wjupcg8Q9PSbB0mQDleBFDfK+ZiQYgFYtwYwaXFusV98SqE8zD1hIea ZqiQtpqMjO2xKuOoZ7tUJV2gUi9dDbOUuHfqrM+JMSFkPsukbQI1GhOCxHY03F43nTsp s5nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=f8m8t1p9; 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 f8si2074178pfh.200.2019.05.29.20.41.28; Wed, 29 May 2019 20:41:45 -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=f8m8t1p9; 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 S1732739AbfE3DWO (ORCPT + 99 others); Wed, 29 May 2019 23:22:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:43216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730734AbfE3DQg (ORCPT ); Wed, 29 May 2019 23:16:36 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (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 73631245F8; Thu, 30 May 2019 03:16:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186196; bh=thiQbOlfxqJZyvdYRAbL63KGaSN2f9Fz6AwelGLDbRg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f8m8t1p9kY8H3z8V9Cnu9UdEW6UiGtZH3Wd6A45j7MnqP7/WfDRim5QG3znOUwzJu 8U1RAiRt0fc1kXy0D0Puv7NNU04t9rXWyREQuRW2ZpZOqVOrETZHPdF++jgdxh2sWe H+6ccs91LOXfD6/JIBnIUSoW4K24WlnkZzHVvkUg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fabien Dessenne , Hugues Fruchet , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.19 070/276] media: stm32-dcmi: return appropriate error codes during probe Date: Wed, 29 May 2019 20:03:48 -0700 Message-Id: <20190530030530.607146114@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030523.133519668@linuxfoundation.org> References: <20190530030523.133519668@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 b5b5a27bee5884860798ffd0f08e611a3942064b ] During probe, return the provided errors value instead of -ENODEV. This allows the driver to be deferred probed if needed. Signed-off-by: Fabien Dessenne Acked-by: Hugues Fruchet Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/stm32/stm32-dcmi.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/stm32/stm32-dcmi.c b/drivers/media/platform/stm32/stm32-dcmi.c index 721564176d8c0..100a5922d75fd 100644 --- a/drivers/media/platform/stm32/stm32-dcmi.c +++ b/drivers/media/platform/stm32/stm32-dcmi.c @@ -1645,7 +1645,7 @@ static int dcmi_probe(struct platform_device *pdev) dcmi->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL); if (IS_ERR(dcmi->rstc)) { dev_err(&pdev->dev, "Could not get reset control\n"); - return -ENODEV; + return PTR_ERR(dcmi->rstc); } /* Get bus characteristics from devicetree */ @@ -1660,7 +1660,7 @@ static int dcmi_probe(struct platform_device *pdev) of_node_put(np); if (ret) { dev_err(&pdev->dev, "Could not parse the endpoint\n"); - return -ENODEV; + return ret; } if (ep.bus_type == V4L2_MBUS_CSI2) { @@ -1673,8 +1673,9 @@ static int dcmi_probe(struct platform_device *pdev) irq = platform_get_irq(pdev, 0); if (irq <= 0) { - dev_err(&pdev->dev, "Could not get irq\n"); - return -ENODEV; + if (irq != -EPROBE_DEFER) + dev_err(&pdev->dev, "Could not get irq\n"); + return irq; } dcmi->res = platform_get_resource(pdev, IORESOURCE_MEM, 0); @@ -1694,12 +1695,13 @@ static int dcmi_probe(struct platform_device *pdev) dev_name(&pdev->dev), dcmi); if (ret) { dev_err(&pdev->dev, "Unable to request irq %d\n", irq); - return -ENODEV; + return ret; } mclk = devm_clk_get(&pdev->dev, "mclk"); if (IS_ERR(mclk)) { - dev_err(&pdev->dev, "Unable to get mclk\n"); + if (PTR_ERR(mclk) != -EPROBE_DEFER) + dev_err(&pdev->dev, "Unable to get mclk\n"); return PTR_ERR(mclk); } -- 2.20.1