From: YueHaibing <yuehaibing@huawei.com>
To: <lars@metafoo.de>, <Michael.Hennerich@analog.com>,
<jic23@kernel.org>, <yuehaibing@huawei.com>, <gregkh@suse.de>
Cc: <linux-iio@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH v2 -next] iio: adc: ad7793: Add missing error code in ad7793_setup()
Date: Fri, 14 May 2021 16:02:54 +0800 [thread overview]
Message-ID: <20210514080254.9620-1-yuehaibing@huawei.com> (raw)
Set error code while device ID query failed.
Fixes: 88bc30548aae ("IIO: ADC: New driver for AD7792/AD7793 3 Channel SPI ADC")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v2: use ENODEV instead of EINVAL
drivers/iio/adc/ad7793.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/iio/adc/ad7793.c b/drivers/iio/adc/ad7793.c
index 5e980a06258e..b4f9ac3838e1 100644
--- a/drivers/iio/adc/ad7793.c
+++ b/drivers/iio/adc/ad7793.c
@@ -279,6 +279,7 @@ static int ad7793_setup(struct iio_dev *indio_dev,
id &= AD7793_ID_MASK;
if (id != st->chip_info->id) {
+ ret = -ENODEV;
dev_err(&st->sd.spi->dev, "device ID query failed\n");
goto out;
}
--
2.17.1
next reply other threads:[~2021-05-14 8:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-14 8:02 YueHaibing [this message]
2021-05-16 9:17 ` [PATCH v2 -next] iio: adc: ad7793: Add missing error code in ad7793_setup() Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210514080254.9620-1-yuehaibing@huawei.com \
--to=yuehaibing@huawei.com \
--cc=Michael.Hennerich@analog.com \
--cc=gregkh@suse.de \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox