Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1149496pxv; Fri, 9 Jul 2021 19:35:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoW4MFXanxEsFrubP23V48DNRAqDfE+i5u8UnjOzM9gEL+lZycOSL+gzJp21eN4U55YnUc X-Received: by 2002:a05:6402:4c5:: with SMTP id n5mr49712408edw.322.1625884543901; Fri, 09 Jul 2021 19:35:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884543; cv=none; d=google.com; s=arc-20160816; b=tP8Kj2H3qAoPWuTH+sFVo7xWmJs0J9o774DJjGEKoYetqlzhx1NoFAIVcdpzlvapSf rP5L9f84nXKmbigG2vwNyT8AEWjX0fsKrgbuNBqpAlArMU4Wga9oBRC9eusIJ8fCUZ3L t6jPIIVPN72edAbJVzmKR42m+Pc2fW7AeDenHEJSv3TzAeCu7VGZFw/YKlQ6zTY8ahbm EBcpGaz8YxCsv4gn9r3C4rQHeB0wn2w8ReOFYwd5lMmNTGzBZcSuJzPrZbCQGf04MjX8 K/wcmji6DT0gtHS/9HdtUjtBocLXlpGrT8jZRuozEZ0LWtFD5jy+moWGYS0q0izm/XN3 RtGw== 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=BuqU8MI/YguxkPTHtLXiWakGJDu6lrEtob7yHhUkW40A1fncQpPe3/MUIFtaWt+Cae FYp4eR+QKX2g/0YRDk9b8nhPJrY+F7oOKrZklAhAD1kXoU+nuBKYVSfvEBsDwQw+FseY 1iF2zUZCAQGErkK26VrN6K7jAcTJBxk6KdqF1ckBd5mZt0NlaqM0dtt25ChyMlvY9wk6 DqQWylDWPEhXl5gJBLp8AtNy2Zw6k3EKtT2QuYcvRXzLcCcBzX1vfYmC59jKUsQZpQK2 jvQtArDVFEUne8NCPbD2gUpPiaffFx3DuMrttCLkJ0o3JtL0iQGb2acBvtolBjIlALtx McSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bGCUIewy; 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 hv11si3453753ejc.734.2021.07.09.19.35.20; Fri, 09 Jul 2021 19:35:43 -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=bGCUIewy; 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 S234771AbhGJCeL (ORCPT + 99 others); Fri, 9 Jul 2021 22:34:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:42926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234577AbhGJC3g (ORCPT ); Fri, 9 Jul 2021 22:29:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3EAD7613FD; Sat, 10 Jul 2021 02:26:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625884010; bh=tRb1rL9r1jHfW6knxthlrBoGc/o/vZ5eKhsuyfbMuSQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bGCUIewya6LzvkHWI2UeLomPsOw9jRmC9n7mRJX8oRYhC0cfaDUUhCrOfEKacAKrN JBryl2TFxGPeR02+qoogoFpAbzbaNihPkf3fkOBF8g+eZUvly04W+iZ8rPEs9O34QP Cw9n5hQV6JJnnUPhxcxAmVHPdz/DzIzjxhwRiJjfUJXEaFW9zFgfe3htmMc/gya84m xSPDfAH3MwY62w9QjYroJLSx79tuVgjeD+VpLd0bSOqFiI98TQsp4hV8X3aJOUN5Jc OM7+HHHgz3vs1YSFFImg9EsmvcyruXretnM9KtxLnKo30H+Qjm8QVw3Ks5Src3Y+Ks LBMoAy8o9TNVg== 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.10 82/93] backlight: lm3630a: Fix return code of .update_status() callback Date: Fri, 9 Jul 2021 22:24:16 -0400 Message-Id: <20210710022428.3169839-82-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022428.3169839-1-sashal@kernel.org> References: <20210710022428.3169839-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