From: Bjorn Helgaas Date: Mon, 28 Apr 2008 09:15:57 +0000 (-0700) Subject: PNP: skip dev->protocol NULL checks X-Git-Tag: MMI-PSA29.97-13-9~35239 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0bc11fd446d2ca29459c3c8e04a6d36db9bbbea4;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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: Bjorn Helgaas Cc: Adam Belay Cc: Adrian Bunk Cc: Rene Herman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/pnp/driver.c b/drivers/pnp/driver.c index 12a1645a2e43..e85cbf116db1 100644 --- a/drivers/pnp/driver.c +++ b/drivers/pnp/driver.c @@ -167,7 +167,7 @@ static int pnp_bus_suspend(struct device *dev, pm_message_t state) return error; } - if (pnp_dev->protocol && pnp_dev->protocol->suspend) + if (pnp_dev->protocol->suspend) pnp_dev->protocol->suspend(pnp_dev, state); return 0; } @@ -181,7 +181,7 @@ static int pnp_bus_resume(struct device *dev) if (!pnp_drv) return 0; - if (pnp_dev->protocol && pnp_dev->protocol->resume) + if (pnp_dev->protocol->resume) pnp_dev->protocol->resume(pnp_dev); if (pnp_can_write(pnp_dev)) {