svn commit: r349060 - head/sys/arm/allwinner

Ian Lepore ian at FreeBSD.org
Sat Jun 15 16:59:04 UTC 2019


Author: ian
Date: Sat Jun 15 16:59:03 2019
New Revision: 349060
URL: https://svnweb.freebsd.org/changeset/base/349060

Log:
  Handle failure to enable the clock or obtain its frequency.

Modified:
  head/sys/arm/allwinner/aw_pwm.c

Modified: head/sys/arm/allwinner/aw_pwm.c
==============================================================================
--- head/sys/arm/allwinner/aw_pwm.c	Sat Jun 15 16:56:00 2019	(r349059)
+++ head/sys/arm/allwinner/aw_pwm.c	Sat Jun 15 16:59:03 2019	(r349060)
@@ -150,8 +150,16 @@ aw_pwm_attach(device_t dev)
 		goto fail;
 	}
 	error = clk_enable(sc->clk);
+	if (error != 0) {
+		device_printf(dev, "cannot enable clock\n");
+		goto fail;
+	}
 
 	error = clk_get_freq(sc->clk, &sc->clk_freq);
+	if (error != 0) {
+		device_printf(dev, "cannot get clock frequency\n");
+		goto fail;
+	}
 
 	if (bus_alloc_resources(dev, aw_pwm_spec, &sc->res) != 0) {
 		device_printf(dev, "cannot allocate resources for device\n");


More information about the svn-src-all mailing list