Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3810530ybi; Mon, 29 Jul 2019 13:04:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqxBnqw/0SsBcVrJb+yApZAkqATcAVpJTecttiZpstu73ctedBHHSIjneP9eYB03lp1k7cET X-Received: by 2002:aa7:9254:: with SMTP id 20mr39611755pfp.212.1564430698406; Mon, 29 Jul 2019 13:04:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564430698; cv=none; d=google.com; s=arc-20160816; b=LmIdQ8oBLX0pBTPE018ZpULdJg6yu3TKip/vdAkn0wYTGSeuEvZqoJiRFOT7WhM/qt 3OIwnvUu3BY3ohuRz/WfDYjoD04ib2KokpbtPrL7UKSwwKUw5bq5xCcDlyRARbDGGxBQ FXDwUb89YkySETJlt3SCW8WgU3QlVKICstrhfW3CaQEiJDh34q9ynNpObcq09Ax0clej nCelEFPD9Gbd/hugBEd6OUCdwke2zUHfRDoLr+5Vp9Zh/YgB8oIzD5eeD1PgtZbNOyc+ xxzG+PC72ijB34FWTNS80jqXK5DgJ5G8E0LWW3w9ehyWM7k3HTwTEFAcsFz0Gb1vZVNn oSRw== 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=ZyxDC+couX+upEHxyGXUwBZNnZpY4JHs0jnGnp4xLuY=; b=v+yieoQ0997X1EFRjc8uzct8baQ3asBxullUewPyQB3aJ/okn/irq49YCZ8CBgclNS Ww/Mhm12Y4cOPralGlc8RVolWVISbxkv5sy5XMZD1IxyKMmKkFzHBI/bZs9IKAd/c6M4 KZ6xsiERx8t4vBf4VOXN7r2fUzC136th3wFeHKpX0/qbbAG24aMH1lblduu9PBSIb85v URcp6xFurbOpetqbSvvzTjEV+Kvty/5JY+cXN3cC0pR2JG3aR+JoBm5OLlJc6DH3civq sxKvE4W3E1vYa9OwnEMnG6PXcNokF0T7uy76wR9Y5hTiQtHj31KPe+ETv0E2ig5/VSTy p0ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yiWgXPpk; 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 v63si232317pgd.111.2019.07.29.13.04.43; Mon, 29 Jul 2019 13:04:58 -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=yiWgXPpk; 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 S2389169AbfG2Tql (ORCPT + 99 others); Mon, 29 Jul 2019 15:46:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:35968 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390200AbfG2Tqi (ORCPT ); Mon, 29 Jul 2019 15:46:38 -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 823E2217D7; Mon, 29 Jul 2019 19:46:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429597; bh=mWccI4xWigLd6uiRvL/JVMP3itla6nFDg60Gd8TVgGI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yiWgXPpkdm959RTb9kozg5kB6Te5hTVupxQ+R40ffCsLyyT5mzSgFdeE6rgg+LtmN F3rPXT3MSB/FSZTse/Kwqieaup8X6WnNu8Azi5Lig6GqUO0joxmMessaBJPobOI3mN 8dL00klMfYH3fMXXt2EEsmcuTKQszcFVc7zw8TIc= 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 5.2 007/215] iio: adc: stm32-dfsdm: missing error case during probe Date: Mon, 29 Jul 2019 21:20:03 +0200 Message-Id: <20190729190740.935777268@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@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 0a4d3746d21c..26e2011c5868 100644 --- a/drivers/iio/adc/stm32-dfsdm-core.c +++ b/drivers/iio/adc/stm32-dfsdm-core.c @@ -233,6 +233,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. @@ -242,8 +244,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