aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pnp/core.c
diff options
context:
space:
mode:
authorBjorn Helgaas <bjorn.helgaas@hp.com>2007-08-15 10:32:13 -0600
committerLen Brown <len.brown@intel.com>2007-08-24 01:27:24 -0400
commitb173491339b9ae7f1322241ce6228c1268513a39 (patch)
treedca8b3a7021d7957d60023e34ac96a9df5215421 /drivers/pnp/core.c
parent4f0217e30249ac0eb13b65ef64f2aee627465da2 (diff)
downloadkernel_samsung_crespo-b173491339b9ae7f1322241ce6228c1268513a39.zip
kernel_samsung_crespo-b173491339b9ae7f1322241ce6228c1268513a39.tar.gz
kernel_samsung_crespo-b173491339b9ae7f1322241ce6228c1268513a39.tar.bz2
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 <bjorn.helgaas@hp.com> Acked-by: Adam Belay <abelay@novell.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/pnp/core.c')
-rw-r--r--drivers/pnp/core.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/pnp/core.c b/drivers/pnp/core.c
index 61066fd..d5964fe 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,