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 94999C7618D for ; Mon, 13 Mar 2023 15:50:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230231AbjCMPuN (ORCPT ); Mon, 13 Mar 2023 11:50:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230221AbjCMPuJ (ORCPT ); Mon, 13 Mar 2023 11:50:09 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D0E742BCE; Mon, 13 Mar 2023 08:50:08 -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 ams.source.kernel.org (Postfix) with ESMTPS id 2DF44B81187; Mon, 13 Mar 2023 15:50:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 57499C4339B; Mon, 13 Mar 2023 15:50:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678722605; bh=+lM2Exp0Wi6pVvImfiqMsymn5DzPGAVl+9+ACgFhifs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TMpw5mHElTRB+obnoPa20FfvlUJTRTWQWBbTjI6uYrOiWGfQhml0z6iBgZ9wlspxc njyCn99cl1TMBf/VVA5ZjpT/6qZy1qTxL8fLqMUCNAp5cS5fS9XMeO0I50MSRT4m/7 lchgulRdWKnyJ/nLIWTW/0YnKreX/DGNeeKsnT6k= Date: Mon, 13 Mar 2023 16:50:03 +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> <71fd009b-8378-d5b0-5243-5279b2b880ee@iki.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <71fd009b-8378-d5b0-5243-5279b2b880ee@iki.fi> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 13, 2023 at 05:07:59PM +0200, Jarkko Sonninen wrote: > On 3/13/23 09:53, Greg Kroah-Hartman wrote: > > 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 > > Using ENOTTY breaks all other tty ioctls. What other tty ioctls? confused, greg k-h