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 9D747C3A5A7 for ; Thu, 8 Dec 2022 10:15:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229612AbiLHKPv (ORCPT ); Thu, 8 Dec 2022 05:15:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbiLHKPu (ORCPT ); Thu, 8 Dec 2022 05:15:50 -0500 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 78C8CBD0; Thu, 8 Dec 2022 02:15:47 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 795D88109; Thu, 8 Dec 2022 10:15:46 +0000 (UTC) Date: Thu, 8 Dec 2022 12:15:45 +0200 From: Tony Lindgren To: Ilpo =?utf-8?B?SsOkcnZpbmVu?= Cc: Greg Kroah-Hartman , Andy Shevchenko , Jiri Slaby , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-serial , linux-omap@vger.kernel.org, LKML 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> <7f105ff9-cdc3-f98e-2557-812361faa94@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7f105ff9-cdc3-f98e-2557-812361faa94@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org * Ilpo Järvinen [221208 09:12]: > On Wed, 7 Dec 2022, Tony Lindgren wrote: > > + ret = serial_core_add_one_port(drv, port); > > + if (ret) > > + return ret; > > + > > + mutex_lock(&port_mutex); > > + > > + /* Inititalize a serial core controller device if needed */ > > + ctrl_dev = serial_core_ctrl_find(drv, port->dev, port->ctrl_id); > > + if (!ctrl_dev) { > > + ctrl_dev = serial_core_ctrl_device_add(port); > > + if (!ctrl_dev) > > + goto err_remove_port; > > + allocated = true; > > + } > > + > > + /* Initialize a serial core port device */ > > + ret = serial_core_port_device_add(ctrl_dev, port); > > How is ->port_dev supposed to work here? > > ->port_dev is not set until in serial_core_port_device_add() but you made > serial_core_add_one_port() call before that. Hmm do you mean you want to call serial_core_add_one_port() later after serial_core_port_device_add()? Or are you seeing some uninitialized use of port->port_dev (and not port->dev)? Regards, Tony