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 A4F5DC64EC4 for ; Wed, 8 Mar 2023 15:29:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231958AbjCHP3j (ORCPT ); Wed, 8 Mar 2023 10:29:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231996AbjCHP33 (ORCPT ); Wed, 8 Mar 2023 10:29:29 -0500 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3830D867EC; Wed, 8 Mar 2023 07:29:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678289368; x=1709825368; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=owSbRjkEpcd2ZX2bKJCsdkpjfymuIBaOdUaiCK1wEwU=; b=lylGnXRpci5vQfeLyKv2vpHuPKcA5kQjLNoaBFVaFrmv0grFDqRYHP6K +nsceagFce+d3vejkdkhi4ObhZYs+L3wi+DmBXBQ1boevO9EzPjBrtF5n GoqhP8ge3E0sC9t/Kd2nsZtgl0KUtfB3RLhf2bp8wrsgI2emigc60kuyd E4DB6j0Ek0LHEfulnxA8nNjrIftYEtp6axK9hnp6A8L5EtK7FfApKx9CY F7Nx8FFdU64HqPjBu2kKamwlwJ84Ipxj2d2JJCUtY/BMaaIrE7ax+qqGc HGiV05IkY95+QREouLGBCHJKDJRHeil+oUT6oZTYuKJwZbSdBbPBtkhqY A==; X-IronPort-AV: E=McAfee;i="6500,9779,10642"; a="315840376" X-IronPort-AV: E=Sophos;i="5.98,244,1673942400"; d="scan'208";a="315840376" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Mar 2023 07:29:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10642"; a="922819997" X-IronPort-AV: E=Sophos;i="5.98,244,1673942400"; d="scan'208";a="922819997" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga006.fm.intel.com with ESMTP; 08 Mar 2023 07:28:58 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pZvip-00HUHL-09; Wed, 08 Mar 2023 17:28:55 +0200 Date: Wed, 8 Mar 2023 17:28:54 +0200 From: Andy Shevchenko To: Pin-yen Lin Cc: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , Rob Herring , Krzysztof Kozlowski , Daniel Scally , Heikki Krogerus , Sakari Ailus , Greg Kroah-Hartman , "Rafael J . Wysocki" , Prashant Malani , Benson Leung , Guenter Roeck , Xin Ji , Javier Martinez Canillas , Lyude Paul , linux-kernel@vger.kernel.org, AngeloGioacchino Del Regno , chrome-platform@lists.linux.dev, =?iso-8859-1?Q?N=EDcolas_F_=2E_R_=2E_A_=2E?= Prado , Marek Vasut , Hsin-Yi Wang , devicetree@vger.kernel.org, Allen Chen , dri-devel@lists.freedesktop.org, Thomas Zimmermann , Stephen Boyd , linux-acpi@vger.kernel.org, Alex Deucher , Douglas Anderson , Imre Deak , Jani Nikula , Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Subject: Re: [PATCH v13 03/10] drm/display: Add Type-C switch helpers Message-ID: References: <20230303143350.815623-1-treapking@chromium.org> <20230303143350.815623-4-treapking@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 08, 2023 at 06:20:14PM +0800, Pin-yen Lin wrote: > On Mon, Mar 6, 2023 at 7:49 PM Andy Shevchenko > > On Fri, Mar 03, 2023 at 10:33:43PM +0800, Pin-yen Lin wrote: ... > > > + switch_desc->typec_ports = devm_kcalloc(dev, switch_desc->num_typec_switches, > > > + sizeof(struct drm_dp_typec_port_data), > > > + GFP_KERNEL); > > > + if (!switch_desc->typec_ports) > > > + return -ENOMEM; > > > > How often this function _can_ be called during the runtime? > > If it's _possible_ to call it infinite times, consider *not* using devm. > > I would expect this function to be only called during driver probing, > and this is the case for the current users in this series. So I think > this is only called once if EPROBDE_DEFER doesn't count. No, deferred probe is not counted. Can you add a word somewhere in the comment(?) to make this clear? -- With Best Regards, Andy Shevchenko