Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2630742lqp; Mon, 25 Mar 2024 05:07:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVFWi0V0g2Kgn3G52DD13/GXnr+Nfd/xJV4ET1pjCKhYL1mhQYHUrYWA4882WK/Ht/fboUK//6SrVlR/VLaMbCed19+GvQUCdeHKK2FbA== X-Google-Smtp-Source: AGHT+IHvoyaIYxoi2/irdPzqO5tUowOLxYzfv/pOUjY5iya6lLs+TqXL00Mu0SSehMF1CBSlkEt4 X-Received: by 2002:a17:90a:c7c4:b0:2a0:4ef8:182a with SMTP id gf4-20020a17090ac7c400b002a04ef8182amr8476952pjb.21.1711368458138; Mon, 25 Mar 2024 05:07:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711368458; cv=pass; d=google.com; s=arc-20160816; b=znxkQkAXgV2eg4gWXlnGxhqrzEc6ivnHXVw+V/W2fV/LPZ+rs+bjG4ffqeHpBIZ2wu 7jDiD2Uv/tnk0F9GsxTWFY54KPE/eOAWQE+7o+KgUYXLAg/jMpwtSJvTMGy3bS9ioPgC HR+u2dJ8CXiFKGCz4bo2yU5qKaQlevjcVByEScdodyn07CzuEQP5VtZnREWRjz8W0aFp Lo8vuHYzx6qx7fUtpZfUNNswUwAgHhgxYKbp40T+T6vV8o97xBfc3fw0ezfAnQ3PaXI9 WlDze5+DofcQ7lP8olXtTx7JC48FTGrzSz3nIBf9aZ5OTtiEXbRXP+vO+tZUCTOir9ga +cXg== 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=rD18aLuMbTiaPCcrQCOAib4KCZ/KPB7dewUpZ8jxV0c=; fh=TvCTI2UtvmY+buOF3Se+yH8HIg2oy4yuaanJIghw17E=; b=E2Ogk67B7nN9ZuaevCgjZpZ1S3IHuLcSy0Fe6YmlAAWa8zci5wNGLB5VMRUAzlZJi+ xu+guJGjYgVrqToWjNYTwrLU/kCvaF7KeVL2G29Du9nQkzSCdq7+Ay7jhEfIoP9ejVlg oD1+mWz70hWdxU0yuZBMApiv2L2FGADI8kcRPWWSFAiacmx5qVfBo1BBFp+s45QLvEMo W9zKwuQqPctFeWPPX4DkdPeEkGkQzD+ouZLyyqOOuyUFLb3jMLiA9Kf+GbLe5az4Brkb pSyFVdhok5Ot9/6jmJQpx+aXMmUBz6D+LS1HjmE6aHjMUy4crNWibYLPa0IO10+HtLqu m9TQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gOOZJtJi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115969-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115969-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. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id o8-20020a17090ac70800b0029b7ee70f54si7383300pjt.126.2024.03.25.05.07.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 05:07:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-115969-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gOOZJtJi; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-115969-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-115969-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 26ED9B2E0AD for ; Mon, 25 Mar 2024 09:56:16 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 097DE170A36; Mon, 25 Mar 2024 03:04:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gOOZJtJi" 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 31563232117; Sun, 24 Mar 2024 23:17:37 +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=1711322257; cv=none; b=uNs+wNTK/TGEFns+T+rAix9wzacY5sYW71yDtkq3chaMX/L+XvEEcb/xvp7U5UABa1yh0A1oyQN85Jg7nIocDjuFqCBG4VdkxpztQIpAhFrSZ7A6R3bIHLGD9g9K1Kg5kdYyJe+yMQqGa7FxZsBpD3BYSYzlfn4KHzlhkL5ieGA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711322257; c=relaxed/simple; bh=qSKxe6142rJK0Ne88XZvstcmyQSGACKS9WVwUqirlh0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W/eHQpFCM1yLtez1w4NVTzKQY9h/elZBnjeWdbVSSF1W3xgjwKZ5sC5+yB6Rhh9/aa3Tu2uiQ+PI3IHD7ADNS4Up36tSO0PyLN5+TJ8QiFvEFt4YgSDyzm+JE94bsx6QeDmX3wTJsYp3vVVrIchGhQS3jftmal1fkRxueJztNuA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gOOZJtJi; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5C377C43399; Sun, 24 Mar 2024 23:17:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711322257; bh=qSKxe6142rJK0Ne88XZvstcmyQSGACKS9WVwUqirlh0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gOOZJtJiw5aG/W42OcMtxjZhQh+/MsTYA8i3K30bxlYlB0ocyORvMqt0uhNPuYJNY zL65MyqMBC8MS79pGQOa9HJ9Y7idGAMfrn442U3tRNmXTWdJWv2qUFxdgisues2av1 SfgcUypOIIkwWFWv62o7WBDG615/gSsNwRsanxZoOXPngYopOwZF1CYPEFEOf0tY4R DfE/sIIEdhGUN9rqmcInETFB4VvoMHgwr5yd3GtsHaWP2JFK5yPy4bI7gRGw9YZqRi LISDA+EHSDM7uH2c0XxH9QKuUQtU7et0qzNoGDs6D3R03uqCb8qzuJZH/SjayaQGeA ROS7X4b+1Spqg== 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.1 339/451] backlight: lm3630a: Don't set bl->props.brightness in get_brightness Date: Sun, 24 Mar 2024 19:10:15 -0400 Message-ID: <20240324231207.1351418-340-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324231207.1351418-1-sashal@kernel.org> References: <20240324231207.1351418-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 855c275754578..0d43f6326750f 100644 --- a/drivers/video/backlight/lm3630a_bl.c +++ b/drivers/video/backlight/lm3630a_bl.c @@ -231,7 +231,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 */ @@ -242,11 +242,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; @@ -306,7 +303,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 */ @@ -317,11 +314,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