Re: [PATCH] Input: introduce managed input devices (add devres support)

2012-10-31 Thread Tejun Heo
Hello, Dmitry. On Wed, Oct 31, 2012 at 02:37:01PM -0700, Dmitry Torokhov wrote: > Not all drivers use devres for rest of their resources so it makes sense > to have unmanaged versions (like we have request_irq/devm_request_irq). > Besides: > > [dtor@dtor-ws vmci]$ grep -r input_allocate_device dr

Re: [PATCH] Input: introduce managed input devices (add devres support)

2012-10-31 Thread Dmitry Torokhov
On Wednesday, October 31, 2012 02:05:32 PM Tejun Heo wrote: > Hello, Dmitry. > > On Mon, Oct 22, 2012 at 10:35:14PM -0700, Dmitry Torokhov wrote: > > There is a demand from driver's writers to use managed devices framework > > for their drivers. Unfortunately up to this moment input devices did no

Re: [PATCH] Input: introduce managed input devices (add devres support)

2012-10-31 Thread Tejun Heo
Hello, Dmitry. On Mon, Oct 22, 2012 at 10:35:14PM -0700, Dmitry Torokhov wrote: > There is a demand from driver's writers to use managed devices framework > for their drivers. Unfortunately up to this moment input devices did not > provide support for managed devices and that lead to mixing two st

Re: [PATCH] Input: introduce managed input devices (add devres support)

2012-10-29 Thread Dmitry Torokhov
On Monday, October 29, 2012 10:32:54 PM Henrik Rydberg wrote: > > > Either way, the code looks functional to me. > > > > So is that "reviewed-by"? > > I was thinking about this hunk: > > @@ -1972,7 +2084,20 @@ int input_register_device(struct input_dev *dev) > > > > mutex_unlock(&input_m

Re: [PATCH] Input: introduce managed input devices (add devres support)

2012-10-29 Thread Henrik Rydberg
> > Either way, the code looks functional to me. > > So is that "reviewed-by"? I was thinking about this hunk: > @@ -1972,7 +2084,20 @@ int input_register_device(struct input_dev *dev) > > mutex_unlock(&input_mutex); > > + if (dev->devres_managed) { > + dev_info(dev

Re: [PATCH] Input: introduce managed input devices (add devres support)

2012-10-29 Thread Dmitry Torokhov
On Mon, Oct 29, 2012 at 09:02:26PM +0100, Henrik Rydberg wrote: > > > > @@ -1766,8 +1830,14 @@ EXPORT_SYMBOL(input_allocate_device); > > > > */ > > > > void input_free_device(struct input_dev *dev) > > > > { > > > > - if (dev) > > > > + if (dev) { > > > > + if (dev->de

Re: [PATCH] Input: introduce managed input devices (add devres support)

2012-10-29 Thread Henrik Rydberg
> > > @@ -1766,8 +1830,14 @@ EXPORT_SYMBOL(input_allocate_device); > > > */ > > > void input_free_device(struct input_dev *dev) > > > { > > > - if (dev) > > > + if (dev) { > > > + if (dev->devres_managed) > > > + WARN_ON(devres_destroy(dev->dev.parent, > > > +

Re: [PATCH] Input: introduce managed input devices (add devres support)

2012-10-29 Thread Dmitry Torokhov
Hi Henrik, On Mon, Oct 29, 2012 at 07:22:53PM +0100, Henrik Rydberg wrote: > Hi Dmitry Torokhov wrote: > > > There is a demand from driver's writers to use managed devices framework > > for their drivers. Unfortunately up to this moment input devices did not > > provide support for managed device

Re: [PATCH] Input: introduce managed input devices (add devres support)

2012-10-29 Thread Henrik Rydberg
Hi Dmitry Torokhov wrote: > There is a demand from driver's writers to use managed devices framework > for their drivers. Unfortunately up to this moment input devices did not > provide support for managed devices and that lead to mixing two styles > of resource management which usually introduced

[PATCH] Input: introduce managed input devices (add devres support)

2012-10-22 Thread Dmitry Torokhov
There is a demand from driver's writers to use managed devices framework for their drivers. Unfortunately up to this moment input devices did not provide support for managed devices and that lead to mixing two styles of resource management which usually introduced more bugs, such as manually unregi