From 120e1aa2f2e60b55f9d20c2fe1c6144739e00dc4 Mon Sep 17 00:00:00 2001 From: Yeqi Fu Date: Thu, 18 May 2023 13:25:15 +0800 Subject: [PATCH] spi: hisi-kunpeng: Fix error checking The function debugfs_create_dir returns ERR_PTR if an error occurs, and the appropriate way to verify for errors is to use the inline function IS_ERR. The patch will substitute the null-comparison with IS_ERR. Suggested-by: Ivan Orlov dev, struct spi_controller, dev); snprintf(name, 32, "hisi_spi%d", master->bus_num); hs->debugfs = debugfs_create_dir(name, NULL); - if (!hs->debugfs) + if (IS_ERR(hs->debugfs)) return -ENOMEM; hs->regset.regs = hisi_spi_regs;