Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753752AbbDMKmZ (ORCPT ); Mon, 13 Apr 2015 06:42:25 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47696 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753437AbbDMKmW (ORCPT ); Mon, 13 Apr 2015 06:42:22 -0400 Date: Mon, 13 Apr 2015 12:42:19 +0200 From: Greg KH To: Sudip Mukherjee Cc: Dan Carpenter , linux-kernel@vger.kernel.org Subject: Re: [PATCH WIP] parport: add device model Message-ID: <20150413104219.GA6390@kroah.com> References: <1428676238-17141-1-git-send-email-sudipm.mukherjee@gmail.com> <20150410144955.GJ16501@mwanda> <20150411052651.GC3496@sudip-PC> <20150411072716.GD10063@kroah.com> <20150411081134.GA6092@sudip-PC> <20150413084339.GA2267@kroah.com> <20150413100244.GA6475@sudip-PC> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150413100244.GA6475@sudip-PC> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2116 Lines: 49 On Mon, Apr 13, 2015 at 03:32:44PM +0530, Sudip Mukherjee wrote: > On Mon, Apr 13, 2015 at 10:43:39AM +0200, Greg KH wrote: > > On Sat, Apr 11, 2015 at 01:41:34PM +0530, Sudip Mukherjee wrote: > > > On Sat, Apr 11, 2015 at 09:27:16AM +0200, Greg KH wrote: > > > > On Sat, Apr 11, 2015 at 10:56:51AM +0530, Sudip Mukherjee wrote: > > > > > > > > > > I can understand that drivers need to be binded to one device, so > > > suppose ppdev wants to use parport0, how that binding will be done? > > > > The driver core does the "binding". > > > > > do i need mark the driver in the parport->ddev.driver ? > > > > No, just have the probe function for the ppdev function return 0, > > meaning it successfully bound to the driver that was passed to it and > > all will be fine. > well, I was thinking that instead of having probe for individual > drivers (then we need to modify all the drivers), Sorry, you will have to modify all drivers, that's going to be a requirement. > i was planning like: > when the driver calls parport_device_register(), the driver will be > registered under parport and also a subdevice will be created under the > particular parport the driver wants to use and both will have the same > name. The probe of the bus will verify that name comparison and will > return 0 if the name matches. is this plan ok ? > and i wanted the binding to happen when the driver calls parport_claim() > and for that I was thinking of calling device_attach() . is that also ok? I don't know what parport_claim() does, sorry, but you are going to have to change all drivers. I suggest working on adding the new parport bus, and convert one or two drivers to the new code, to get it working first. Then you can convert the other drivers and then delete the old registration code from the parport core, as it will be not used anymore. good luck, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/