From patchwork Wed Jul 1 12:04:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nuno Sa X-Patchwork-Id: 11636197 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CCC88912 for ; Wed, 1 Jul 2020 12:05:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B842220760 for ; Wed, 1 Jul 2020 12:05:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730489AbgGAMFN (ORCPT ); Wed, 1 Jul 2020 08:05:13 -0400 Received: from mx0a-00128a01.pphosted.com ([148.163.135.77]:37696 "EHLO mx0a-00128a01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730484AbgGAMFM (ORCPT ); Wed, 1 Jul 2020 08:05:12 -0400 Received: from pps.filterd (m0167089.ppops.net [127.0.0.1]) by mx0a-00128a01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 061C32A7001084; Wed, 1 Jul 2020 08:04:55 -0400 Received: from nwd2mta4.analog.com ([137.71.173.58]) by mx0a-00128a01.pphosted.com with ESMTP id 31x315me9f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Jul 2020 08:04:54 -0400 Received: from ASHBMBX8.ad.analog.com (ashbmbx8.ad.analog.com [10.64.17.5]) by nwd2mta4.analog.com (8.14.7/8.14.7) with ESMTP id 061C4rNf041943 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=FAIL); Wed, 1 Jul 2020 08:04:53 -0400 Received: from ASHBMBX9.ad.analog.com (10.64.17.10) by ASHBMBX8.ad.analog.com (10.64.17.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1779.2; Wed, 1 Jul 2020 08:04:52 -0400 Received: from zeus.spd.analog.com (10.64.82.11) by ASHBMBX9.ad.analog.com (10.64.17.10) with Microsoft SMTP Server id 15.1.1779.2 via Frontend Transport; Wed, 1 Jul 2020 08:04:52 -0400 Received: from NSA-L01.ad.analog.com (fpaumier-l01.ad.analog.com [10.32.224.81] (may be forged)) by zeus.spd.analog.com (8.15.1/8.15.1) with ESMTP id 061C4lbt020721; Wed, 1 Jul 2020 08:04:49 -0400 From: =?utf-8?q?Nuno_S=C3=A1?= To: CC: Lars-Peter Clausen , Peter Meerwald-Stadler , Hartmut Knaack , Jonathan Cameron , Michael Hennerich , Alexandru Ardelean Subject: [PATCH 2/2] iio: adc: adi-axi-adc: Remove unneeded check Date: Wed, 1 Jul 2020 14:04:42 +0200 Message-ID: <20200701120442.258-2-nuno.sa@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200701120442.258-1-nuno.sa@analog.com> References: <20200701120442.258-1-nuno.sa@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-01_08:2020-07-01,2020-07-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxlogscore=921 mlxscore=0 lowpriorityscore=0 impostorscore=0 priorityscore=1501 malwarescore=0 phishscore=0 spamscore=0 clxscore=1015 suspectscore=1 cotscore=-2147483648 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2007010089 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org Looking at the register path, there will be bigger issues if `dev` is NULL. Hence, we can drop this check and assume there's no way that `dev` can be NULL at this point. Signed-off-by: Nuno Sá --- drivers/iio/adc/adi-axi-adc.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/iio/adc/adi-axi-adc.c b/drivers/iio/adc/adi-axi-adc.c index 86b6b65916ee..e216e37e8c8c 100644 --- a/drivers/iio/adc/adi-axi-adc.c +++ b/drivers/iio/adc/adi-axi-adc.c @@ -326,9 +326,6 @@ static struct adi_axi_adc_client *adi_axi_adc_attach_client(struct device *dev) mutex_lock(®istered_clients_lock); list_for_each_entry(cl, ®istered_clients, entry) { - if (!cl->dev) - continue; - if (cl->dev->of_node != cln) continue;