From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA585C433E1 for ; Mon, 1 Jun 2020 10:35:30 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 90C0B2065C for ; Mon, 1 Jun 2020 10:35:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="fsw1L05Q" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 90C0B2065C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 188B46E22A; Mon, 1 Jun 2020 10:35:30 +0000 (UTC) Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7E62B6E22A for ; Mon, 1 Jun 2020 10:35:28 +0000 (UTC) Received: by mail-wr1-x442.google.com with SMTP id j10so10936083wrw.8 for ; Mon, 01 Jun 2020 03:35:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=3yMprJOB6nqOhrN9jr1CF0yapMmZvuaPTqFeKcrw+2Y=; b=fsw1L05Qz/4FDV8NzCwmgd24FTeN28K+QoS34P7sLlUDVcWvQzTF46QJ8D54tpZ+pK Zqru6wXiRVK45evrX8qENtf06g41rzGGo/nZeEobKUEe30CKm8I7EU4CbGx/ZEhbpRvR bnw7PX2ghTL7/gm7A3+DKDOCuFuxMWaKILZpTbWFeCrKIbr/hSd9LkAdZAcKb+l29KI9 AQ6s7mglmQKCN6Us6VPNjmp8KvzLsRSMOMvO96k4bjlyfTc2VFdd7EJwbr4fTeunD47s 5rVP4836MSuKRtKApwBdvlfDrWXWbgvbffz7Ntxi5Fehbr1btqKhIIdhHxMB9HRA51i+ KspA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=3yMprJOB6nqOhrN9jr1CF0yapMmZvuaPTqFeKcrw+2Y=; b=EZUQWPvP89nMj0w/mgtT+XWmbNINsR/2RJsiSp5gmr8y+S+//fUFGDDp2NrtFTaeFJ ke7Xuqd8GOSH4qZHZaSfTH+UfGJUDvk3aD36B0Y10XY6Bck8+MhT4aKwdVpPpmdxqgSs EDjJMYP5/81VQwZevO8CQ7buWr9M1uaM2KbljdB779wMvmxKCYgpkYzjg2/tm2ro7iax NsTKXwe/2bFtdYqNCWPlZzPhSpBqWo1dKG8PG0mpZ5VokND8Y+nb5ksAqunNQ4vf1oF/ W/WlEhXK5XhekGK/qR0h+ZwnDRUaFEGf5chPPjEgSQHpA5G8BU2K//OLgHCpHg8aPC7J Zbcg== X-Gm-Message-State: AOAM531OhuRow3sXyI6naJk0eK+MwnGDvbKWJh+DbEhQ/t/nDK3ItcRs f8DQpERtSQBvZsOTcidQKUpYcg== X-Google-Smtp-Source: ABdhPJz1z5Xyl0EPe0FMzDrgOajVzdCQh/7ByOZrzFwdH9HFfHFURa8zQ834mH8R2xVkmWzkakVlyw== X-Received: by 2002:a5d:4390:: with SMTP id i16mr20377364wrq.186.1591007727070; Mon, 01 Jun 2020 03:35:27 -0700 (PDT) Received: from holly.lan (cpc141214-aztw34-2-0-cust773.18-1.cable.virginm.net. [86.9.19.6]) by smtp.gmail.com with ESMTPSA id i10sm4557577wrw.51.2020.06.01.03.35.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jun 2020 03:35:26 -0700 (PDT) Date: Mon, 1 Jun 2020 11:35:24 +0100 From: Daniel Thompson To: Sam Ravnborg Subject: Re: [PATCH v3 12/13] backlight: as3711_bl: introduce backlight_is_blank() Message-ID: <20200601103524.7s6523ijpfqcolrm@holly.lan> References: <20200601065207.492614-1-sam@ravnborg.org> <20200601065207.492614-13-sam@ravnborg.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200601065207.492614-13-sam@ravnborg.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Bjorn Andersson , Peter Ujfalusi , Thierry Reding , Lee Jones , Jonathan Corbet , Tomi Valkeinen , Uwe Kleine-Konig , linux-pwm@vger.kernel.org, Michael Hennerich , Bartlomiej Zolnierkiewicz , linux-arm-msm@vger.kernel.org, Support Opensource , Jingoo Han , Emil Velikov , Andy Gross , Thomas Zimmermann , patches@opensource.cirrus.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Mon, Jun 01, 2020 at 08:52:06AM +0200, Sam Ravnborg wrote: > Replaces the open-coded checks of the state, with the > backlight_is_blank() helper. This increases readability > of the code and aling the functionality across the drivers. > > Futhermore drop the debug prints in update_status(). > If we need debug printing then we can add it to the backlight core. > > Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Thompson > Cc: Lee Jones > Cc: Daniel Thompson > Cc: Jingoo Han > Cc: Emil Velikov > --- > drivers/video/backlight/as3711_bl.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/drivers/video/backlight/as3711_bl.c b/drivers/video/backlight/as3711_bl.c > index 33f0f0f2e8b3..cc5628beaffd 100644 > --- a/drivers/video/backlight/as3711_bl.c > +++ b/drivers/video/backlight/as3711_bl.c > @@ -107,13 +107,7 @@ static int as3711_bl_update_status(struct backlight_device *bl) > int brightness = bl->props.brightness; > int ret = 0; > > - dev_dbg(&bl->dev, "%s(): brightness %u, pwr %x, blank %x, state %x\n", > - __func__, bl->props.brightness, bl->props.power, > - bl->props.fb_blank, bl->props.state); > - > - if (bl->props.power != FB_BLANK_UNBLANK || > - bl->props.fb_blank != FB_BLANK_UNBLANK || > - bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK)) > + if (backlight_is_blank(bl)) > brightness = 0; > > if (data->type == AS3711_BL_SU1) { > -- > 2.25.1 > _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel