From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sebastian Andrzej Siewior Subject: Re: [PATCH] of: provide of_platform_unpopulate() Date: Sun, 21 Jul 2013 21:47:44 +0200 Message-ID: <51EC3AE0.5020107@linutronix.de> References: <1374257691-31981-1-git-send-email-bigeasy@linutronix.de> <51EBF33A.4050207@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <51EBF33A.4050207-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: "devicetree-discuss" To: Rob Herring Cc: George Cherian , linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Roger Quadros , devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Rob Herring , Kishon Vijay Abraham I , Kukjin Kim , Felipe Balbi , Grant Likely , linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Naveen Krishna Chatradhi , Vivek Gautam List-Id: devicetree@vger.kernel.org On 07/21/2013 04:42 PM, Rob Herring wrote: > Wouldn't the correct fix be to call insert_resource somehow? Yes unless there was a reason this wasn't done in the first place. > The problem > I have is that while of_platform_populate is all about parsing the DT > and creating devices, the removal side has nothing to do with DT. So > this should not be in the DT code. I think the core device code should > be able to handle removal if the device creation side is done correctly. If there is no need to use the special removal function (in case we add insert_ressource) then yes. What about a pointer in of_platform_populate()'s comment referring to the removal function? > > It looks to me like of_device_add either needs to call > platform_device_add rather than device_add. I think the device name > setting in platform_device_add should be a nop. If not, a check that the > name is already set could be added. It does actually the same thing as platform_device_add except the "dynamic device id" and the resource insert if I remember correctly. If you guys prefer the platdorm_device_add() path including insert_ressource() I can try this. > > Rob Sebastian