Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1145472pxv; Fri, 9 Jul 2021 19:27:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnXAVnNJDeHH5KLoG0WwEo0lRKQ6+9UdhoQQm5CULDIG7VwbAtHzvhU+j66E5TbeHXqZvx X-Received: by 2002:a17:906:1487:: with SMTP id x7mr40150663ejc.456.1625884054438; Fri, 09 Jul 2021 19:27:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884054; cv=none; d=google.com; s=arc-20160816; b=MtRYtawvREo1BrbRZmznt2zy9TIsH5/mJt2vq4Ipy7E4DDIS+RDjgx0cQ59e2Wx+7u uGURAJldWGPAnVxbGgz8mYtO7MbVaipuQOlX3kVZfU8b0QtJQs4Seoym0s0J36aUjHlo 37hNKJjYlr7IAr3IDKWnq711QXQ8aaPpsXQimeH5gfeh3/1XaewR3j05IEA543In6bPt WlPiVvmrQYl8QYYT7pjd27HPyqJ1A5/+no5fh/x5XeQTAoO1zWB1E5X99YYR7LlNB/02 ojQ3OItHFvCc7e3GgUHPMlUHgHMGmpbblM99xHLex8BjQ6i/669roSlP0EwBPj2dMLC/ Y4gw== 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=fVTsUcpA+ZElTtZ/r99nLK8LhYexOMplt/uW8ZhspMo=; b=qX+etRG6VyS1AXCCl4lh4/Pe+rbIz5+t85icuwmWpKpQPKmizq4QAoqWYQvanl07ka XOASIzSO2i8ZL4raPfheH6tZuMB9W2BP1hsJ/k4nf104WOnYyB8ebvL1aDmXsGygWw8Y 43Zz4ahhMrvugC3dQc/2OC3wOQUasbadHuhFNn6Grx2srg9pIqCPvaptmN5H63JBMIAE ygwFs/RVnxpv2QnaofIYsqHwzctHnBgIx45QbDZ/E+0rzQaW+Bt8o9pPmYu7ZcxDSFfy 5PymgHJ4ogIdp3Jf3N+nszfUzW2z/uGVUD3RKX8QLgaBcw6d3CesPKaa9iidZelWqX8r BjrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JRRoM5RE; 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 x18si9096884edd.315.2021.07.09.19.27.11; Fri, 09 Jul 2021 19:27:34 -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=JRRoM5RE; 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 S233541AbhGJC2r (ORCPT + 99 others); Fri, 9 Jul 2021 22:28:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:42542 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233685AbhGJC05 (ORCPT ); Fri, 9 Jul 2021 22:26:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D5722613F7; Sat, 10 Jul 2021 02:24:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883849; bh=tRb1rL9r1jHfW6knxthlrBoGc/o/vZ5eKhsuyfbMuSQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JRRoM5REPs5+yPQ4tSwce3OPKUFk/aYyShGMXUcV0tbctp5uKYbSU8uwx5t8VzEDK 001LFLCp1kgsEakWt+sTZBS+RuoqHQ5nXfFTaqSlgZooKQrnSI8LD6h/Ftqh0eFhvW 5d9Wg5o/whmmJlMYgzsMb+a7WARK2aTQ+CUMEbkWuioHQU9hnmN592Ulg/I4Zl0jpK 862RDdHo/do42OKI/QzrPw3qfEb9XVP2uFw8ZSz1KB58kF6vO48L002sT8DrbXFfpE uoPtY50zHuzFSyZHZJush3IrWO3vWTKhjly9iSopDUl/spgWQKo3J+maqnlJEs55vv rql9dLLrtVq1g== 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 5.12 093/104] backlight: lm3630a: Fix return code of .update_status() callback Date: Fri, 9 Jul 2021 22:21:45 -0400 Message-Id: <20210710022156.3168825-93-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022156.3168825-1-sashal@kernel.org> References: <20210710022156.3168825-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 e88a2b0e5904..7140b0d98082 100644 --- a/drivers/video/backlight/lm3630a_bl.c +++ b/drivers/video/backlight/lm3630a_bl.c @@ -190,7 +190,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 */ @@ -210,8 +210,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) @@ -267,7 +267,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 */ @@ -287,8 +287,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