Re: [PATCH] staging: comedi: fix coding style issue.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/08/15 14:21, Ted Chen wrote:
fixed coding style issue
   - replaced ENOSYS by ENODEV.

The patch needs a better description, and ENODEV is not necessarily the best thing to return in all cases.

The patch should be split into separate patches, but one of those patches wouldn't apply anyway.


Signed-off-by: Ted Chen <tedc.37zngo@xxxxxxxxx>
---
  drivers/staging/comedi/comedi_fops.c |    2 +-
  drivers/staging/comedi/drivers.c     |    2 +-
  2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c
index 146ab00..6896a1f 100644
--- a/drivers/staging/comedi/comedi_fops.c
+++ b/drivers/staging/comedi/comedi_fops.c
@@ -2611,7 +2611,7 @@ static int comedi_open(struct inode *inode, struct file *file)
  	}
  	if (dev->attached && dev->use_count == 0) {
  		if (!try_module_get(dev->driver->module)) {
-			rc = -ENOSYS;
+			rc = -ENODEV;
  			goto out;
  		}
  		if (dev->open) {

This no longer applies to linux-next as it currently uses -ENXIO here.

diff --git a/drivers/staging/comedi/drivers.c b/drivers/staging/comedi/drivers.c
index ed0b60c..0b7000a 100644
--- a/drivers/staging/comedi/drivers.c
+++ b/drivers/staging/comedi/drivers.c
@@ -820,7 +820,7 @@ int comedi_device_attach(struct comedi_device *dev, struct comedi_devconfig *it)
  			 "driver '%s' does not support attach using comedi_config\n",
  			 driv->driver_name);
  		module_put(driv->module);
-		ret = -ENOSYS;
+		ret = -ENODEV;

ENODEV isn't really appropriate here. I suggest using either -EIO (as used earlier in the same function) or -ENOTSUP.

  		goto out;
  	}
  	dev->driver = driv;


--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@xxxxxxxxx> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux