Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2681648imj; Mon, 11 Feb 2019 06:58:37 -0800 (PST) X-Google-Smtp-Source: AHgI3IY9OYW5CeN4WoAlCuHYIjez/UvaT1tA2g9pswIPY13F9xBsHhP1mJLW/5ld9jHLPw+6l7tu X-Received: by 2002:a63:d810:: with SMTP id b16mr28528669pgh.220.1549897116947; Mon, 11 Feb 2019 06:58:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549897116; cv=none; d=google.com; s=arc-20160816; b=UHDWvx7eyhSfbFijr0lT480lEIsfbrFqIgKxKsJ+/ZlmhhBBqiNG5OuOVhfFR5w2EY eOWVVH/AuCMxlXSg3QLQhBoUxbKP0wJrolSLDcJd7DjR9nZqss+zcI7WKOsM8IvJ4BHH P7Fs3HCG4ar1a56sunOCxlG6SA33EZFxorgNdkLOycNNxnVf+gvRoPpB9UvlTx2/50mA gr3a4uqd2R44QkTlQFGAzKhqkGmS7CjYx6319QsbYRNIddD9uX6A6Y9iXhX8RgX7b7be fwzv+uO65Gi+VR1e7Ohrev2DuN2H2hqSB/mYBD2WzXqT/6eeiE40Ut/4sp1hopU7V1e1 Qm/Q== 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=oxFvUANJ2qwrY08NtIHyJULahXzDcZPDoQp87iQfbsY=; b=VtXDCdnKwJWKHYCtR7d88ioBEY6RQdEXlKcXLroVXCMhlEsQMlSf5cKEm1yJGKU5kw n0sKQ2ykkZzL6Qo0BdyjHRvH4+BbWg+8AoNXwTYVJOVpdMNfwKI8M0sXqdHu7MfS5AGX RL+Bum3cuVHKREHvSssFbR9pl6Y7d0OW/0CIGSSWVwEznonO3wJciwXX+Ad4JjmP6PY8 zL68ZRZB5xX+tHifvtWy2hlcTMFUyZvwElEbATlj41kRESlc6NZQewumthuf+6MXdlh2 IlLzQRHpd09EiqVm3RVjX5b/R/THeGmjKHxAckTEyWGfwZVXISk8sby0AZhEgHVbyhak 7rjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vnTTaeAv; 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 j6si4926087pfc.57.2019.02.11.06.58.20; Mon, 11 Feb 2019 06:58:36 -0800 (PST) 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=vnTTaeAv; 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 S2389164AbfBKO4X (ORCPT + 99 others); Mon, 11 Feb 2019 09:56:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:43542 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389155AbfBKO4V (ORCPT ); Mon, 11 Feb 2019 09:56:21 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 E82E12229E; Mon, 11 Feb 2019 14:56:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549896980; bh=4tDVT+EyQzS8QX60BG0z1CecYjs/ut2J5FFnD8aBKx4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vnTTaeAvA15UZ3KE7e8lYidF0EDS520ErZwoMj+bqYm9kajR1L46VPF60Fl1z0dEu EcniyDPea7JWtFkQk5amRloeaNP5IsBDhBmTfuKu6F84fdx86ITGIRUDMFTtWVQqcV YZNYa5VQnIpDfESkTSsJ1sd6wbbj1Iyol+z1E1Ns= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Matheus Tavares , Jonathan Cameron , Sasha Levin Subject: [PATCH 4.14 021/205] staging:iio:ad2s90: Make probe handle spi_setup failure Date: Mon, 11 Feb 2019 15:16:59 +0100 Message-Id: <20190211141828.520585065@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit b3a3eafeef769c6982e15f83631dcbf8d1794efb ] Previously, ad2s90_probe ignored the return code from spi_setup, not handling its possible failure. This patch makes ad2s90_probe check if the code is an error code and, if so, do the following: - Call dev_err with an appropriate error message. - Return the spi_setup's error code. Note: The 'return ret' statement could be out of the 'if' block, but this whole block will be moved up in the function in the patch: 'staging:iio:ad2s90: Move device registration to the end of probe'. Signed-off-by: Matheus Tavares Signed-off-by: Jonathan Cameron Signed-off-by: Sasha Levin --- drivers/staging/iio/resolver/ad2s90.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/staging/iio/resolver/ad2s90.c b/drivers/staging/iio/resolver/ad2s90.c index b2270908f26f..cbee9ad00f0d 100644 --- a/drivers/staging/iio/resolver/ad2s90.c +++ b/drivers/staging/iio/resolver/ad2s90.c @@ -86,7 +86,12 @@ static int ad2s90_probe(struct spi_device *spi) /* need 600ns between CS and the first falling edge of SCLK */ spi->max_speed_hz = 830000; spi->mode = SPI_MODE_3; - spi_setup(spi); + ret = spi_setup(spi); + + if (ret < 0) { + dev_err(&spi->dev, "spi_setup failed!\n"); + return ret; + } return 0; } -- 2.19.1