Commit 0bc11fd4 authored by Bjorn Helgaas's avatar Bjorn Helgaas Committed by Linus Torvalds

PNP: skip dev->protocol NULL checks

Every PNP device should have a valid protocol pointer.  If it doesn't,
something's wrong and we should oops so we can find and fix the problem.
Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Adam Belay <ambx1@neo.rr.com>
Cc: Adrian Bunk <bunk@kernel.org>
Cc: Rene Herman <rene.herman@keyaccess.nl>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 62b0559a
...@@ -167,7 +167,7 @@ static int pnp_bus_suspend(struct device *dev, pm_message_t state) ...@@ -167,7 +167,7 @@ static int pnp_bus_suspend(struct device *dev, pm_message_t state)
return error; return error;
} }
if (pnp_dev->protocol && pnp_dev->protocol->suspend) if (pnp_dev->protocol->suspend)
pnp_dev->protocol->suspend(pnp_dev, state); pnp_dev->protocol->suspend(pnp_dev, state);
return 0; return 0;
} }
...@@ -181,7 +181,7 @@ static int pnp_bus_resume(struct device *dev) ...@@ -181,7 +181,7 @@ static int pnp_bus_resume(struct device *dev)
if (!pnp_drv) if (!pnp_drv)
return 0; return 0;
if (pnp_dev->protocol && pnp_dev->protocol->resume) if (pnp_dev->protocol->resume)
pnp_dev->protocol->resume(pnp_dev); pnp_dev->protocol->resume(pnp_dev);
if (pnp_can_write(pnp_dev)) { if (pnp_can_write(pnp_dev)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment