Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp273684pxj; Fri, 14 May 2021 03:10:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5fJXzd8Gj+W5OZcZrwDNmM0Lv1yqvuPXqkFKzDTsjFE/rgnsNYvBrdRCtXhMPP8dtcvlZ X-Received: by 2002:a92:c7a6:: with SMTP id f6mr39471766ilk.17.1620986999868; Fri, 14 May 2021 03:09:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620986999; cv=none; d=google.com; s=arc-20160816; b=YjVLrcT5bUxKHnnoTPG00ZOUh+uiNiiKtZ1I8RzSQT6FUiBEOltDg0iRVmEBcjQq/B OIAdQzCicmpS84cEV39qVgaCVge9Re0eKoZ+wdtmK6JbK6Zg4IyD2zKvYIlhpjSgpQBa N5Z09fPJgWRV0v1HPSE9G3oQl4XiiggSdzCjMOkv0v5YvJVkpNXIA/mnfV7nKRqGsskp RWzri9mvM5rRdAFGu7iQdD3w4KkN4o1RO3Rh0gjE4HbjoZbebTY3gl4vm5f+iLHasUwr t9qrMTQKuWuogbT4OdcXAKU999g6dWNzy5im47kU5Ig0WlL0RHD1CuTt+ljt/W9leJjl 6ZMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=rNXRtQtK9wZi25UA8GgJmoEZwOM9BVm5vmE3MRb74+M=; b=QLvHkKZQi063pkTGnl2VIkWlGknk4hnBVw0YnT700hhzCdlFe3AiD9yjcMeagjSBry klq6NWohnDwMqsda8seFVgZQlFj9ulgfLtOYsYByAe22e4ePrnci0in1SVpVte+SKC2m jyYuU/JGnTt7tBB5uz+gy7+gCj+oPSkjyeNilIXAQ8yovTKFEfmnv8vUu03oSFgqywyO 1KpLdixvdDdj8WjcE6Om9tgV1IpAUvH9LIRB5lhpsRiUY4xs4En3R2x+IwR466BG7ZJ6 0GQe120ko6kts2UIOKsDZZNK7AhESEC6f3klixizA0JaNFV3zbBTZ/j611LpGzRlx1pI mCaA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x20si6738224jao.3.2021.05.14.03.09.47; Fri, 14 May 2021 03:09:59 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233398AbhENIEr (ORCPT + 99 others); Fri, 14 May 2021 04:04:47 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:2980 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233358AbhENIEr (ORCPT ); Fri, 14 May 2021 04:04:47 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4FhLZV29kZzjMll; Fri, 14 May 2021 16:01:22 +0800 (CST) Received: from localhost (10.174.179.215) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.498.0; Fri, 14 May 2021 16:03:28 +0800 From: YueHaibing To: , , , , CC: , Subject: [PATCH v2 -next] iio: adc: ad7793: Add missing error code in ad7793_setup() Date: Fri, 14 May 2021 16:02:54 +0800 Message-ID: <20210514080254.9620-1-yuehaibing@huawei.com> X-Mailer: git-send-email 2.10.2.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.174.179.215] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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