Skip to content

Commit f2990f8

Browse files
ardbiesheuvelAndi Shyti
authored andcommitted
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: 5575014 ("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]> Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Andi Shyti <[email protected]>
1 parent 5d69d5a commit f2990f8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/i2c/busses/i2c-synquacer.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -550,12 +550,13 @@ static int synquacer_i2c_probe(struct platform_device *pdev)
550550
device_property_read_u32(&pdev->dev, "socionext,pclk-rate",
551551
&i2c->pclkrate);
552552

553-
pclk = devm_clk_get_enabled(&pdev->dev, "pclk");
553+
pclk = devm_clk_get_optional_enabled(&pdev->dev, "pclk");
554554
if (IS_ERR(pclk))
555555
return dev_err_probe(&pdev->dev, PTR_ERR(pclk),
556556
"failed to get and enable clock\n");
557557

558-
i2c->pclkrate = clk_get_rate(pclk);
558+
if (pclk)
559+
i2c->pclkrate = clk_get_rate(pclk);
559560

560561
if (i2c->pclkrate < SYNQUACER_I2C_MIN_CLK_RATE ||
561562
i2c->pclkrate > SYNQUACER_I2C_MAX_CLK_RATE)

0 commit comments

Comments
 (0)