Author: ian
Date: Sun Mar 19 04:03:39 2017
New Revision: 315530
URL: https://svnweb.freebsd.org/changeset/base/315530

Log:
  Remove unreferenced global function imx_gpt_get_timerfreq() and do some
  cleanups enabled by that:
  
   - The only thing left in imx_gptvar.h was the softc, which IMO never
     should have been in there at all.  Move it into the driver, and
     delete the header file.
  
   - Remove several unneeded #includes from the driver.
  
   - Change imx_gpt_softc from global to static (it's used by DELAY()), and
     don't redundantly static-initialize it to NULL.

Deleted:
  head/sys/arm/freescale/imx/imx_gptvar.h
Modified:
  head/sys/arm/freescale/imx/imx_gpt.c

Modified: head/sys/arm/freescale/imx/imx_gpt.c
==============================================================================
--- head/sys/arm/freescale/imx/imx_gpt.c        Sun Mar 19 03:06:09 2017        
(r315529)
+++ head/sys/arm/freescale/imx/imx_gpt.c        Sun Mar 19 04:03:39 2017        
(r315530)
@@ -35,24 +35,18 @@ __FBSDID("$FreeBSD$");
 #include <sys/bus.h>
 #include <sys/kernel.h>
 #include <sys/module.h>
-#include <sys/malloc.h>
 #include <sys/rman.h>
 #include <sys/timeet.h>
 #include <sys/timetc.h>
-#include <sys/watchdog.h>
 #include <machine/bus.h>
-#include <machine/cpu.h>
 #include <machine/intr.h>
 
 #include <dev/ofw/openfirm.h>
 #include <dev/ofw/ofw_bus.h>
 #include <dev/ofw/ofw_bus_subr.h>
 
-#include <arm/freescale/imx/imx_gptvar.h>
-#include <arm/freescale/imx/imx_gptreg.h>
-
-#include <sys/kdb.h>
 #include <arm/freescale/imx/imx_ccmvar.h>
+#include <arm/freescale/imx/imx_gptreg.h>
 
 #define        WRITE4(_sc, _r, _v)                                             
\
            bus_space_write_4((_sc)->sc_iot, (_sc)->sc_ioh, (_r), (_v))
@@ -80,8 +74,20 @@ static struct timecounter imx_gpt_timeco
        .tc_quality        = 1000,
 };
 
+struct imx_gpt_softc {
+       device_t                sc_dev;
+       struct resource *       res[2];
+       bus_space_tag_t         sc_iot;
+       bus_space_handle_t      sc_ioh;
+       void *                  sc_ih;                  /* interrupt handler */
+       uint32_t                sc_period;
+       uint32_t                sc_clksrc;
+       uint32_t                clkfreq;
+       struct eventtimer       et;
+};
+
 /* Global softc pointer for use in DELAY(). */
-struct imx_gpt_softc *imx_gpt_sc = NULL;
+static struct imx_gpt_softc *imx_gpt_sc;
 
 /*
  * Hand-calibrated delay-loop counter.  This was calibrated on an i.MX6 running
@@ -106,7 +112,7 @@ static struct resource_spec imx_gpt_spec
 };
 
 static struct ofw_compat_data compat_data[] = {
-       {"fsl,imx6dl-gpt",  1},
+       {"fsl,imx6dl-gpt", 1},
        {"fsl,imx6q-gpt",  1},
        {"fsl,imx53-gpt",  1},
        {"fsl,imx51-gpt",  1},
@@ -311,13 +317,6 @@ imx_gpt_timer_stop(struct eventtimer *et
        return (0);
 }
 
-int
-imx_gpt_get_timerfreq(struct imx_gpt_softc *sc)
-{
-
-       return (sc->clkfreq);
-}
-
 static int
 imx_gpt_intr(void *arg)
 {
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to