From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5A3963C2C for ; Mon, 6 Feb 2023 12:08:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675685329; x=1707221329; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=PHhUr6bTIj4SVIqBJK6w9MlO+XgeoEnM4g1JfRq405s=; b=l6+SmpkyKqt0jIykqyTT5AR/l/nw7ZpYQP48g/WDaZnHyziJUVI2LNEb 8jJbOUM2clDUGQXVptxZX/xrPOS2KS083EEv5ok82xY9DFslCDrOq8AzH +zPDJpghZJe4G42u4zm00oP/04W/jZBFLEVsa4FPkST4rWCdqNwYwVRiU Ccw4rYr5OEB3JklpsJU5tUufnevQJ4v//CEh6xCgZh9eWbJZ0ydiMGKNV oUbrS3mCoGSK/7WqwfscUKeNUJpAACEg79agWtk8OsFEg74TXQbPiVBkW aKB0dHrVbT74L+80mRoQDSQQPYj7AMa2fKakSDLfxhj2cKUPcfdgYHj8f Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10612"; a="393788143" X-IronPort-AV: E=Sophos;i="5.97,276,1669104000"; d="scan'208";a="393788143" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Feb 2023 04:08:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10612"; a="911902275" X-IronPort-AV: E=Sophos;i="5.97,276,1669104000"; d="scan'208";a="911902275" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga006.fm.intel.com with ESMTP; 06 Feb 2023 04:08:38 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pP0IV-003AAC-00; Mon, 06 Feb 2023 14:08:35 +0200 Date: Mon, 6 Feb 2023 14:08:34 +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 , linux-kernel@vger.kernel.org, =?iso-8859-1?Q?N=EDcolas_F_=2E_R_=2E_A_=2E?= Prado , Hsin-Yi Wang , devicetree@vger.kernel.org, Allen Chen , Lyude Paul , linux-acpi@vger.kernel.org, dri-devel@lists.freedesktop.org, Marek Vasut , Xin Ji , Stephen Boyd , AngeloGioacchino Del Regno , Thomas Zimmermann , Javier Martinez Canillas , chrome-platform@lists.linux.dev, Alex Deucher , Andi Shyti , Douglas Anderson , "Gustavo A. R. Silva" , Imre Deak , Jani Nikula , Kees Cook , Thierry Reding Subject: Re: [PATCH v11 3/9] drm/display: Add Type-C switch helpers Message-ID: References: <20230204133040.1236799-1-treapking@chromium.org> <20230204133040.1236799-4-treapking@chromium.org> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230204133040.1236799-4-treapking@chromium.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Sat, Feb 04, 2023 at 09:30:34PM +0800, Pin-yen Lin wrote: > Add helpers to register and unregister Type-C "switches" for bridges > capable of switching their output between two downstream devices. > > The helper registers USB Type-C mode switches when the "mode-switch" > and the "reg" properties are available in Device Tree. ... > + fwnode_for_each_child_node(port, sw) { > + if (fwnode_property_present(sw, "mode-switch")) This idiom is being used at least twice (in this code, haven't checked the rest of the patches, though), perhaps #define fwnode_for_each_typec_mode_switch(port, sw) \ fwnode_for_each_child_node(port, sw) \ if (!fwnode_property_present(sw, "mode-switch")) {} else ? -- With Best Regards, Andy Shevchenko