diff options
author | YueHaibing <yuehaibing@huawei.com> | 2020-10-31 11:30:42 +0800 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-11-02 15:53:26 +0000 |
commit | a9c52d42814a44472fe1205775320ec20f556908 (patch) | |
tree | 1c1f75be9c9b8fd6b06af73123f8ab349d40931c /drivers/spi/spi-mem.c | |
parent | ee5558a9084584015c8754ffd029ce14a5827fa8 (diff) | |
download | linux-a9c52d42814a44472fe1205775320ec20f556908.tar.bz2 |
spi: spi-mem: Fix passing zero to 'PTR_ERR' warning
Fix smatch warning:
drivers/spi/spi-mem.c:746 spi_mem_probe() warn: passing zero to 'PTR_ERR'
Fixes: 5d27a9c8ea9e ("spi: spi-mem: Extend the SPI mem interface to set a custom memory name")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20201031033042.42892-1-yuehaibing@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-mem.c')
-rw-r--r-- | drivers/spi/spi-mem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c index ef53290b7d24..a1b4d085834a 100644 --- a/drivers/spi/spi-mem.c +++ b/drivers/spi/spi-mem.c @@ -743,7 +743,7 @@ static int spi_mem_probe(struct spi_device *spi) mem->name = dev_name(&spi->dev); if (IS_ERR_OR_NULL(mem->name)) - return PTR_ERR(mem->name); + return PTR_ERR_OR_ZERO(mem->name); spi_set_drvdata(spi, mem); |