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 X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 00950C433DB for ; Tue, 26 Jan 2021 14:12:52 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BB3C122B3B for ; Tue, 26 Jan 2021 14:12:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB3C122B3B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=r1Mqu2OIrqo0BlrDWRChS8yGtyFnSzkRYFapCdfRt2Y=; b=zRzV2Hev9l42KQNx+ovibgD8h tbjhW351XWI/h33IbSAcNwU68uh1f4G4u4KLdvYoGOgm1yaHNbMRF41BANsFct94EZHZX5+QvCDKV KI7xyVZ4T8Pnpzt6l6wTbT5La3ibgolsQ0NaRyLo4ND4JE0aTuXtdSBOZpMOQMlR1h36L8hK6aV/k WzVmIphFppFhPuriMDne3ND/2ezG6sAlLha5Sf7OZ5S5C5tJlqnDAuf1t6t84jASh1iN7O0MgKO4U R2NIfHV4ZmKF2zmbdopgoc1Siy2sA5uoLSvFpfEFUdqCzaFwsEIpV+ix601kSwydxjZC4PpmT/Axu fmGvgWvVQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4P3S-0000A7-RF; Tue, 26 Jan 2021 14:10:50 +0000 Received: from perceval.ideasonboard.com ([2001:4b98:dc2:55:216:3eff:fef7:d647]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l4P3N-00008m-CD for linux-arm-kernel@lists.infradead.org; Tue, 26 Jan 2021 14:10:49 +0000 Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E15602C1; Tue, 26 Jan 2021 15:10:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1611670242; bh=WQ7PZkJAI5LGgDKAbdMJf4gHNVYYYdDYBmqgv1rqQew=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XD/Yx8A3Vx0BvOy3NV9cifiHPUc/PXZNJAU7nWnKpKEUaFmhrnrdXdoCjT4ElopjY jJJclLaAnuSIOOL16lRQ92LetMQs5lakQwqgf6L2gl/K5NI96d3Ppih5/iHLC3wN19 Kc/QPQU3+MJ+VAZrdPPuZ/+IolACq8X3/CpXqdtU= Date: Tue, 26 Jan 2021 16:10:22 +0200 From: Laurent Pinchart To: Maxime Ripard Subject: Re: [PATCH RESEND v3 1/6] drm/of: Change the prototype of drm_of_lvds_get_dual_link_pixel_order Message-ID: References: <6169dd15782627c8415583881fa94ba39c4f5221.1601910923.git-series.maxime@cerno.tech> <20201011230030.GD3944@pendragon.ideasonboard.com> <20201118174805.cm67sluusovz5n6a@gilmour.lan> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201118174805.cm67sluusovz5n6a@gilmour.lan> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210126_091045_811040_342A8E8B X-CRM114-Status: GOOD ( 25.53 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, David Airlie , Maarten Lankhorst , dri-devel@lists.freedesktop.org, Chen-Yu Tsai , Rob Herring , Thomas Zimmermann , Daniel Vetter , Frank Rowand , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Maxime, On Wed, Nov 18, 2020 at 06:48:05PM +0100, Maxime Ripard wrote: > On Mon, Oct 12, 2020 at 02:00:30AM +0300, Laurent Pinchart wrote: > > > -static int drm_of_lvds_get_remote_pixels_type( > > > - const struct device_node *port_node) > > > +static int drm_of_lvds_get_remote_pixels_type(const struct device_node *endpoint) > > > { > > > - struct device_node *endpoint = NULL; > > > - int pixels_type = -EPIPE; > > > + struct device_node *remote_port; > > > + int pixels_type; > > > > > > - for_each_child_of_node(port_node, endpoint) { > > > - struct device_node *remote_port; > > > - int current_pt; > > > - > > > - if (!of_node_name_eq(endpoint, "endpoint")) > > > - continue; > > > - > > > - remote_port = of_graph_get_remote_port(endpoint); > > > - if (!remote_port) { > > > - of_node_put(remote_port); > > > - return -EPIPE; > > > - } > > > - > > > - current_pt = drm_of_lvds_get_port_pixels_type(remote_port); > > > + remote_port = of_graph_get_remote_port(endpoint); > > > + if (!remote_port) { > > > of_node_put(remote_port); > > > > You can drop this line. > > > > > - if (pixels_type < 0) > > > - pixels_type = current_pt; > > > - > > > - /* > > > - * Sanity check, ensure that all remote endpoints have the same > > > - * pixel type. We may lift this restriction later if we need to > > > - * support multiple sinks with different dual-link > > > - * configurations by passing the endpoints explicitly to > > > - * drm_of_lvds_get_dual_link_pixel_order(). > > > - */ > > > > Shouldn't we keep this check when endpoint_id is -1 in > > drm_of_lvds_get_dual_link_pixel_order() ? > > I tried to do that, and I'm not quite really sure how to go around it. > > This scans all the endpoints in a given port. > > However, now that we have the device, port id and endpoint id, we need > to use of_graph_get_port_by_id to get the port matching the device and > port id, and iterate over all its endpoint as done here. > > The trouble is that of_graph_get_port_by_id expects a !const > device_node, yet drm_of_lvds_get_dual_link_pixel_order (and seems to be > doing so rightfully), so that creates a warning because we drop the > const there. of_graph_get_port_by_id() doesn't seem to modify the device_node passed to it, couldn't it be modified to take a const pointer ? > Changing the prototype to passing only the port device_node doesn't > really work either, since it would be const, and we would need to call > of_graph_get_endpoint_by_regs (so having the parent device_node, through > of_graph_get_port_parent) and of_graph_get_port_parent takes a !const > port device_node. > > I guess we could drop const entirely from our function, but that doesn't > look right either.. -- Regards, Laurent Pinchart _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel