From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752907AbbF2Jlw (ORCPT ); Mon, 29 Jun 2015 05:41:52 -0400 Received: from smtp105.iad3a.emailsrvr.com ([173.203.187.105]:36357 "EHLO smtp105.iad3a.emailsrvr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750992AbbF2Jlv (ORCPT ); Mon, 29 Jun 2015 05:41:51 -0400 X-Sender-Id: abbotti@mev.co.uk From: Ian Abbott To: Santhosh Pai , sudipm.mukherjee@gmail.com Cc: hsweeten@visionengravers.com, , devel@driverdev.osuosl.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Subject: [PATCH] staging: Comedi: comedi_fops: Fixed the return error code Date: Mon, 29 Jun 2015 10:41:17 +0100 Message-Id: <1435570877-27882-1-git-send-email-abbotti@mev.co.uk> X-Mailer: git-send-email 2.1.4 In-Reply-To: <55910FC7.1020506@mev.co.uk> References: <55910FC7.1020506@mev.co.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Santhosh Pai From: Santhosh Pai This patch fixes the checkpatch.pl warning: WARNING: ENOSYS means 'invalid syscall nr' and nothing else try_module_get fails when the reference count of the module is not allowed to be incremented ,and hence -ENXIO is returned indicating no device or address. [IA - combined two of santhosh's changes to the error return value!] Signed-off-by: santhosh pai Reviewed-by: Ian Abbott --- drivers/staging/comedi/comedi_fops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/comedi_fops.c b/drivers/staging/comedi/comedi_fops.c index 985d94b..1ab443c 100644 --- a/drivers/staging/comedi/comedi_fops.c +++ b/drivers/staging/comedi/comedi_fops.c @@ -2606,7 +2606,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 = -ENXIO; goto out; } if (dev->open) { -- 2.1.4