From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B42CC3A5A7 for ; Thu, 8 Dec 2022 06:06:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229478AbiLHGGe (ORCPT ); Thu, 8 Dec 2022 01:06:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229462AbiLHGGe (ORCPT ); Thu, 8 Dec 2022 01:06:34 -0500 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B9A8899F0D; Wed, 7 Dec 2022 22:06:32 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 3069B804D; Thu, 8 Dec 2022 06:06:32 +0000 (UTC) Date: Thu, 8 Dec 2022 08:06:30 +0200 From: Tony Lindgren To: Andy Shevchenko Cc: Greg Kroah-Hartman , Ilpo =?utf-8?B?SsOkcnZpbmVu?= , Jiri Slaby , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-serial@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH v4 1/1] serial: core: Start managing serial controllers to enable runtime PM Message-ID: References: <20221207124305.49943-1-tony@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org * Tony Lindgren [221208 05:52]: > * Andy Shevchenko [221207 20:28]: > > We can avoid this check by caching the platform device. > > > > struct platform_device *ctrl_pdev = NULL; > > > > if (...) { > > ctrl_pdev = to_platform_device(ctrl_dev); > > } > > > > platform_device_del(ctrl_pdev); > > OK yeah that's nicer :) > > > > Shouldn't you call platform_device_unregister()? > > Outside the error path it should be platform_device_unregister(), > I'll check. Thanks also for your other comments. To me looks like we should just use platform_device_unregister() in call cases here like you noted. Regards, Tony