]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
spi: bcm2835aux: remove unneeded NULL check of devm_clk_get
authorYueHaibing <yuehaibing@huawei.com>
Wed, 23 Jan 2019 07:05:07 +0000 (15:05 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 23 Jan 2019 10:31:21 +0000 (10:31 +0000)
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 <yuehaibing@huawei.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-bcm2835aux.c

index 671e374e1b01fa50a73ed97050fc38624e20432e..f7e054848ca5f121c05a14cdc2f7e4700449cdfa 100644 (file)
@@ -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;