lkml.org 
[lkml]   [2019]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/2] media: ir-kbd-i2c: convert to i2c_new_dummy_device()
On Sat, Aug 03, 2019 at 01:17:49PM -0300, Mauro Carvalho Chehab wrote:
> Em Tue, 30 Jul 2019 19:55:54 +0200
> Wolfram Sang <wsa+renesas@sang-engineering.com> escreveu:
>
> > Convert this driver to use the new i2c_new_dummy_device() call and bail
> > out if the dummy device cannot be registered to make failure more
> > visible to the user.
> >
>
> Please don't do that.
>
> At first glance, devm_* sounds a good idea, but we had enough issues
> using it on media system.
>
> I don't mind mind much if some SoC specific would use it, but doing
> it on generic drivers is a very bad idea. We have removed almost all
> devm_* calls from the media system.
>
> The problem with devm is that it the de-allocation routines aren't
> called during device unbind. They happen a way later, only when the
> device itself is physically removed, or the driver is removed.

Yes, good point.

> That caused lots of headaches to debug memory lifetime issues on
> media.

Indeed this becomes much more complex. Explicit freeing is much better.


Thanks,
Sean

\
 
 \ /
  Last update: 2019-08-04 05:01    [W:0.038 / U:5.656 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site