Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2397976lqp; Sun, 24 Mar 2024 17:45:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVj0MHKXUatLYQp0qD3/jMiZMwstSVEGhYTpr64GQA1F35FVxxm3YdcELc/wGyFjjy6eJe5iA7SzoUIGy98p6UAHSz2YLx6fDowIi3ovA== X-Google-Smtp-Source: AGHT+IFIXVX1QjwOeHxKLdLLydUUQ7+lH/bwdCDil6tuNl2xVWo5Z+Hi0eMLtR3P3nExok3/pArz X-Received: by 2002:a05:6a20:6a0c:b0:1a3:c407:39d8 with SMTP id p12-20020a056a206a0c00b001a3c40739d8mr3256756pzk.45.1711327556566; Sun, 24 Mar 2024 17:45:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711327556; cv=pass; d=google.com; s=arc-20160816; b=mK25RSbROf/M50z7++IbIX+VR3kNi/0fIaxngsqFvj08GGas79WiZtUUq7bkaI8nRK 8noLF63UDMekATCIIggSVvb9Xw42tGpHjhHp5XS0DJyaT0z2L2b2OF+Cb3eH6HziyFnX 0vWYHpCX6+XU5bRC+A+AYkdSjluSBjeme7S2/vLJUzcjyw4QdFTzpbnali9DkMkF57Pk UMOLd3zWzj3syKnqLOxLCQf928IRp13tJ5uSDSaBeyeW4uRF22/tYTVutTaUNPMCj8+s rX1un+juZPHYVooUOgVlfjG2Xu8QN3y+TwU38OvTe48YDaIkByIPjrEnhHp+30R62E+k cbag== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Ng+PwDzAnm7YeGcke1GYbYRnMWR/vtTmfVdCSztxxzM=; fh=TvCTI2UtvmY+buOF3Se+yH8HIg2oy4yuaanJIghw17E=; b=yCdu8CId7q3nJqYH7h9wgJimof0dAFt5VUtBnO9zjtvwSBVFL5WwnwXvCI0xEBe/Q6 eFoj8t9y5kf6YZMk1xfEGfk2boqLNyhZf4q9OJ4UvCwiNiehsB9hGtlHpw82iZA6h8Ej gG6AYoBBKjeiCfOtpEaeWVJ1/HAGFfPWi2GFqOWMi8I+gu6LbaCLQxVEgvDfU+39iNl2 GkGn5hn2b5FbYDq+Bqb/gKMlQMIImuP33XM/vFL69mL3+HBMMYGrifWms4t+qwqPpaZt 7JbGaWdrejCZYvNeeiGcSr3ZCgoq6RZysjzTr/dcDx4ZsXsKJzEIRxFZFsLFMbjCmasO /O9w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lFnP4UBp; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-113416-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113416-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id z8-20020a170902d54800b001e01bb2b383si4385863plf.238.2024.03.24.17.45.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 17:45:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-113416-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lFnP4UBp; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-113416-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-113416-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 940FBB252D1 for ; Mon, 25 Mar 2024 00:31:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 69F586FE14; Sun, 24 Mar 2024 22:43:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lFnP4UBp" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7DEED1A7748; Sun, 24 Mar 2024 22:43:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320218; cv=none; b=sj96FebuRpXvFqj0D5/WcaMZny1gWGRya7bpjzXoS3Fkmok0Dt/nx9H0/fG/o1GmFJUd+PGX9M2WvOhEwa7AT1PB41wc8ucLBLFuFhutYq4eh5UhG94oeByNP90y5HBGULQQ1MooaC8hph5psZtjAKFwbWD/Zdo5ji/GuTLLuyU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711320218; c=relaxed/simple; bh=KnQngKGxdKRkjwaTzXWgBKDVujPnpf3a2kI3BMOlzY0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FSRndEr5YJlp0aMtF1AKIc+jC72ZqleQo9PirY8dNx6I54lw3vjHQjQ0XhzTzCl7Ou2XF+Hfs2D3tQHGDNmsgW9QV0EYEGjZeTIjqAcbyJx5AZU+QqxZ4NxweDf8raFDZf52fCcj1lqAngu8Xy2F1kEipid3z5Oyj2CoCpItaf8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=fail (0-bit key) header.d=kernel.org header.i=@kernel.org header.b=lFnP4UBp reason="key not found in DNS"; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5AB79C433C7; Sun, 24 Mar 2024 22:43:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711320218; bh=KnQngKGxdKRkjwaTzXWgBKDVujPnpf3a2kI3BMOlzY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lFnP4UBp2hhScCUf1ribuZhAF9qP8fu/g5zK8KTUxunzjgY1/6qTp59tKL28CfX00 1j6I93ZvZ8HrL3YYIPhrkmhgCRCgfVnNNTnoSnticuFMgBUbkY7gXpadTuOWzjYP5M y7FbLgRQTq9N8EaSttzQV5B3hSSHxti1jExYcM/c8l4JDou6lALTx+wsxWU6BA39P+ IPx7gLSd+3z1ntjF9teSlyux6vsgc2NwO76+PAh9cWzvMDXVLiXQId6MdhRljRMUKe mW0i5/DcmIk4UxeMpGX5gwMzvrfcNcTxhYuIwnCly1r3DUIoLDejTcfFYab+pdzIHG wM9XrE1wYEyhQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Luca Weiss , Daniel Thompson , Lee Jones , Sasha Levin Subject: [PATCH 6.8 525/715] backlight: lm3630a: Don't set bl->props.brightness in get_brightness Date: Sun, 24 Mar 2024 18:31:44 -0400 Message-ID: <20240324223455.1342824-526-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324223455.1342824-1-sashal@kernel.org> References: <20240324223455.1342824-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit From: Luca Weiss [ Upstream commit 4bf7ddd2d2f0f8826f25f74c7eba4e2c323a1446 ] There's no need to set bl->props.brightness, the get_brightness function is just supposed to return the current brightness and not touch the struct. With that done we can also remove the 'goto out' and just return the value. Fixes: 0c2a665a648e ("backlight: add Backlight driver for lm3630 chip") Signed-off-by: Luca Weiss Reviewed-by: Daniel Thompson Link: https://lore.kernel.org/r/20240220-lm3630a-fixups-v1-2-9ca62f7e4a33@z3ntu.xyz Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/video/backlight/lm3630a_bl.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/video/backlight/lm3630a_bl.c b/drivers/video/backlight/lm3630a_bl.c index 8e275275b808f..26ff4178cc161 100644 --- a/drivers/video/backlight/lm3630a_bl.c +++ b/drivers/video/backlight/lm3630a_bl.c @@ -233,7 +233,7 @@ static int lm3630a_bank_a_get_brightness(struct backlight_device *bl) if (rval < 0) goto out_i2c_err; brightness |= rval; - goto out; + return brightness; } /* disable sleep */ @@ -244,11 +244,8 @@ static int lm3630a_bank_a_get_brightness(struct backlight_device *bl) rval = lm3630a_read(pchip, REG_BRT_A); if (rval < 0) goto out_i2c_err; - brightness = rval; + return rval; -out: - bl->props.brightness = brightness; - return bl->props.brightness; out_i2c_err: dev_err(pchip->dev, "i2c failed to access register\n"); return 0; @@ -310,7 +307,7 @@ static int lm3630a_bank_b_get_brightness(struct backlight_device *bl) if (rval < 0) goto out_i2c_err; brightness |= rval; - goto out; + return brightness; } /* disable sleep */ @@ -321,11 +318,8 @@ static int lm3630a_bank_b_get_brightness(struct backlight_device *bl) rval = lm3630a_read(pchip, REG_BRT_B); if (rval < 0) goto out_i2c_err; - brightness = rval; + return rval; -out: - bl->props.brightness = brightness; - return bl->props.brightness; out_i2c_err: dev_err(pchip->dev, "i2c failed to access register\n"); return 0; -- 2.43.0