From patchwork Tue Jan 23 14:26:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Philippe CORNU X-Patchwork-Id: 10180393 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AD506601D5 for ; Tue, 23 Jan 2018 14:26:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9CDAE286E6 for ; Tue, 23 Jan 2018 14:26:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 907F8286EF; Tue, 23 Jan 2018 14:26:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 47A90286E6 for ; Tue, 23 Jan 2018 14:26:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=X/9H4aZVPnf/DdfjsAJsNXjU1Ept9lQh3EC6gsCxQ5Q=; b=Hk+T9humLgzVVi MIDGynRYhX7ZXOhRoOizhgTVPLslNNSJB9Guj5HGK/QwcXruqJWXgJNKnSce4t08lJ+6iV8ppiSBT Au994DWhJXN33TLlYA/kIvFCPrtiUOsXd4x0cFYZl5HWAI0ZqUc8jsG800bXgBUXB39asFOG41XcZ mN9tqbTfgFKRH4+rtkdAy9d/MvFR+7mAjuQOGxFYMphTviovzjCNZlvqsbl834Yt7D1q7CMih5/IJ AdjK0CbzlVawFOnlGdOe29cVyRSaJhTa1rQpdgcYt7T2wdSs4VF6x/5E2UtjDr6cYIsE4E9UctmZS LrNGrsOCZ/oT2vvE2cvA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1edzXL-0004aO-UJ; Tue, 23 Jan 2018 14:26:55 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1edzXF-0004WO-U6; Tue, 23 Jan 2018 14:26:51 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w0NEO8p2032072; Tue, 23 Jan 2018 15:26:26 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2fnaj6qj95-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 23 Jan 2018 15:26:26 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id ABB0034; Tue, 23 Jan 2018 14:26:24 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas22.st.com [10.75.90.92]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 80AFA2A99; Tue, 23 Jan 2018 14:26:24 +0000 (GMT) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by Safex1hubcas22.st.com (10.75.90.92) with Microsoft SMTP Server (TLS) id 14.3.352.0; Tue, 23 Jan 2018 15:26:24 +0100 Received: from localhost (10.201.23.32) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.352.0; Tue, 23 Jan 2018 15:26:23 +0100 From: Philippe Cornu To: Archit Taneja , Andrzej Hajda , Laurent Pinchart , David Airlie , Philippe Cornu , Brian Norris , Benjamin Gaignard , Bhumika Goyal , , , "Sandy Huang" , Heiko Stubner , , Subject: [PATCH v1 1/2] drm/bridge/synopsys: dsi: Fix dsi_host_transfer() return value Date: Tue, 23 Jan 2018 15:26:17 +0100 Message-ID: <20180123142618.28384-2-philippe.cornu@st.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180123142618.28384-1-philippe.cornu@st.com> References: <20180123142618.28384-1-philippe.cornu@st.com> MIME-Version: 1.0 X-Originating-IP: [10.201.23.32] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-23_04:, , signatures=0 X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexandre Torgue , Yannick Fertre , Maxime Coquelin , Mickael Reulier , Vincent Abriou , Ludovic Barre Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The dw_mipi_dsi_host_transfer() must return the number of bytes transmitted/received on success instead of 0. Note: nb_bytes is introduced in this patch as it will be re-used with the future dcs/generic dsi read feature. Signed-off-by: Philippe Cornu --- drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c index f458798af788..096cf5e5bb30 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c @@ -403,7 +403,7 @@ static ssize_t dw_mipi_dsi_host_transfer(struct mipi_dsi_host *host, { struct dw_mipi_dsi *dsi = host_to_dsi(host); struct mipi_dsi_packet packet; - int ret; + int ret, nb_bytes; ret = mipi_dsi_create_packet(&packet, msg); if (ret) { @@ -413,7 +413,13 @@ 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; + + nb_bytes = packet.size; + + return nb_bytes; } static const struct mipi_dsi_host_ops dw_mipi_dsi_host_ops = {