All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Input: introduce managed input devices (add devres support)
Date: Wed, 31 Oct 2012 14:05:32 -0700	[thread overview]
Message-ID: <20121031210532.GX2945@htj.dyndns.org> (raw)
In-Reply-To: <20121023053513.GA15642@core.coreip.homeip.net>

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 styles
> of resource management which usually introduced more bugs, such as
> manually unregistering input device but relying in devres to free
> interrupt handler which (unless device is properly shut off) can cause
> ISR to reference already freed memory.
> 
> This change introduces devm_input_allocate_device() that will allocate
> managed instance of input device so that driver writers who prefer
> using devm_* framework do not have to mix 2 styles.

It generally looks good to me although it's a bit unusual to use
devres on device.  Given the way input_dev is used, it probably makes
sense, I guess.

One thing tho.  If possible and there aren't too many, wouldn't it be
better to convert all to use devres.  Having two different lifetime
fules tends to lead to gotchas.

Thanks!

-- 
tejun

  parent reply	other threads:[~2012-10-31 21:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-23  5:35 [PATCH] Input: introduce managed input devices (add devres support) Dmitry Torokhov
2012-10-29 18:22 ` Henrik Rydberg
2012-10-29 18:59   ` Dmitry Torokhov
2012-10-29 20:02     ` Henrik Rydberg
2012-10-29 20:40       ` Dmitry Torokhov
2012-10-29 21:32         ` Henrik Rydberg
2012-10-29 22:12           ` Dmitry Torokhov
2012-10-31 21:05 ` Tejun Heo [this message]
2012-10-31 21:37   ` Dmitry Torokhov
2012-10-31 21:38     ` Tejun Heo

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=20121031210532.GX2945@htj.dyndns.org \
    --to=tj@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.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.