From: Jean Delvare <jdelvare@suse.de>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
Dan Carpenter <dan.carpenter@oracle.com>,
One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 WIP 2/4] i2c-parport: modify driver to use new parport device model
Date: Mon, 04 May 2015 11:14:26 +0200 [thread overview]
Message-ID: <1430730866.4445.104.camel@chaos.site> (raw)
In-Reply-To: <20150504072451.GA5912@sudip-PC>
Le Monday 04 May 2015 à 12:54 +0530, Sudip Mukherjee a écrit :
> Thanks. This explained many of the doubts I was having. And I have one
> more doubt and I need some suggestion for it too.
> This current version of the code will register devices like :
> If i register i2c-parport0 with parport0 then the sys tree will be:
> sys
> ________|____________
> |
> parport
> _____|_______
> | |
> parport0 i2c-parport0
> |
> i2c-parport0
>
> so basically it registers as a subdevice of parport0 and also a device
> in the bus. And this is the reason why i needed the device_type.
> But i think it is wrong. I think it should have been just:
> sys
> ________|____________
> |
> parport
> _____|_______
> |
> parport0
> |
> i2c-parport0
>
> so, which one is actually correct?
This was a surprise for me at first too, but the former is correct.
i2c-parport0 appears below parport0 as a directory because it is a child
of it. And both parport0 and i2c-parport0 appear as _links_
under /sys/bus/parport/devices because they are respectively a provider
device and a consumer device of the parport bus type.
As a note, i2c-parport.0 might be a better name (bus ID, actually), for
several reasons. It makes things more readable if a device name ends
with digits (not the case here, but could happen, this is rather
frequent.) It looks more like platform device names, and consistency is
always nice to have. And it avoids the confusion between "parport0"
where 0 is the parallel port number and i2c-"parport0" where 0 is the
instance number of the i2c-parport device - it may be connected to
parport0 but it's only by chance and it may well be connected to another
parallel port.
--
Jean Delvare
SUSE L3 Support
next prev parent reply other threads:[~2015-05-04 9:14 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-28 11:30 [PATCH v4 WIP 1/4] parport: add device-model to parport subsystem Sudip Mukherjee
2015-04-28 11:30 ` [PATCH v4 WIP 2/4] i2c-parport: modify driver to use new parport device model Sudip Mukherjee
2015-05-03 13:33 ` Jean Delvare
2015-05-04 5:40 ` Sudip Mukherjee
2015-05-04 6:58 ` Jean Delvare
2015-05-04 7:24 ` Sudip Mukherjee
2015-05-04 9:14 ` Jean Delvare [this message]
2015-05-03 20:50 ` Jean Delvare
2015-04-28 11:30 ` [PATCH v4 WIP 3/4] paride: " Sudip Mukherjee
2015-04-28 11:30 ` [PATCH v4 WIP 4/4] staging: panel: " Sudip Mukherjee
2015-05-02 14:20 ` [PATCH v4 WIP 1/4] parport: add device-model to parport subsystem Jean Delvare
2015-05-03 6:37 ` Sudip Mukherjee
2015-05-03 7:56 ` Jean Delvare
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=1430730866.4445.104.camel@chaos.site \
--to=jdelvare@suse.de \
--cc=dan.carpenter@oracle.com \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sudipm.mukherjee@gmail.com \
/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