Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752742AbdFQKZl (ORCPT ); Sat, 17 Jun 2017 06:25:41 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43814 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752692AbdFQKZk (ORCPT ); Sat, 17 Jun 2017 06:25:40 -0400 Date: Sat, 17 Jun 2017 12:25:34 +0200 From: Greg Kroah-Hartman To: Okash Khawaja Cc: Andy Shevchenko , Samuel Thibault , Jiri Slaby , "linux-kernel@vger.kernel.org" , devel@driverdev.osuosl.org, Kirk Reiser , speakup@linux-speakup.org, Chris Brannon Subject: Re: [patch 1/2] staging: speakup: add function to convert dev name to number Message-ID: <20170617102534.GA24564@kroah.com> References: <20170613224050.646277124@gmail.com> <20170614101326.GA7606@kroah.com> <20170614101541.GA8065@kroah.com> <20170614112609.uqpvl2z5aoi5jchc@var.youpi.perso.aquilenet.fr> <20170614114802.GA23345@kroah.com> <20170614121819.tob426qpysswg5g6@var.youpi.perso.aquilenet.fr> <20170614130418.GA1184@kroah.com> <20170615065251.GB372@sanghar> <20170617101644.GA31565@sanghar> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170617101644.GA31565@sanghar> User-Agent: Mutt/1.8.3 (2017-05-23) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1110 Lines: 25 On Sat, Jun 17, 2017 at 11:16:44AM +0100, Okash Khawaja wrote: > Hi, > > On Thu, Jun 15, 2017 at 07:52:51AM +0100, Okash Khawaja wrote: > > On Wed, Jun 14, 2017 at 03:04:18PM +0200, Greg Kroah-Hartman wrote: > > > The console stuff is odd though, but that is each driver defining the > > > name for itself, major/minor does not apply. Also, a separate driver is > > > not having to figure this all out. I wonder if we could just add a tty > > > core function for this as it does know the name of everything that has > > > been registered with it, right? > > > > I can start working on a patch for this. I'm still new to the tty code > > so will follow up with any questions I might have. > > I've put together this function for converting device name to number. > It traverses tty_drivers list looking for corresponding dev name and > index. Is this the right approach? Yes, this looks great, nice job! It is a lot simpler than your previous function, and now you are not limited to just a subset off the different serial ports in the system. Keep up the good work, it's really appreciated. greg k-h