serial 16550: use xzalloc
No need to check for the result and increases the chance that we build a binary without the rarely used calloc function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
38d335b82e
commit
a03277592f
|
@ -211,9 +211,7 @@ static int ns16550_probe(struct device_d *dev)
|
|||
if ((plat->reg_read == NULL) || (plat->reg_write == NULL))
|
||||
return -EINVAL;
|
||||
|
||||
cdev = calloc(1, sizeof(struct console_device));
|
||||
if (cdev == NULL)
|
||||
return -ENOMEM;
|
||||
cdev = xzalloc(sizeof(*cdev));
|
||||
|
||||
dev->type_data = cdev;
|
||||
cdev->dev = dev;
|
||||
|
|
Loading…
Reference in New Issue