From patchwork Mon May 4 09:25:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 63546 X-Patchwork-Delegate: hverkuil@xs4all.nl Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from ) id 1jVXKH-00AuBY-UH; Mon, 04 May 2020 09:23:50 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728399AbgEDJ0n (ORCPT + 1 other); Mon, 4 May 2020 05:26:43 -0400 Received: from perceval.ideasonboard.com ([213.167.242.64]:56776 "EHLO perceval.ideasonboard.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728395AbgEDJ0n (ORCPT ); Mon, 4 May 2020 05:26:43 -0400 Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C0AED122D; Mon, 4 May 2020 11:26:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1588584397; bh=pcrrfsQlmR7SGkG1+Y+oygWKbVvk+y5ojBGVU0ZYFJA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ltVQBUsknkLvRmLx5zTmapkNYE/b1XdY8hnrSL+sZGpo8B4cj79f1VnwGqxIzrzsm 0yC4wK+HKoEIo/ZVUeMrFz9EzqYjECMIoK6yW48kv9oOLhMlW5ReSmRlVGTLTOvBPE Xt8AyXvpOavgKPNRdVv8vMrmobXFdUaQ/cWPeI0c= From: Laurent Pinchart To: linux-media@vger.kernel.org Cc: Kieran Bingham , Jacopo Mondi , =?utf-8?q?Niklas_S=C3=B6derlund?= , Naushir Patuck , Dave Stevenson , Dave Stevenson Subject: [PATCH v2 19/34] staging: mmal-vchiq: If the VPU returns an error, don't negate it Date: Mon, 4 May 2020 12:25:56 +0300 Message-Id: <20200504092611.9798-20-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200504092611.9798-1-laurent.pinchart@ideasonboard.com> References: <20200504092611.9798-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no From: Dave Stevenson There is an enum for the errors that the VPU can return. port_parameter_get was negating that value, but also using -EINVAL from the Linux error codes. Pass the VPU error code as positive values. Should the function need to pass a Linux failure, then return that as negative. Signed-off-by: Dave Stevenson Signed-off-by: Jacopo Mondi --- drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c index 5e7d4263e39b..4e559f88d828 100644 --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c @@ -1395,7 +1395,8 @@ static int port_parameter_get(struct vchiq_mmal_instance *instance, goto release_msg; } - ret = -rmsg->u.port_parameter_get_reply.status; + ret = rmsg->u.port_parameter_get_reply.status; + /* port_parameter_get_reply.size includes the header, * whilst *value_size doesn't. */