[PATCH v2 4/7] mfd: syscon: Don't check xzalloc return for NULL

Andrey Smirnov andrew.smirnov at gmail.com
Mon Jul 18 08:14:46 PDT 2016


Xzalloc never returns NULL, so this check does not bring any value.

Signed-off-by: Andrey Smirnov <andrew.smirnov at gmail.com>
---
 drivers/mfd/syscon.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/mfd/syscon.c b/drivers/mfd/syscon.c
index cf1d2df..487fa9e 100644
--- a/drivers/mfd/syscon.c
+++ b/drivers/mfd/syscon.c
@@ -116,8 +116,6 @@ static int syscon_probe(struct device_d *dev)
 	struct resource *res;
 
 	syscon = xzalloc(sizeof(struct syscon));
-	if (!syscon)
-		return -ENOMEM;
 
 	res = dev_get_resource(dev, IORESOURCE_MEM, 0);
 	if (IS_ERR(res)) {
-- 
2.5.5




More information about the barebox mailing list