Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1952518ybt; Mon, 15 Jun 2020 13:55:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyerha0w0jTABo9eiD87/Y9Pn8jwivoeqkKFOI+gTqTpfsnLGUlUL2fkh436Cw0Ay+kJ0dL X-Received: by 2002:a17:906:5283:: with SMTP id c3mr25724095ejm.22.1592254544345; Mon, 15 Jun 2020 13:55:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592254544; cv=none; d=google.com; s=arc-20160816; b=UN0UPpfp2Pp+3zZwkds0f7+tHkVo4+kaQi9nwEnwtBArsmrdL32hMDRP8S1aiavy4u BvL6yykbOCFbpWmb6Y+JTQgnpFP/jHNx/M7M16wY/So1Wgx054+6Ov1f1SihIccbGDV5 7EHvg55ItAkyEIs4I1hdM60tz9Qp5UDvJrhVeq3jxaGDMBS6wbdFazSx8Jcc/wx+3VnI 5eJmVL/FDAqFSeCMAJDQ88NTYdIsd9ZRD3kVgagXU3sJWCFq6Z3rFTU0WEKywPdlA8sp E/LHPTjeU9hYC8in6/2ZuVfe0MIDw8i8AWXq/UFTRTTig5JAbcJbD3P2YEsmjO/n/ER6 2AJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Eb52JnJFN+MFOZDKHhToM4elFm8Sbd5W7CVDkvlQxJI=; b=eo2Coo2PNian6y+EaawH8uw5VxtosXIRXj6yfD/uzb5PeMk88jUoB1yG0M5g+RBqZk V6lg6Vs8P1DnkdspT5zPOyf1d2w8GCZ8S1t5IkZC2LGF8pRJBuNllIftKSlLFcrly84a /sKxjQfOQAn6a97i+zT0BhYFwHNTbMEYj3zosVExkfGfULnYp7fHCUdB/QJZS1BE73iP lTfi+JUNcR7vJrlPPxEu0xoQx4aouCsq6h25vnqCO8qzf6Rq6R0Im4gwwniBNQ1uPH/z CSQn8zcKoQEuKxcxd/ErBkyyf6bfoy8nPrV3XRCP7pzIgEkG+RnV/KJpKoqDKZ9xdP1d 01LQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c10si10505473edj.163.2020.06.15.13.55.22; Mon, 15 Jun 2020 13:55:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731654AbgFOUxe (ORCPT + 99 others); Mon, 15 Jun 2020 16:53:34 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:37444 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731624AbgFOUxc (ORCPT ); Mon, 15 Jun 2020 16:53:32 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 72B8A2A1807 From: Enric Balletbo i Serra To: linux-kernel@vger.kernel.org Cc: Collabora Kernel ML , matthias.bgg@gmail.com, drinkcat@chromium.org, hsinyi@chromium.org, laurent.pinchart@ideasonboard.com, sam@ravnborg.org, Andrzej Hajda , Daniel Vetter , David Airlie , Jernej Skrabec , Jonas Karlman , Laurent Pinchart , Neil Armstrong , dri-devel@lists.freedesktop.org Subject: [PATCH 2/3] drm/bridge: ps8640: Print an error if VDO control fails Date: Mon, 15 Jun 2020 22:53:19 +0200 Message-Id: <20200615205320.790334-3-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200615205320.790334-1-enric.balletbo@collabora.com> References: <20200615205320.790334-1-enric.balletbo@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Print an error message inside ps8640_bridge_vdo_control() function when it fails so we can simplify a bit the callers, they will only need to check the error code. Signed-off-by: Enric Balletbo i Serra --- drivers/gpu/drm/bridge/parade-ps8640.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/bridge/parade-ps8640.c b/drivers/gpu/drm/bridge/parade-ps8640.c index ce3e8b2da8c9b..9f7b7a9c53c52 100644 --- a/drivers/gpu/drm/bridge/parade-ps8640.c +++ b/drivers/gpu/drm/bridge/parade-ps8640.c @@ -82,8 +82,11 @@ static int ps8640_bridge_vdo_control(struct ps8640 *ps_bridge, ret = i2c_smbus_write_i2c_block_data(client, PAGE3_SET_ADD, sizeof(vdo_ctrl_buf), vdo_ctrl_buf); - if (ret < 0) + if (ret < 0) { + DRM_ERROR("failed to %sable VDO: %d\n", + ctrl == ENABLE ? "en" : "dis", ret); return ret; + } return 0; } @@ -150,10 +153,8 @@ static void ps8640_pre_enable(struct drm_bridge *bridge) } ret = ps8640_bridge_vdo_control(ps_bridge, ENABLE); - if (ret) { - DRM_ERROR("failed to enable VDO: %d\n", ret); + if (ret) goto err_regulators_disable; - } /* Switch access edp panel's edid through i2c */ ret = i2c_smbus_write_byte_data(client, PAGE2_I2C_BYPASS, @@ -175,9 +176,7 @@ static void ps8640_post_disable(struct drm_bridge *bridge) struct ps8640 *ps_bridge = bridge_to_ps8640(bridge); int ret; - ret = ps8640_bridge_vdo_control(ps_bridge, DISABLE); - if (ret < 0) - DRM_ERROR("failed to disable VDO: %d\n", ret); + ps8640_bridge_vdo_control(ps_bridge, DISABLE); gpiod_set_value(ps_bridge->gpio_reset, 1); gpiod_set_value(ps_bridge->gpio_powerdown, 1); -- 2.27.0