diff options
author | David Kershner <david.kershner@unisys.com> | 2017-08-30 13:36:17 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-08-31 18:17:39 +0200 |
commit | 68f4f7665caef801d1ad361f613a9edd7c40bb16 (patch) | |
tree | 3955fbb920fe2ffd1ad485987f433dfb5f19f56c /drivers/staging/unisys/visorbus/visorbus_main.c | |
parent | 9a8dc900ec8929c63345350d544c349c687e2055 (diff) |
staging: unisys: Don't check for null before getting driver device.
The macro to convert to the driver object was giving a checkpatch warning
when it ateempted to check for a null driver. It would return NULL if it
found it, but only one location was checking to see if it was NULL.
Remove the check in the MACRO and do it prior to calling the macro if
required.
Signed-off-by: David Kershner <david.kershner@unisys.com>
Reviewed-by: Tim Sell <timothy.sell@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/unisys/visorbus/visorbus_main.c')
-rw-r--r-- | drivers/staging/unisys/visorbus/visorbus_main.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 05b632e97241..0957eaa247c4 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -1158,13 +1158,13 @@ static int visorchipset_initiate_device_pause_resume(struct visor_device *dev, int err; struct visor_driver *drv = NULL; - drv = to_visor_driver(dev->device.driver); - if (!drv) - return -ENODEV; - + /* If no driver associated with the device nothing to pause/resume */ + if (!dev->device.driver) + return 0; if (dev->pausing || dev->resuming) return -EBUSY; + drv = to_visor_driver(dev->device.driver); if (is_pause) { dev->pausing = true; err = drv->pause(dev, pause_state_change_complete); |