From mboxrd@z Thu Jan 1 00:00:00 1970 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 598A12DECD2 for ; Mon, 5 Jan 2026 16:48:11 +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=1767631693; cv=none; b=Dggz9hl4Xq/MBuoBs0YmXgKFAOuOvZUxElj55eH2GmbvOfU4MopD02GgtcKtS3zoTx0eAlSaei4J/RJ13xEB+DcBZoGd5ck7pSeW//mA85s5sjjtQirEyjbeM19Biok4H6U0uFo0lAp31iHCjjKIiIcNcyb/C3kFRFFEDWBUluQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767631693; c=relaxed/simple; bh=jLsLVHwhRT/MSFbNQgRGSBuD73hDeUcoKpI0w8RueXI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=U0MOzTNBbTFLYSYANYkDfp3kRUOFtbWxuq9wOy7+tjyeVXuXZXT9Dmi9A1oTIltF0hXaBuOqJwJ+etKGIkzcJGfNst1PQEIIyYZd9wFIErcSZPQs5BDk3yxp8IbfEXqohiR3fKpgraehSn5+0S/cVF1KtTconOeY5XWYVZLxxCs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=syuCft8M; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="syuCft8M" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59618C19425; Mon, 5 Jan 2026 16:48:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1767631691; bh=jLsLVHwhRT/MSFbNQgRGSBuD73hDeUcoKpI0w8RueXI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=syuCft8MmyAD1pjTdJwCO1bALP/yMDcQFbJlRZwEIOiwUzDNjKPcMofD/ymr0QHE2 m3xdtY8Y2AUGtq5scCLnKUQ1Jcahnck90DyFCqrc9Htmjow/2WWZThOHETPtMI8/SB WhetmkoeqfqXsnL3vBLjtAy3Bf2epqBzJR2T/7mfP71tOckW8s9IyjcyH/dGnHr7o9 LiylaKGb4tQmE2SQxZKXidt25NXmaDrn5FGMBv2aNGQLc8OcpMMCCCcJmXjWjhBTsE 9+mpHHJjb3y/7fyxFzcBD5dvvqXRR+NPobCDYwD7ARAo6UTtD9aYexYsl3dJRMyRqZ XW1HPXTLJOLMg== From: Sasha Levin To: stable@vger.kernel.org Cc: Andy Shevchenko , Pavel Machek , Sasha Levin Subject: [PATCH 5.10.y 2/4] leds: lp50xx: Get rid of redundant check in lp50xx_enable_disable() Date: Mon, 5 Jan 2026 11:48:06 -0500 Message-ID: <20260105164808.2675734-2-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260105164808.2675734-1-sashal@kernel.org> References: <2026010519-botanical-suds-31fa@gregkh> <20260105164808.2675734-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Andy Shevchenko [ Upstream commit 5d2bfb3fb95b2d448c0fbcaa2c58b215b2fa87fc ] Since GPIO is optional the API is NULL aware and will check descriptor anyway. Remove duplicate redundant check in lp50xx_enable_disable(). Signed-off-by: Andy Shevchenko Signed-off-by: Pavel Machek Stable-dep-of: 434959618c47 ("leds: leds-lp50xx: Enable chip before any communication") Signed-off-by: Sasha Levin --- drivers/leds/leds-lp50xx.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/leds/leds-lp50xx.c b/drivers/leds/leds-lp50xx.c index 66299605d133..35ab4e259897 100644 --- a/drivers/leds/leds-lp50xx.c +++ b/drivers/leds/leds-lp50xx.c @@ -382,11 +382,9 @@ static int lp50xx_enable_disable(struct lp50xx *priv, int enable_disable) { int ret; - if (priv->enable_gpio) { - ret = gpiod_direction_output(priv->enable_gpio, enable_disable); - if (ret) - return ret; - } + ret = gpiod_direction_output(priv->enable_gpio, enable_disable); + if (ret) + return ret; if (enable_disable) return regmap_write(priv->regmap, LP50XX_DEV_CFG0, LP50XX_CHIP_EN); -- 2.51.0