Commit e2850160 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: drivers: (!foo) preferred over (foo == NULL)

Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 88cc30cf
...@@ -46,7 +46,7 @@ int comedi_set_hw_dev(struct comedi_device *dev, struct device *hw_dev) ...@@ -46,7 +46,7 @@ int comedi_set_hw_dev(struct comedi_device *dev, struct device *hw_dev)
{ {
if (hw_dev == dev->hw_dev) if (hw_dev == dev->hw_dev)
return 0; return 0;
if (dev->hw_dev != NULL) if (dev->hw_dev)
return -EEXIST; return -EEXIST;
dev->hw_dev = get_device(hw_dev); dev->hw_dev = get_device(hw_dev);
return 0; return 0;
...@@ -802,7 +802,7 @@ int comedi_device_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -802,7 +802,7 @@ int comedi_device_attach(struct comedi_device *dev, struct comedi_devconfig *it)
} }
module_put(driv->module); module_put(driv->module);
} }
if (driv == NULL) { if (!driv) {
/* recognize has failed if we get here */ /* recognize has failed if we get here */
/* report valid board names before returning error */ /* report valid board names before returning error */
for (driv = comedi_drivers; driv; driv = driv->next) { for (driv = comedi_drivers; driv; driv = driv->next) {
...@@ -814,7 +814,7 @@ int comedi_device_attach(struct comedi_device *dev, struct comedi_devconfig *it) ...@@ -814,7 +814,7 @@ int comedi_device_attach(struct comedi_device *dev, struct comedi_devconfig *it)
ret = -EIO; ret = -EIO;
goto out; goto out;
} }
if (driv->attach == NULL) { if (!driv->attach) {
/* driver does not support manual configuration */ /* driver does not support manual configuration */
dev_warn(dev->class_dev, dev_warn(dev->class_dev,
"driver '%s' does not support attach using comedi_config\n", "driver '%s' does not support attach using comedi_config\n",
...@@ -898,7 +898,7 @@ EXPORT_SYMBOL_GPL(comedi_auto_config); ...@@ -898,7 +898,7 @@ EXPORT_SYMBOL_GPL(comedi_auto_config);
void comedi_auto_unconfig(struct device *hardware_device) void comedi_auto_unconfig(struct device *hardware_device)
{ {
if (hardware_device == NULL) if (!hardware_device)
return; return;
comedi_release_hardware_device(hardware_device); comedi_release_hardware_device(hardware_device);
} }
......
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