Skip to contentSkip to conversation

FAILED: patch "[PATCH] i2c: synquacer: Deal with optional PCLK correctly" failed to apply to 6.6-stable tree

PATCH [email protected] 1 participant 1 message Oct 7, 2024

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x f2990f8630531a99cad4dc5c44cb2a11ded42492
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2024100754-daylight-mountable-26f0@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..

Possible dependencies:

f2990f863053 ("i2c: synquacer: Deal with optional PCLK correctly") e6722ea6b9ed ("i2c: synquacer: Remove a clk reference from struct synquacer_i2c") 55750148e559 ("i2c: synquacer: Fix an error handling path in synquacer_i2c_probe()")

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From f2990f8630531a99cad4dc5c44cb2a11ded42492 Mon Sep 17 00:00:00 2001
From: Ard Biesheuvel <[email protected]>
Date: Thu, 12 Sep 2024 12:46:31 +0200
Subject: [PATCH] i2c: synquacer: Deal with optional PCLK correctly

ACPI boot does not provide clocks and regulators, but instead, provides the PCLK rate directly, and enables the clock in firmware. So deal gracefully with this.

Fixes 55750148e559 ("i2c: synquacer: Fix an error handling path in synquacer_i2c_probe()")
Cc [email protected] # v6.10+
Cc Andi Shyti <[email protected]>
Cc Christophe JAILLET <[email protected]>
drivers/i2c/busses/i2c-synquacer.c +3 -2
index 4eccbcd0fbfc..bbb9062669e4 100644
@@ -550,12 +550,13 @@ static int synquacer_i2c_probe(struct platform_device *pdev)
 	device_property_read_u32(&pdev->dev, "socionext,pclk-rate",
 				 &i2c->pclkrate);
 
-	pclk = devm_clk_get_enabled(&pdev->dev, "pclk");
+	pclk = devm_clk_get_optional_enabled(&pdev->dev, "pclk");
 	if (IS_ERR(pclk))
 		return dev_err_probe(&pdev->dev, PTR_ERR(pclk),
 				     "failed to get and enable clock\n");
 
-	i2c->pclkrate = clk_get_rate(pclk);
+	if (pclk)
+		i2c->pclkrate = clk_get_rate(pclk);
 
 	if (i2c->pclkrate < SYNQUACER_I2C_MIN_CLK_RATE ||
 	    i2c->pclkrate > SYNQUACER_I2C_MAX_CLK_RATE)