public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Dan Carpenter <dan.carpenter@oracle.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH WIP] parport: add device model
Date: Mon, 13 Apr 2015 15:32:44 +0530	[thread overview]
Message-ID: <20150413100244.GA6475@sudip-PC> (raw)
In-Reply-To: <20150413084339.GA2267@kroah.com>

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:
<snip>
> > 
> > 
> > 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), 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?

regards
sudip

> 
> > I think that should have been automatically done if i have a probe
> > function for the bus...
> 
> Yes.
> 
> > somehow I am missing this step in the other drivers codes.
> 
> Hope this helps,
> 
> greg k-h

  reply	other threads:[~2015-04-13 10:02 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-10 14:30 [PATCH WIP] parport: add device model Sudip Mukherjee
2015-04-10 14:49 ` Dan Carpenter
2015-04-11  5:26   ` Sudip Mukherjee
2015-04-11  7:27     ` Greg KH
2015-04-11  8:11       ` Sudip Mukherjee
2015-04-13  8:27         ` Sudip Mukherjee
2015-04-13  8:43         ` Greg KH
2015-04-13 10:02           ` Sudip Mukherjee [this message]
2015-04-13 10:42             ` Greg KH
2015-04-13 10:38     ` Dan Carpenter
2015-04-10 18:24 ` Ondrej Zary
2015-04-11  5:05   ` Sudip Mukherjee
2015-04-11  9:24     ` Ondrej Zary

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150413100244.GA6475@sudip-PC \
    --to=sudipm.mukherjee@gmail.com \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox