9
0
Fork 0

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:
Sascha Hauer 2011-04-07 17:37:34 +02:00
parent 38d335b82e
commit a03277592f
1 changed files with 1 additions and 3 deletions

View File

@ -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;