Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp2618246lqp; Mon, 25 Mar 2024 04:44:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVIS1xAN/CmjxVyqV/GHz7kjGr9mTPePB/GMJeA+dzdqBKSCGaNo2E554UENQBHVSVz4o2tRWuQy1Vgto1H2yA/3+k5ejO70pbCVsoIlg== X-Google-Smtp-Source: AGHT+IHGcL+8Tt1LWqyctEhyktrsV1HTUVNHxSr79Qz0PGBGbIiDg3oFbBQalpIkrJw/fityK0H4 X-Received: by 2002:a17:907:934c:b0:a4a:aa3b:8002 with SMTP id bv12-20020a170907934c00b00a4aaa3b8002mr832153ejc.15.1711367087003; Mon, 25 Mar 2024 04:44:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711367086; cv=pass; d=google.com; s=arc-20160816; b=jraEgAa7kkfIht2Egk91IvBPbWAtGs45mUYa2qHrw3bFwsPpwyRQ0sm5i7LlKUeZj7 Oh7ULI5ZgFZ0yMnUefp0bovct82PDc+vdTVFzMimRyV+gcsqy7qCWkPDuCzpUB6CGWaa I3EIsv8VHRZLtyzwdSdnYJm7ChTtfNGz2V+AEiBMfojPlW56pzsjjWE6cd9MvtU/ogjt rF3pSqqcF4ajqzcXhB0GUrqLvspabJ5c2Ad1FT5JjvM+/829+dzZJxtafPIilMldLDFA qx4KistBMuEf4C/JyNQD83WVz59hh6a2rd74BOI1rvayyCbQH2cPSkghduxuOuFLtqK+ 6X+g== 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=0AQXSFXZ4RIt8iAGWB2RkoHbcFbsxWYNkyb7tNV/gw8=; fh=TvCTI2UtvmY+buOF3Se+yH8HIg2oy4yuaanJIghw17E=; b=OJx0rBejsFyF+LgzWniML19r4buWBzTXWubKygSSa+q21CYfT0NE47pjXmYIVzstJ1 AtQ3Gu6g7HslVrCd2VmhnlbszKNp5tdC215d8f4TmS+DIM/opqXkT+HrsWTfAPlCVcXS 1DQGDIHNNRP00zpVmLuDC9Xymgl1QID0b7IS5H+oJO24j7UYRJc1TDvgfNJBqd9xXRGH N4gleYVK0UqtyZpLosJ75vJZmfGy4HjkLUc2Fd+ZJUa5C7LzCvlbsUP4S1vRUhvnc3FE sVHOqPN5c1qiVCcwRXtpYeVo9G8lrefHljtO+OpyGdEkDJr+8935Zqz01I9xPzVg3OPZ nW6g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OcUbY8Xq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116198-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116198-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id w16-20020a170906185000b00a46cec3369bsi2492333eje.863.2024.03.25.04.44.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 04:44:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-116198-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=OcUbY8Xq; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-116198-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-116198-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 am.mirrors.kernel.org (Postfix) with ESMTPS id B69B01F36D26 for ; Mon, 25 Mar 2024 11:44:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 28040290BCD; Mon, 25 Mar 2024 03:33:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="OcUbY8Xq" 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 5366317CF4B; Sun, 24 Mar 2024 23:43:26 +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=1711323806; cv=none; b=qIuq+pOK5DnqpRuFE7O2kWzMnYxw6yM96n8dN/ZBTxgucpbO8tftOOZtCT1h4h+zH6WN0+lo0OoX46zJTYHohtkH0LDM4pQ6fB0z4f1B5bo+1rUQQFXSqfH6y8pzXMfkSJ2dEvDW6De9r1j+WnHXjYfydvDHD7yH+1BgsvDCqW4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323806; c=relaxed/simple; bh=GjnkixaYReP4YOiLR6rVD7j38RgaCnm3GMPZmZvMefg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=amMSKSvOoscDrd0bFryZUf9LrvCmQYKSuCX/oBy+4twVhaYgsLNS9nQffzIu37o4F8h9I7KQSKUVwSVFcD6t0Juo7q3fokgUCXQJINQ2POe5dCsPSZX22KfJ4EeOJsNfhfUPjn449SGT613/tsZSVzBBde29LwghslGZKoTbTrg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=OcUbY8Xq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 787BBC433C7; Sun, 24 Mar 2024 23:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711323806; bh=GjnkixaYReP4YOiLR6rVD7j38RgaCnm3GMPZmZvMefg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OcUbY8Xqo/lwdFkWGsON7qSkri1HItutfMmU7mXcP8P8Hp3Rc60LGRTS380CJUsmS YC4ykzxRg/N5+TFrq03+ijSTcHKbnB0U3DbKAW/QWtw0jblvHyddJnjlCI2mZw+uou +vEkckc11Ar9jkwSV1Dx6XYlmvNtQ9qjbvXo4ytWByd4wZDlwQk9w3bDJ3WH5nGK9P M+Ua/xIDV4WOs7JKrJKPnE2TVDPFqGQuMamLaR0u42gxuC48GKgEK2S1sBLcAzsayq 8jnxTG/YhK/ztnBSi7dPe1AhcXGXRNa9c5BViR2VEZBW0lR8XTIF3VNryKhCV2+wJC KppxcafWaO6MA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Luca Weiss , Daniel Thompson , Lee Jones , Sasha Levin Subject: [PATCH 5.10 184/238] backlight: lm3630a: Don't set bl->props.brightness in get_brightness Date: Sun, 24 Mar 2024 19:39:32 -0400 Message-ID: <20240324234027.1354210-185-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324234027.1354210-1-sashal@kernel.org> References: <20240324234027.1354210-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 2aade66db3cf4..2134342c2c97d 100644 --- a/drivers/video/backlight/lm3630a_bl.c +++ b/drivers/video/backlight/lm3630a_bl.c @@ -229,7 +229,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 */ @@ -240,11 +240,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