Skip to content

Commit f78626d

Browse files
pelwellpopcornmix
authored andcommitted
serial: 8250: bcm2835aux - defer if clock is zero
See: raspberrypi#3700 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
1 parent b15597c commit f78626d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎drivers/tty/serial/8250/8250_bcm2835aux.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ static int bcm2835aux_serial_probe(struct platform_device *pdev)
148148
*/
149149
up.port.uartclk = clk_get_rate(data->clk) * 2;
150150

151+
/* The clock is only queried at probe time, which means we get one shot
152+
* at this. A zero clock is never going to work and is almost certainly
153+
* due to a parent not being ready, so prefer to defer.
154+
*/
155+
if (!up.port.uartclk)
156+
return -EPROBE_DEFER;
157+
151158
/* register the port */
152159
ret = serial8250_register_8250_port(&up);
153160
if (ret < 0) {

0 commit comments

Comments
 (0)