From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 5C90B3C02 for ; Mon, 6 Mar 2023 11:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678103736; x=1709639736; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Xv0rddRhfULApnbd3Ab/QM/Y5xi6oLD/g/1EbXH3o94=; b=jntTX/MKuVPYlEVMz8vTrwohC79XNd28s+lIllpvYq5svhE7EBylZT/+ YimVUWQK2/hQzjbY/dcYdnyNfRPHrPkWEIa5zXKPhwzGnoVk46zZynzSs GZbst9YZAgfOqP/wb6kcLt/vchLQNJwW+g6/uE6ASQnnd1pAawQiuUDhn YTCK6CfgTZhxBAW2cKnq2xJXXO6XHXUs1+jKZQWpcTBKrxPDGp6momuJd t8TzR/xl8NINdJzej6iiL1E+KvzT9mBZyZdyBKRY7+pgYG/M9nvq/ecTs JiHxA6JMMIMDG4PGw6sc6gf3MREdKvR2uNF1q9h73zfZFjYhwRC99P0BB Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10640"; a="323843618" X-IronPort-AV: E=Sophos;i="5.98,236,1673942400"; d="scan'208";a="323843618" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2023 03:55:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10640"; a="745031931" X-IronPort-AV: E=Sophos;i="5.98,236,1673942400"; d="scan'208";a="745031931" Received: from smile.fi.intel.com ([10.237.72.54]) by fmsmga004.fm.intel.com with ESMTP; 06 Mar 2023 03:55:27 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pZ9R6-00GKmb-1k; Mon, 06 Mar 2023 13:55:24 +0200 Date: Mon, 6 Mar 2023 13:55:24 +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 Subject: Re: [PATCH v13 07/10] drm/bridge: anx7625: Register Type C mode switches Message-ID: References: <20230303143350.815623-1-treapking@chromium.org> <20230303143350.815623-8-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: <20230303143350.815623-8-treapking@chromium.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Fri, Mar 03, 2023 at 10:33:47PM +0800, Pin-yen Lin wrote: > Register USB Type-C mode switches when the "mode-switch" property and > relevant ports are available in Device Tree. Configure the crosspoint > switch based on the entered alternate mode for a specific Type-C > connector. > > Crosspoint switch can also be used for switching the output signal for > different orientations of a single USB Type-C connector, but the > orientation switch is not implemented yet. A TODO is added for this. ... > + ctx->port_data = devm_kcalloc( > + dev, switch_desc->num_typec_switches, > + sizeof(struct anx7625_typec_port_data), GFP_KERNEL); I believe I have commented on this (indentation)... > + ...and this (blank line). > + if (!ctx->port_data) { > + ret = -ENOMEM; > + goto unregister_mux; > + } ... > + ctx->port_data[i].orientation = (dp_lanes[0] / 2 == 0) ? > + TYPEC_ORIENTATION_REVERSE : TYPEC_ORIENTATION_NORMAL; I believe that this is an error prone check, you should rather do the opposite, i.e. ' % 2 == 0'. -- With Best Regards, Andy Shevchenko