Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp503378rwb; Wed, 7 Dec 2022 22:12:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf5P9sJAoma5/G3vn5CyW7HiSCxIsaVzAEhBQk7tG6tZCQrhjmsjkAAtON7Dt9RM5WjEV/qS X-Received: by 2002:a65:6d95:0:b0:46f:f482:6920 with SMTP id bc21-20020a656d95000000b0046ff4826920mr66646083pgb.327.1670479922911; Wed, 07 Dec 2022 22:12:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670479922; cv=none; d=google.com; s=arc-20160816; b=r/pLMozshP/kk2CaSrXkz67eBHPtGjfjJiFJr2/U92B/5h/1BNiyncDMCnMVZ/K4nI 7QZ3CQCKcxycO+PRt7qo0QVoWNuEBPTMUBuZhViOO9FgUD5/DuZBrh/vq8jJaKaE+AY8 jQY0pZQ9+xWXrEvXSyvytukUE22cANqM+iySqcD6uYZNTONZvGzDM/bj+mmZqpO1fYb9 Ta4n7v86CViuAdgEAZSY2bl3QaV1f0iHQ17okS+78Na3yx/IC31p1KPDXqO1pfjH13Dz CZ08ykMxs0LN+vEs0p9HQZvALT/R2LRSigLSXSBVEdbN37cUr5xl/lli0ropZTqFexF4 FjuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Wl8eBRsujhpT1zD8QAFDgSTirleFqBA5+SdyXFQ0YWM=; b=XvxlCBPbHUaWXWA0hoeBuUZwhDIseUQ6C3iGm98eSQoDVG2/753I6CAzVMXY583jIq gop02yHqHIaM4vEssbtuDSZJCTTir+Zse+8fHr3pDqZnWXYeFujElzGKl0dvcv9F037I tkFlw4X0XECSBhKUF54bgOYLXeK9a1D1TwggE41GtDtQw3oI2v/v0DtJx9NKU/4GJKtY OUyhIVzs5erQURqGVKRxUtAMAfR+JZ3zHZLIXngvfuQ8jfsG9FjrvDc9bcYdDdA9s9IQ 4+pNrE6bhOxeVl/YnE4j9SUEggHB09CPC68FQgHdtiRaOHaoZK6ONm8+8aqM7K1JRl5O 7LLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p12-20020a17090a868c00b0021895ab714bsi3419639pjn.59.2022.12.07.22.11.36; Wed, 07 Dec 2022 22:12:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229562AbiLHGGf (ORCPT + 75 others); Thu, 8 Dec 2022 01:06:35 -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: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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