fpga: fpga-mgr: xilinx-spi: fix error messages on -EPROBE_DEFER
authorLuca Ceresoli <luca@lucaceresoli.net>
Thu, 4 Feb 2021 12:13:13 +0000 (13:13 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 07:50:06 +0000 (09:50 +0200)
commit9c0d2c3f7f727033b62de6e60c98ff7b15cb3fb8
treee5b2df23e261356b51e86c1045ef6ed86d6e0c1f
parent305a936af4fcecdcbb6f98e17fe81e7d85b3adf6
fpga: fpga-mgr: xilinx-spi: fix error messages on -EPROBE_DEFER

[ 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 <luca@lucaceresoli.net>
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 <mdf@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/fpga/xilinx-spi.c