Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3540837pxj; Tue, 11 May 2021 06:50:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKCuJhuchh9tIYa+GlLpCfIBGCzHgPITukswgutX4sDRiw8ehb5dS5GBy8Ot9jXmSuY8Al X-Received: by 2002:a17:906:ce42:: with SMTP id se2mr2568449ejb.359.1620741033923; Tue, 11 May 2021 06:50:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620741033; cv=none; d=google.com; s=arc-20160816; b=rIMaTy0W7VrQkyjM1Fkvx6ozHZIgyQm7JA+CzNhczZSdu6CbbCfA6j4rMwqHvKQFlm tOyM+l1C4IYQCl+jaTiPRdY2tC8tmu1P8O0cafpvrmUV+bsLpFQkzrH17zZi5zNrcBTD 4Gf4cNjy33yJUAOyKhuXYgm8UAReMQg+dA9FougANYOtkUoP+kzqpnd0Dj2/AI/r4GYe lhf6lQos1C1DMn37Hap6wHiZZONAADDolgXEM58uT2pkxSMjVQYuT23BdY0ttu6+r9k1 cXhtLKlDn438TcUhFcjlJUaJRQD6aY8oiTbOK+urEq6jmg/KFmm+Yay9cGmXM+zV9+pN hcvQ== 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 :message-id:date:subject:cc:to:from; bh=ZidNzTy4NLaNA94oOueF0hVGTBA1VZZ+xF+V1kzVzw4=; b=njp8iY6OAIgyoG72FMcmrjF6pLj7fRwBswZsZk1Qroq08/brfbcIu7KwMOmG+/6UpM vS+42O/Sc1iSTqqWheMjjB7emDeeNBdQBWPiUvt9jPcovrUxKpyVH2BcgVoaHPzyB21J QEwKlO6fLWytb7GXylB/JmBNVtIXPzgbE92L57Csk/fFsorMJqByDpPlGONxq7FCv93l 6NQKhJZNEgy3TNbWONlyzEjG9OBaWdt+a9tYUJ4ewAUBJEtFR4D4IslL0+aN3nta/w6m 1RJWUCnpFcIv+u0BtQdannOZii5f1xKbXbtBZFbxYm5Hj6DhfcL/vj34zqQq4ReLGVM7 3znQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cf10si486406ejb.342.2021.05.11.06.50.07; Tue, 11 May 2021 06:50:33 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231517AbhEKNsG (ORCPT + 99 others); Tue, 11 May 2021 09:48:06 -0400 Received: from cmccmta2.chinamobile.com ([221.176.66.80]:25452 "EHLO cmccmta2.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231426AbhEKNsG (ORCPT ); Tue, 11 May 2021 09:48:06 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.1]) by rmmx-syy-dmz-app08-12008 (RichMail) with SMTP id 2ee8609a8ac6833-09181; Tue, 11 May 2021 21:46:46 +0800 (CST) X-RM-TRANSID: 2ee8609a8ac6833-09181 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[112.22.251.112]) by rmsmtp-syy-appsvr01-12001 (RichMail) with SMTP id 2ee1609a8ac0e2d-e1ea2; Tue, 11 May 2021 21:46:46 +0800 (CST) X-RM-TRANSID: 2ee1609a8ac0e2d-e1ea2 From: Tang Bin To: lars@metafoo.de, Michael.Hennerich@analog.com, jic23@kernel.org, knaack.h@gmx.de, pmeerw@pmeerw.net Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Tang Bin , Zhang Shengju Subject: [PATCH] iio:adc:ad7766: Fix unnecessary check in ad7766_probe() Date: Tue, 11 May 2021 21:47:39 +0800 Message-Id: <20210511134739.948-1-tangbin@cmss.chinamobile.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the function ad7766_probe(), the return value of devm_iio_device_register() can be zero or ret, Thus it is unnecessary to repeated check here. Signed-off-by: Zhang Shengju Signed-off-by: Tang Bin --- drivers/iio/adc/ad7766.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/iio/adc/ad7766.c b/drivers/iio/adc/ad7766.c index b6b6765be..acf56e987 100644 --- a/drivers/iio/adc/ad7766.c +++ b/drivers/iio/adc/ad7766.c @@ -291,10 +291,7 @@ static int ad7766_probe(struct spi_device *spi) if (ret) return ret; - ret = devm_iio_device_register(&spi->dev, indio_dev); - if (ret) - return ret; - return 0; + return devm_iio_device_register(&spi->dev, indio_dev); } static const struct spi_device_id ad7766_id[] = { -- 2.20.1.windows.1