All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 WIP 1/2] parport: add device-model to parport subsystem
Date: Fri, 24 Apr 2015 13:15:22 +0530	[thread overview]
Message-ID: <20150424074522.GG3489@sudip-PC> (raw)
In-Reply-To: <20150424070454.GA16501@mwanda>

On Fri, Apr 24, 2015 at 10:04:54AM +0300, Dan Carpenter wrote:
> On Fri, Apr 24, 2015 at 12:20:26PM +0530, Sudip Mukherjee wrote:
> > > What is the point of the check function really?  The name isn't clear.
> > yes, i am a bit blunt in thinking of new names, i hope you have noticed
> > that in my naming of the labels .. :)
> > 
> > as the name was not sufficient i mentioned it in the comments. This check
> > function will receive the device details and will decide if it wants to
> > connect to that device. If it wants to connect then it registers its device
> > and mark the port as claimed.
> > Infact, on second thought, i will return the success or error from check,
> > then if the driver has found the device to connect then we can stop the
> > iteration there.
> > 
> > maybe a better name can be check_port() ? 
> 
> match() or match_port() something.
> 
> > > 
> > > Since it always returns zero that means we loop through all the devices
> > > and then returns NULL.  It feels like a function called
> > > bus_find_device() should find something.  We have bus_for_each_dev() if
> > > we just want to iterate.
> > > 
> > yes, bus_for_each_dev() will be better here. thanks.
> 
> If we're match then bus_find_device() is correct.  It's just that's not
> what v2 did.
that was the main intention but but bus_find_device() will also do
a get_device() once a match is found, then in that case I will have to do
a put_device() immediately after bus_find_device() completes.
> 
> > 
> > > > +
> > > > +/*
> > <snip>	
> > > > +
> > > > +	par_dev->name = devname;
> > > 
> > > The existing code is buggy here as we discussed previously.  Could you
> > > just fix that before we do anything else?  It's freaking me out.
> > 
> > quoting from your previous mail:
> > >My concern is that it gets freed before we are done using it or something
> > 
> > here, i have modified that and we are no longer using the string passed
> > as an argument. we have duplicated it using kstrdup and using that and
> > it gets freed in free_pardevice().
> > or am i missing something here?
> 
> Ah.  Ok.  Thanks.  I missed that and I don't think the patch has hit
> linux-next yet.
hehe , no. Greg has to apply the patch, and in the last patch he found
some points in his review. I will send in a v3 as soon as the confusion
about the bus_find_device() or bus_for_each_dev() clears.

regards
sudip

> 
> regards,
> dan carpenter
> 

  reply	other threads:[~2015-04-24  7:45 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21 13:52 [PATCH v2 WIP 1/2] parport: add device-model to parport subsystem Sudip Mukherjee
2015-04-21 13:52 ` [PATCH v2 WIP 2/2] staging: panel: modify driver to use new parport device model Sudip Mukherjee
2015-04-23 15:18 ` [PATCH v2 WIP 1/2] parport: add device-model to parport subsystem Dan Carpenter
2015-04-24  6:50   ` Sudip Mukherjee
2015-04-24  7:04     ` Dan Carpenter
2015-04-24  7:45       ` Sudip Mukherjee [this message]
2015-04-24  7:26     ` Greg KH
2015-04-24  7:38       ` Sudip Mukherjee
2015-04-24 18:37         ` One Thousand Gnomes
2015-04-25  6:09           ` Sudip Mukherjee
2015-04-25  9:59             ` Sudip Mukherjee

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=20150424074522.GG3489@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.