From b173491339b9ae7f1322241ce6228c1268513a39 Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Wed, 15 Aug 2007 10:32:13 -0600 Subject: PNP: remove null pointer checks Remove some null pointer checks. Null pointers in these areas indicate programming errors, and I think it's better to oops immediately rather than return an error that is easily ignored. Signed-off-by: Bjorn Helgaas Acked-by: Adam Belay Signed-off-by: Len Brown --- drivers/pnp/core.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'drivers/pnp/core.c') diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c index 61066fdb9e6..d5964feb14d 100644 --- a/drivers/pnp/core.c +++ b/drivers/pnp/core.c @@ -52,9 +52,6 @@ int pnp_register_protocol(struct pnp_protocol *protocol) int nodenum; struct list_head *pos; - if (!protocol) - return -EINVAL; - INIT_LIST_HEAD(&protocol->devices); INIT_LIST_HEAD(&protocol->cards); nodenum = 0; @@ -94,8 +91,6 @@ static void pnp_free_ids(struct pnp_dev *dev) struct pnp_id *id; struct pnp_id *next; - if (!dev) - return; id = dev->id; while (id) { next = id->next; @@ -143,7 +138,7 @@ int __pnp_add_device(struct pnp_dev *dev) */ int pnp_add_device(struct pnp_dev *dev) { - if (!dev || !dev->protocol || dev->card) + if (dev->card) return -EINVAL; dev->dev.parent = &dev->protocol->dev; sprintf(dev->dev.bus_id, "%02x:%02x", dev->protocol->number, -- cgit v1.2.3