lkml.org 
[lkml]   [2015]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH WIP] parport: add device model
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


\
 
 \ /
  Last update: 2015-04-13 12:41    [W:0.074 / U:2.724 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site