Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp1228406ybh; Sat, 3 Aug 2019 21:07:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqx7FsbQJg5HqrQDbjem5iu88K25D2eSFFjbiWFqBItUKytyhi74JlPOJsDAYcCXwiU54vMX X-Received: by 2002:a17:90a:30cf:: with SMTP id h73mr12207767pjb.42.1564891638954; Sat, 03 Aug 2019 21:07:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564891638; cv=none; d=google.com; s=arc-20160816; b=JbBMCfNI0VxQKuOY0FYKzs4YVHwTnajmWVd7JgFtWOWZcyAHmyWkOc5s9TDXQtjlk/ Xrmu5uNGNAQ/RJ1GnZDlRMr5gDdSFhRt46FWbDxJHW2FWR88ZE6wYJ7KIOz7WTQ0n619 ZoLgoHQbBJ9AvFhnQOL9geNTyeZP/3z5QlRiuBoc1I00YwY9poOJtdsRKz7mqOzGr9pj fmQ7vmWegfWsgBlhbtrLp+zZmGK5+nnNjT3/HlneY83eFix8168KxWqjQbWbJBEdl4FV +kJfm77NVOZ3rXvei5YZ8g7VK0Sv8zHCPwMeeN58RV0w5IegSM8jZ9YKh6EymzziwehS gx8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=82A4xmaE9fxscvUKp6Ym643QieHm5sIMIIpXIes869s=; b=E5BZsL5sDgvpqCIhJbZi3563AaNl0ug1/yod9/Pl4hNTHbzUWt3XkCOFVWKHc8KNNy 2PKBeyaojKP8wB4v0hrCz4FJ//jK1qBNFnyqCV1Nm9Toh/2BGmrdU5VgpaVTLv8cWRwc yX/iVhRLdhU7uThP6nJSMTJuCEYw6x2wbId0y2BeblnyUk0EWk079AXXCGDk8ow9H7uv vkV0PNbudppk61G679kqg98HNicPoPVb51ns8RfLnW75ai4R0Do3QRnV+PJGOR56r4oE hIi0TkhQYvZ1ylGkp4q6Ig4ayu3GurLIO00oWm1r9tUUoa7lw9qGmIvIdqINe99NFLsn vwhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18si36547865plo.328.2019.08.03.21.07.03; Sat, 03 Aug 2019 21:07:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728937AbfHDC5b (ORCPT + 99 others); Sat, 3 Aug 2019 22:57:31 -0400 Received: from gofer.mess.org ([88.97.38.141]:49813 "EHLO gofer.mess.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726268AbfHDC5b (ORCPT ); Sat, 3 Aug 2019 22:57:31 -0400 Received: by gofer.mess.org (Postfix, from userid 1000) id 2D44F604C0; Sun, 4 Aug 2019 03:57:29 +0100 (BST) Date: Sun, 4 Aug 2019 03:57:29 +0100 From: Sean Young To: Mauro Carvalho Chehab Cc: Wolfram Sang , linux-i2c@vger.kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] media: ir-kbd-i2c: convert to i2c_new_dummy_device() Message-ID: <20190804025728.5v5r42zmjn5onxl7@gofer.mess.org> References: <20190730175555.14098-1-wsa+renesas@sang-engineering.com> <20190730175555.14098-2-wsa+renesas@sang-engineering.com> <20190803131749.4d6517ab@coco.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190803131749.4d6517ab@coco.lan> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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