[PATCH] spi: hisi-kunpeng: Delete some dead code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The debugfs_create_dir() function returns error pointers, it doesn't
return NULL.  But debugfs functions aren't supposed to be checked in
normal circumstancers where the driver doesn't dereference the pointer
itself.

Fixes: 2b2142f247eb ("spi: hisi-kunpeng: Add debugfs support")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
 drivers/spi/spi-hisi-kunpeng.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/spi/spi-hisi-kunpeng.c b/drivers/spi/spi-hisi-kunpeng.c
index 58b823a16fc4..875f337a7836 100644
--- a/drivers/spi/spi-hisi-kunpeng.c
+++ b/drivers/spi/spi-hisi-kunpeng.c
@@ -167,8 +167,6 @@ static int hisi_spi_debugfs_init(struct hisi_spi *hs)
 
 	snprintf(name, 32, "hisi_spi%d", hs->bus_num);
 	hs->debugfs = debugfs_create_dir(name, NULL);
-	if (!hs->debugfs)
-		return -ENOMEM;
 
 	hs->regset.regs = hisi_spi_regs;
 	hs->regset.nregs = ARRAY_SIZE(hisi_spi_regs);
-- 
2.30.2




[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux