From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932164AbbFVJh5 (ORCPT ); Mon, 22 Jun 2015 05:37:57 -0400 Received: from smtp81.iad3a.emailsrvr.com ([173.203.187.81]:37409 "EHLO smtp81.iad3a.emailsrvr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752521AbbFVJhs (ORCPT ); Mon, 22 Jun 2015 05:37:48 -0400 X-Sender-Id: abbotti@mev.co.uk Message-ID: <5587D767.5040004@mev.co.uk> Date: Mon, 22 Jun 2015 10:37:43 +0100 From: Ian Abbott User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: Santosh , hsweeten@visionengravers.com CC: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org Subject: Re: [PATCH] staging : Comedi : comedi_fops : Fixed the return error code References: <55868B64.5030004@yahoo.com> In-Reply-To: <55868B64.5030004@yahoo.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21/06/15 11:01, Santosh wrote: > This patch fixes the checkpatch.pl warning: > > WARNING: ENOSYS means 'invalid syscall nr' and nothing else > > Regards, > > Santosh Pai > > > 0001-staging-Comedi-comedi_fops-Fixed-the-return-error-co.patch Greg doesn't usually take patches in attachments. > From 502464417255edb52a1db71146e2f33e67df87ce Mon Sep 17 00:00:00 2001 > From: sanpai > Date: Sun, 21 Jun 2015 15:05:00 +0530 > Subject: [PATCH] staging : Comedi : comedi_fops : Fixed the return error code > > try_module_get fails when the reference count of the module is not > allowed to be incremented ,and hence -EPERM is returned. > > Signed-off-by: sanpai > --- > 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..d6a37e9 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 = -EPERM; Why -EPERM? I think either -ENODEV or -ENXIO would be better. > goto out; > } > if (dev->open) { > -- 1.7.9.5 > -- -=( Ian Abbott @ MEV Ltd. E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/