Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4081187ybi; Mon, 29 Jul 2019 18:51:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqwd/PgLktxf1IStvXU6RnnAreWzmhVUvDyM2F5djJCI7pQPHqEnzdAI4xcrH9BHSuq5TW8M X-Received: by 2002:a17:902:9004:: with SMTP id a4mr113370803plp.109.1564451461793; Mon, 29 Jul 2019 18:51:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564451461; cv=none; d=google.com; s=arc-20160816; b=dWABNFiccMEfbSp/Yg+qO6MhAjGDTRvQDsLVupUR6N8bdJbRrizgxnj3QlgebpYqkl Y7TXI2xl7324O9hfoR+EP5BjF5hzO16g2s7K2UeyFYnEvBR8ig4Y5fbyHQBOEWStT7FT /ipQ5opZKm04M7Ze2W28LOAqkZjUhFq8Sqy15ruwGiuxjU05aQLfSZapgRtQJfvZ6ul3 fPZnKHJ5bgvUi9HlmhikCHQOI+4GRz/vjYaXjQal2iOk/Is81ZO3XWYlyS2raYstup63 fZRKPoVLzlIr8w3t/wkbjD7ZDdjmJyAlTbFpfAgg6k/5wFb8jlGcQvlm+Mli4TEhFJF+ cZNA== 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=zif8xe97dEsjg6eX+ul36e7LhTRgx7in2r5qtYDnK+Q=; b=ngaYp70Xm71Z21/j7UNsgLU/HiGiPxWmA+2Jm5CcQsY7iviZl7J7bD0PVrO0GdRRmR hr2HwDpe/KK+M1IghQg9S0NYaI7RR2GMdV1ujWHh4a1HBURn9KXF7OGlOPR1u7k5CxS+ zx4ZYUR4Twr7hdC+fugG+dFUcSGtfgAxHYJXr13/wmKoFqMwyqTnuQMixWbB33KMaSwm oz/hmde/BB36igL8iGOT4HMBwuVXgxclb37tXPFeFzlZw19ck0sgtiCpL/W+Dg+KfDrW OxygBoMDdWFNhoatf1Sm98Vb19cnsdZ6mLiDro9FcOG7xF2G8LXrWsXmkB/UWLZRKJTi 5ung== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OKCaOUCV; 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 u62si26197768pjb.3.2019.07.29.18.50.46; Mon, 29 Jul 2019 18:51:01 -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=OKCaOUCV; 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 S2388877AbfG2Tkf (ORCPT + 99 others); Mon, 29 Jul 2019 15:40:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:55854 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387957AbfG2Tkb (ORCPT ); Mon, 29 Jul 2019 15:40:31 -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 6D9B62054F; Mon, 29 Jul 2019 19:40:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429230; bh=DMnLZSpJb7xil/grlPuduJQqQpp5X7vHxoIv8Tzcd6s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OKCaOUCV0GmAR+8ezFkwqjRfHi5UYwMAOUKZ6gx699C1n3Gu/pFdvk3oyXlwA5dqm ZsOZilRHTrXv71Utj1q5A8bUR5xeL2fGc8qXv/Wzta68VxkLTWTEy5jfMTQg+ZH/Sl rKjdZntnDNLpIHRPn0q69pmn0a9g8A+WoCakMAL8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fabien Dessenne , Fabrice Gasnier , Jonathan Cameron , Sasha Levin Subject: [PATCH 4.19 004/113] iio: adc: stm32-dfsdm: missing error case during probe Date: Mon, 29 Jul 2019 21:21:31 +0200 Message-Id: <20190729190656.727177684@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190655.455345569@linuxfoundation.org> References: <20190729190655.455345569@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 d2fc0156963cae8f1eec8e2dd645fbbf1e1c1c8e ] During probe, check the devm_ioremap_resource() error value. Also return the devm_clk_get() error value instead of -EINVAL. Signed-off-by: Fabien Dessenne Acked-by: Fabrice Gasnier Signed-off-by: Jonathan Cameron Signed-off-by: Sasha Levin --- drivers/iio/adc/stm32-dfsdm-core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/stm32-dfsdm-core.c b/drivers/iio/adc/stm32-dfsdm-core.c index bf089f5d6225..941630615e88 100644 --- a/drivers/iio/adc/stm32-dfsdm-core.c +++ b/drivers/iio/adc/stm32-dfsdm-core.c @@ -213,6 +213,8 @@ static int stm32_dfsdm_parse_of(struct platform_device *pdev, } priv->dfsdm.phys_base = res->start; priv->dfsdm.base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(priv->dfsdm.base)) + return PTR_ERR(priv->dfsdm.base); /* * "dfsdm" clock is mandatory for DFSDM peripheral clocking. @@ -222,8 +224,10 @@ static int stm32_dfsdm_parse_of(struct platform_device *pdev, */ priv->clk = devm_clk_get(&pdev->dev, "dfsdm"); if (IS_ERR(priv->clk)) { - dev_err(&pdev->dev, "No stm32_dfsdm_clk clock found\n"); - return -EINVAL; + ret = PTR_ERR(priv->clk); + if (ret != -EPROBE_DEFER) + dev_err(&pdev->dev, "Failed to get clock (%d)\n", ret); + return ret; } priv->aclk = devm_clk_get(&pdev->dev, "audio"); -- 2.20.1