Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp458525imu; Tue, 22 Jan 2019 23:08:03 -0800 (PST) X-Google-Smtp-Source: ALg8bN56AfJJX84Ta9x58vU+KviRD02O4RgcBesuosBX120TSQqynNduR8zivUcJIJSDWZQ6SMDI X-Received: by 2002:a17:902:82c2:: with SMTP id u2mr1129492plz.110.1548227283481; Tue, 22 Jan 2019 23:08:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548227283; cv=none; d=google.com; s=arc-20160816; b=VZ1b8h0cWaXtQkmG9VnnLrmiWJ/z3EuSiovHR0XPCYWYAeGay8nDfAfwAbkD2atWr6 p5Otx1XAzBGgsSRH/L5PwDGKi9EYn5mqyimX0qf/ik5Mg9h+TUndN0WodPAAJdNGovVw exAmepMnqOs28neK3300KTd6yOCGxOYSDozEUTM4XDC2Ij8ewUcXPCwBhDNxixEyuTh+ bq9XUO5GqsY7tqeCQ6HfzCjzsdqevvpuvINIdLk168FOxUhPAZpOGgbOdT8nknrwZEj7 t00T/Uhsb0rtPG0VETHySSYvbssCCU55EwduK0PqgFIRxyPa8EomaVxMumfQ05ZkJZPv lZHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=HAt9xNEC45tuaobzMwKyj9cxee7WYGrj2NvLVJRrPJw=; b=smcwB7APXv3rcMGptkf2gzk1gIcjkehfeRGp79xQCMiINgmtaiIQxNF43SNod1QJBF c+pe4z0fXl7sGXZ/LIN8dex+wEMcdSjaP6CG2KLmYLjNJPWAyPQsRTAlrULYEqU2Mhmz ThklzvCGOZTpQ/OmjpZKYonM8a6HOlg8ENurld1UTNm6zc9xoXu7B+LGqBbZD1eFfy0i JbT/+Rkp7lDJJ9UruVeSpjCIp0JFiGqJAohjXLEypbQdOcZ2oQVSd5NQGjGGddOHIOxM pcqKU0gJob8aWp/OYfx0Znuvkk9472Jz6uKDHTkN94d+0+uuDdcHdIFl7fSxP7XMkqbd 8i9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y7si16285282pga.296.2019.01.22.23.07.47; Tue, 22 Jan 2019 23:08:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726823AbfAWHFm (ORCPT + 99 others); Wed, 23 Jan 2019 02:05:42 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:44624 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726218AbfAWHFl (ORCPT ); Wed, 23 Jan 2019 02:05:41 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 4D4B23E0A192102F5E74; Wed, 23 Jan 2019 15:05:39 +0800 (CST) Received: from localhost (10.177.31.96) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.408.0; Wed, 23 Jan 2019 15:05:31 +0800 From: YueHaibing To: , , , , , , CC: , , , , YueHaibing Subject: [PATCH -next] spi: bcm2835aux: remove unneeded NULL check of devm_clk_get Date: Wed, 23 Jan 2019 15:05:07 +0800 Message-ID: <20190123070507.15404-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.177.31.96] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix a static code checker warning: drivers/spi/spi-bcm2835aux.c:460 bcm2835aux_spi_probe() warn: passing zero to 'PTR_ERR' In case of error, the function devm_clk_get() returns ERR_PTR() and not returns NULL. Signed-off-by: YueHaibing --- drivers/spi/spi-bcm2835aux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-bcm2835aux.c b/drivers/spi/spi-bcm2835aux.c index 671e374..f7e0548 100644 --- a/drivers/spi/spi-bcm2835aux.c +++ b/drivers/spi/spi-bcm2835aux.c @@ -456,7 +456,7 @@ static int bcm2835aux_spi_probe(struct platform_device *pdev) } bs->clk = devm_clk_get(&pdev->dev, NULL); - if ((!bs->clk) || (IS_ERR(bs->clk))) { + if (IS_ERR(bs->clk)) { err = PTR_ERR(bs->clk); dev_err(&pdev->dev, "could not get clk: %d\n", err); goto out_master_put; -- 2.7.0