Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1151452pxv; Fri, 9 Jul 2021 19:39:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRuFCGY0+DFPzONf67sxkHr6oQERXc+F5EGQU0ZpFTGhWektMyDgn+EeyE2oe4ElhsDiVw X-Received: by 2002:a92:bf0b:: with SMTP id z11mr30408568ilh.60.1625884799601; Fri, 09 Jul 2021 19:39:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884799; cv=none; d=google.com; s=arc-20160816; b=y1ZrbTUVqzCiASPniXdlb1OqvxXEFXslPFk0qZs8BdcXWlVy/PvW+NYTEhPYoLIi0Z MZA4P/yYhCdAyprxax6TryEIxizkgpG4xGpwJzPqGZRkeiKH/vMNs9oQ6fxWZOZbnh1K MIx2476UEfkEWNZQGTYZJi5NRfkmacZSmzOBa+BbOW/cKc6zwtxqlTEkptGI9/hMMCsx 1YjCmgP3zQ3hVW6Sljx5Kg3giVySBvnlA073mV7qT07G29R/yUv+c9TLHJ2NdxPVnenl oyMYOPW8RQ/XbL4rnoIpDfcKntIV4kTe4JwgGC6/deLUoPR8eKONjZDIUhs4upuZ43JH IrVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aeWP8necjghAEuk2dwR6ijsXd2laSiPY+PHHsOVCAho=; b=0/5gZH8k2kyzx8vaBl/WwF5rtijYghXGQELAIMaeINqBPTd+QlThDaI8L3ykdPO7uC 0xd3trjSyOdque7iGaro7Guhr+Wk3rjP60mKG0GDftA42gSosPTfdUhbsp1GdP0fRfkH YWez51a0MGYviwcHVF4NQBpCtK7US0H4yR3fVlkCvRGbw1AicjZs9xGYtlh7gEVkfIfp mr9n5Kqjp1LFzec4ok19S2HHRmTXibLtuieTt2gkl8XpPsIBjbGkEGfMgx0neY8TI8gO 6CAeUfhW7wZ6CjmWGhQfPsmtd0S/+g7rdof0gykg2sVMsBfuIdDtw6a9pdglR67jCTrn 68iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n8zaVreU; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o18si2971972jah.71.2021.07.09.19.39.47; Fri, 09 Jul 2021 19:39:59 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=n8zaVreU; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234682AbhGJCmH (ORCPT + 99 others); Fri, 9 Jul 2021 22:42:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:58368 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234886AbhGJCjR (ORCPT ); Fri, 9 Jul 2021 22:39:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C2DAC613EB; Sat, 10 Jul 2021 02:35:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625884506; bh=lAu+LTAR349mDL0w4BHlXProjoot0ns5zpTda0DaVLw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n8zaVreUzXkhMDgzdqi/E5WDXJbQAZvzSmJF/86P2q/H/n6qwHX3tevrbG2bRtY6b WZJ3f3Cc3Y76JMRDlo+e5oRbsEb1NMK8eITl9Wg/mMM8XSqn+kKg9gZd0MJ2HUY3ga iZYU2YktMNEH9z8Ngi4LizVaU4z8V/7nQNllQysnAG+pRgyD9vPM1jtSiOxNK9BIZK P1oUISXisaLWCFQCo4BCUqBvL7sUldTkPwTAXp7gpvpQD7zz50GkYpY+qAJVczTlOx ncYPDrcR4LjuYM8qjtQxOJWT4IEHBjg5EUNRVfNdAntW4ZrqIY1v8u2XcC/Kn4Cvkq 213OabovX61Ug== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Daniel Thompson , Lee Jones , Sasha Levin , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 33/39] backlight: lm3630a: Fix return code of .update_status() callback Date: Fri, 9 Jul 2021 22:31:58 -0400 Message-Id: <20210710023204.3171428-33-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710023204.3171428-1-sashal@kernel.org> References: <20210710023204.3171428-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Uwe Kleine-König [ Upstream commit b9481a667a90ec739995e85f91f3672ca44d6ffa ] According to .update_status() is supposed to return 0 on success and a negative error code otherwise. Adapt lm3630a_bank_a_update_status() and lm3630a_bank_b_update_status() to actually do it. While touching that also add the error code to the failure message. Signed-off-by: Uwe Kleine-König Reviewed-by: Daniel Thompson Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/video/backlight/lm3630a_bl.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c index ef2553f452ca..f17e5a8860fa 100644 --- a/drivers/video/backlight/lm3630a_bl.c +++ b/drivers/video/backlight/lm3630a_bl.c @@ -184,7 +184,7 @@ static int lm3630a_bank_a_update_status(struct backlight_device *bl) if ((pwm_ctrl & LM3630A_PWM_BANK_A) != 0) { lm3630a_pwm_ctrl(pchip, bl->props.brightness, bl->props.max_brightness); - return bl->props.brightness; + return 0; } /* disable sleep */ @@ -204,8 +204,8 @@ static int lm3630a_bank_a_update_status(struct backlight_device *bl) return 0; out_i2c_err: - dev_err(pchip->dev, "i2c failed to access\n"); - return bl->props.brightness; + dev_err(pchip->dev, "i2c failed to access (%pe)\n", ERR_PTR(ret)); + return ret; } static int lm3630a_bank_a_get_brightness(struct backlight_device *bl) @@ -261,7 +261,7 @@ static int lm3630a_bank_b_update_status(struct backlight_device *bl) if ((pwm_ctrl & LM3630A_PWM_BANK_B) != 0) { lm3630a_pwm_ctrl(pchip, bl->props.brightness, bl->props.max_brightness); - return bl->props.brightness; + return 0; } /* disable sleep */ @@ -281,8 +281,8 @@ static int lm3630a_bank_b_update_status(struct backlight_device *bl) return 0; out_i2c_err: - dev_err(pchip->dev, "i2c failed to access REG_CTRL\n"); - return bl->props.brightness; + dev_err(pchip->dev, "i2c failed to access (%pe)\n", ERR_PTR(ret)); + return ret; } static int lm3630a_bank_b_get_brightness(struct backlight_device *bl) -- 2.30.2