Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B6586C6FD19 for ; Mon, 13 Mar 2023 07:55:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229774AbjCMHzv (ORCPT ); Mon, 13 Mar 2023 03:55:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230169AbjCMHzL (ORCPT ); Mon, 13 Mar 2023 03:55:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D720532A4; Mon, 13 Mar 2023 00:53:48 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 93CEA6102C; Mon, 13 Mar 2023 07:53:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A00A9C433D2; Mon, 13 Mar 2023 07:53:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678694027; bh=qXpORCVC22q6WFkUkgrUTCWoKOTFuIICXiYOXV4iEj0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=1ijGgz6YsPWKhJ0K9J5eGnkTqlVfLHOKSchxUPLzAiosv7VccmQMVK/4BtFAlBio3 NWwI//kQ1geBcgLF52Cn6s/wYQqDqlG3T1ri3A2ZzaiK0m7mJ11nJ3addojqCcwqCU P4jToqBMfPe0N4nPoLHFg4EzmZa/zm27FaCxGhJ4= Date: Mon, 13 Mar 2023 08:53:43 +0100 From: Greg Kroah-Hartman To: Jarkko Sonninen Cc: Johan Hovold , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] USB: serial: xr: Add TIOCGRS485 and TIOCSRS485 ioctls Message-ID: References: <20230313010416.845252-1-kasper@iki.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 13, 2023 at 09:49:26AM +0200, Jarkko Sonninen wrote: > > > +{ > > > + void __user *argp = (void __user *)arg; > > > + > > > + switch (cmd) { > > > + case TIOCGRS485: > > > + return xr_get_rs485_config(tty, argp); > > > + case TIOCSRS485: > > > + return xr_set_rs485_config(tty, argp); > > > + } > > > + return -ENOIOCTLCMD; > > Wrong ioctl return value :( > > What is the correct ioctl error return value ? > ENOIOCTLCMD was used in most places in usb serial as an error return. ENOTTY is the correct one for when an ioctl is not handled by the ioctl call. thanks, greg k-h