From: Jean Delvare <khali@linux-fr.org>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] platform: Add support for automatic device IDs
Date: Wed, 1 Aug 2012 08:58:57 +0200 [thread overview]
Message-ID: <20120801085857.0304cf0a@endymion.delvare> (raw)
In-Reply-To: <20120731235059.GA5702@kroah.com>
On Tue, 31 Jul 2012 16:50:59 -0700, Greg KH wrote:
> On Fri, Jul 27, 2012 at 10:14:59PM +0200, Jean Delvare wrote:
> > Right now we have support for explicit platform device IDs, as well as
> > ID-less platform devices when a given device type can only have one
> > instance. However there are cases where multiple instances of a device
> > type can exist, and their IDs aren't (and can't be) known in advance
> > and do not matter. In that case we need automatic device IDs to avoid
> > device name collisions.
> >
> > I am using magic ID value -2 (PLATFORM_DEVID_AUTO) for this, similar
> > to -1 for ID-less devices. The automatically allocated device IDs are
> > global (to avoid an additional per-driver cost.) We keep note that the
> > ID was automatically allocated so that it can be freed later.
> >
> > Note that we also restore the ID to PLATFORM_DEVID_AUTO on error and
> > device deletion, to avoid avoid unexpected behavior on retry. I don't
> > really expect retries on platform device addition, but better safe
> > than sorry.
> >
> > Signed-off-by: Jean Delvare <khali@linux-fr.org>
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>
> Looks sane to me, want me to queue it up for 3.7?
Yes, please!
Thanks,
--
Jean Delvare
prev parent reply other threads:[~2012-08-01 6:59 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-27 20:14 [PATCH v2] platform: Add support for automatic device IDs Jean Delvare
2012-07-28 5:56 ` Jean Delvare
2012-07-31 23:50 ` Greg KH
2012-08-01 6:58 ` Jean Delvare [this message]
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=20120801085857.0304cf0a@endymion.delvare \
--to=khali@linux-fr.org \
--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