[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-kernel
Subject:    Re: [PATCH v2] platform: Add support for automatic device IDs
From:       Greg KH <gregkh () linuxfoundation ! org>
Date:       2012-07-31 23:50:59
Message-ID: 20120731235059.GA5702 () kroah ! com
[Download RAW message or body]

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?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic