Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4591253pxj; Wed, 12 May 2021 08:50:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHvtMmelx41YBTV1exgaGU1KgZEnd29taIiF9rq+XsRdgrPpYb42Q6mmQQ8bPqwj1QuqdV X-Received: by 2002:a9d:7a92:: with SMTP id l18mr19069914otn.355.1620834613519; Wed, 12 May 2021 08:50:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620834613; cv=none; d=google.com; s=arc-20160816; b=ABiqbyiwE/GWvqSBlKhgif3Ze5+UKLePo9gqIitIgQNWOy14P+vgOcyPd90hiMOLbB hb7ZjfWwf59Z5jzE6WsEBKWkeo6KiTq0+J2DI6faSkMK36rC4+0iuB2f8F0ILOLTzAeR Q+vE8wGaSbpKcdBN9m+dF8BBYQiepRv5OSeF6DyuqJ1UQsC41DIJcSxmW/+pVhTu6e2y eca0gkF8FhHkC+rcucKlDsr1xsiLzunYMIDDWGNHaSATkK421T6btvJ3FkRIIW3ov96p XuiGdAe6FyP+l5WFZ7oHXaTo/KX3t6v9kXQFs6XfWp+QGnYEkLWCOfEHWhJKpm4EPmYd 7DfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Oq+DWu7J7Z09xdTFcq85CEdPIqBSxx70ogWvdIZt7YA=; b=fDuJN9i0iq/YGc3U8YKJ26qxLrzW7s6hpKAJMBc1Ms+1rterwpprQ0rF1r2rDyBKOB MvoUty6bKs7Azz4dTsJBEYebpQndbd/Dd8hpiT+jdPkbFnihuzVvpqwvh5zXSaGZT+kK N4RcpgIm9bZsKT8plcnMdBo5+i199R+s7aQChZBnK3YwD64mn2xalbMPUTz2uf+AFqso aJ9KZYA9mlpudKLGx7cjVb4mJYV3AikpFhbz1IEjpJ+BxqdGRbqyV6UuPFH5MOR95/Gp EcQ4N/Quzk1heiDmvP8YMHC+fKe7Yp1oMqK3Zo3Px7UUaiYqSRkMTqjM678HHCv23j0P qrCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kBxlCw6k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o16si274646oie.220.2021.05.12.08.49.58; Wed, 12 May 2021 08:50:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kBxlCw6k; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236767AbhELPqI (ORCPT + 99 others); Wed, 12 May 2021 11:46:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:60804 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234715AbhELPUc (ORCPT ); Wed, 12 May 2021 11:20:32 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DE10D6199E; Wed, 12 May 2021 15:08:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832116; bh=aavuMoAmsTtU9NsiQA63lzinfEBT2PLkjb9/vgJa9jA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kBxlCw6k26eULBAIfUKJV/098xaIgk1tbYfkE3/z6YXhqxfoJFnBdEBr5pRj/YIMb XHLPsjPfuOoaFFoP1dbbpgxr0b8vnB4t5gZpGXT2kxQgr/yPtdFX3kYynPpxxh3Lg5 RPoKVJ7SqzgxmkApwtJ+jB1ptUVN3aO0olUveYHg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Luca Ceresoli , Moritz Fischer , Sasha Levin Subject: [PATCH 5.10 114/530] fpga: fpga-mgr: xilinx-spi: fix error messages on -EPROBE_DEFER Date: Wed, 12 May 2021 16:43:44 +0200 Message-Id: <20210512144823.544030771@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Luca Ceresoli [ Upstream commit 484a58607a808c3721917f5ca5fba7eff809e4df ] The current code produces an error message on devm_gpiod_get() errors even when the error is -EPROBE_DEFER, which should be silent. This has been observed producing a significant amount of messages like: xlnx-slave-spi spi1.1: Failed to get PROGRAM_B gpio: -517 Fix and simplify code by using the dev_err_probe() helper function. Signed-off-by: Luca Ceresoli Fixes: dd2784c01d93 ("fpga manager: xilinx-spi: check INIT_B pin during write_init") Fixes: 061c97d13f1a ("fpga manager: Add Xilinx slave serial SPI driver") Signed-off-by: Moritz Fischer Signed-off-by: Sasha Levin --- drivers/fpga/xilinx-spi.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/drivers/fpga/xilinx-spi.c b/drivers/fpga/xilinx-spi.c index 824abbbd631e..d3e6f41e78bf 100644 --- a/drivers/fpga/xilinx-spi.c +++ b/drivers/fpga/xilinx-spi.c @@ -233,25 +233,19 @@ static int xilinx_spi_probe(struct spi_device *spi) /* PROGRAM_B is active low */ conf->prog_b = devm_gpiod_get(&spi->dev, "prog_b", GPIOD_OUT_LOW); - if (IS_ERR(conf->prog_b)) { - dev_err(&spi->dev, "Failed to get PROGRAM_B gpio: %ld\n", - PTR_ERR(conf->prog_b)); - return PTR_ERR(conf->prog_b); - } + if (IS_ERR(conf->prog_b)) + return dev_err_probe(&spi->dev, PTR_ERR(conf->prog_b), + "Failed to get PROGRAM_B gpio\n"); conf->init_b = devm_gpiod_get_optional(&spi->dev, "init-b", GPIOD_IN); - if (IS_ERR(conf->init_b)) { - dev_err(&spi->dev, "Failed to get INIT_B gpio: %ld\n", - PTR_ERR(conf->init_b)); - return PTR_ERR(conf->init_b); - } + if (IS_ERR(conf->init_b)) + return dev_err_probe(&spi->dev, PTR_ERR(conf->init_b), + "Failed to get INIT_B gpio\n"); conf->done = devm_gpiod_get(&spi->dev, "done", GPIOD_IN); - if (IS_ERR(conf->done)) { - dev_err(&spi->dev, "Failed to get DONE gpio: %ld\n", - PTR_ERR(conf->done)); - return PTR_ERR(conf->done); - } + if (IS_ERR(conf->done)) + return dev_err_probe(&spi->dev, PTR_ERR(conf->done), + "Failed to get DONE gpio\n"); mgr = devm_fpga_mgr_create(&spi->dev, "Xilinx Slave Serial FPGA Manager", -- 2.30.2