From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751515AbeAYKiw (ORCPT ); Thu, 25 Jan 2018 05:38:52 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:37562 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750769AbeAYKiu (ORCPT ); Thu, 25 Jan 2018 05:38:50 -0500 From: Philippe Cornu To: Archit Taneja , Andrzej Hajda , Laurent Pinchart , David Airlie , Philippe Cornu , Brian Norris , Benjamin Gaignard , Bhumika Goyal , , , "Sandy Huang" , Heiko Stubner , , CC: Yannick Fertre , Vincent Abriou , Alexandre Torgue , "Maxime Coquelin" , Ludovic Barre , Mickael Reulier Subject: [PATCH v2 2/2] drm/bridge/synopsys: dsi: Fix dsi_host_transfer() return value Date: Thu, 25 Jan 2018 11:38:00 +0100 Message-ID: <20180125103800.1999-3-philippe.cornu@st.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180125103800.1999-1-philippe.cornu@st.com> References: <20180125103800.1999-1-philippe.cornu@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.129.7.153] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-25_03:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The dw_mipi_dsi_host_transfer() must return the number of bytes transmitted/received on success instead of 0. Note: As the read feature is not implemented, only the transmitted number of bytes is returned for the moment. Signed-off-by: Philippe Cornu --- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index 72ecaeb40822..090bf62d1ea8 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -419,7 +419,16 @@ static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host, dw_mipi_message_config(dsi, msg); - return dw_mipi_dsi_write(dsi, &packet); + ret = dw_mipi_dsi_write(dsi, &packet); + if (ret) + return ret; + + /* + * TODO Only transmitted size is returned as actual driver does + * not support dcs/generic reads. Please update return value when + * delivering the read feature. + */ + return packet.size; } static const struct mipi_dsi_host_ops dw_mipi_dsi_host_ops = { -- 2.15.1