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 D5767C4332F for ; Thu, 8 Dec 2022 05:52:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229544AbiLHFwP (ORCPT ); Thu, 8 Dec 2022 00:52:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbiLHFwO (ORCPT ); Thu, 8 Dec 2022 00:52:14 -0500 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D327B92A37; Wed, 7 Dec 2022 21:52:13 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 26FB5804D; Thu, 8 Dec 2022 05:52:13 +0000 (UTC) Date: Thu, 8 Dec 2022 07:52:11 +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 * 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. Regards, Tony