Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp851970pxa; Sat, 22 Aug 2020 02:24:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNRfO4pE3z+8xeRF96HCQq3j1lULdNGb13IW9t7NgLgm8S2BmqfWdS1F7QBWTgNu6LNetX X-Received: by 2002:a05:6402:486:: with SMTP id k6mr6637950edv.83.1598088260888; Sat, 22 Aug 2020 02:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598088260; cv=none; d=google.com; s=arc-20160816; b=Je4eqxBf7dXzBT4wTdh5BCGP+C6pR2OzE9ZMG2HuvjFdEiA9hva0mIlBojNkOMGIc7 ep6XaHkqTqdHun8VP7mAVhiukKLX+v5xXG7jYY5Gvd7Uqbd0MMqXTjhg8Gnf3U8i98Ny Iudo/Gs1nHXx8D1isAWASKmXh0IDnnkUm1Ft8mIYEsh5xkB8qnAhnr/DqzEz12XmNE7d Tw0Theco0DRxjkxcrRv+yuXH6L8hBe0lieLgWTnsPML66h3H5uKUF02dwxDIQzgFMiY4 xUM2ElujJdAmjcfrikQH6TSuzklKcriVyaZpIkwdAg04Kbe0k7ycHC2DrXhcC9/thNWu VDKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=moszVQhk0og0XUY/hCLuM4yGTG4UVCtceaZs1BsXb0c=; b=Fi1AFwc2ybdqNg7iiWdr9nfGTPTMD1/e6MMOKgxeWf+vV4gZtiSNR6aIaRiz+qLtp6 naaRW8Sdw6fDBmAlnuzuydyHy/6OPW9xuMkyNPkadzvyA/qvjdN4/dMU3q2aWuL7wwcD A27dy0CLNAXx6FETOg0uY6dwZO7bFd0YhunvPLolAMqhtKZGVcf+Xt2Fc9LcDtnYKCuD fliyU09HegxtrDKjzSbxsxzXtmauRsTM8euonaIOhLcL2jS1yUrYPPdVByznqprDT/Un e2O1pDVBBEqQG6pWOJDRI8SFhAg5FzHjVQx3GL8vAwoccl2n+n6PAp0sbq1yZbnOjHwb e0hA== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b33si3292892edf.62.2020.08.22.02.23.58; Sat, 22 Aug 2020 02:24:20 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726796AbgHVJXL (ORCPT + 99 others); Sat, 22 Aug 2020 05:23:11 -0400 Received: from asavdk4.altibox.net ([109.247.116.15]:53058 "EHLO asavdk4.altibox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725864AbgHVJXL (ORCPT ); Sat, 22 Aug 2020 05:23:11 -0400 Received: from ravnborg.org (unknown [188.228.123.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by asavdk4.altibox.net (Postfix) with ESMTPS id 1FB0180516; Sat, 22 Aug 2020 11:23:08 +0200 (CEST) Date: Sat, 22 Aug 2020 11:23:06 +0200 From: Sam Ravnborg To: Enric Balletbo i Serra Cc: linux-kernel@vger.kernel.org, Jernej Skrabec , drinkcat@chromium.org, Jonas Karlman , David Airlie , Neil Armstrong , dri-devel@lists.freedesktop.org, Andrzej Hajda , Laurent Pinchart , hsinyi@chromium.org, matthias.bgg@gmail.com, Collabora Kernel ML Subject: Re: [PATCH 2/3] drm/bridge: ps8640: Print an error if VDO control fails Message-ID: <20200822092306.GB430436@ravnborg.org> References: <20200615205320.790334-1-enric.balletbo@collabora.com> <20200615205320.790334-3-enric.balletbo@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200615205320.790334-3-enric.balletbo@collabora.com> X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=aP3eV41m c=1 sm=1 tr=0 a=S6zTFyMACwkrwXSdXUNehg==:117 a=S6zTFyMACwkrwXSdXUNehg==:17 a=kj9zAlcOel0A:10 a=QX4gbG5DAAAA:8 a=7gkXJVJtAAAA:8 a=e5mUnYsNAAAA:8 a=cf3U8Ll1wViUF6FddlcA:9 a=CjuIK1q_8ugA:10 a=AbAUZ8qAyYyZVLSsDulk:22 a=E9Po1WZjFZOl8hwRPBS3:22 a=Vxmtnl_E_bksehYqCbjh:22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 15, 2020 at 10:53:19PM +0200, Enric Balletbo i Serra wrote: > 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 Reviewed-by: Sam Ravnborg > --- > > 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 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel