Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Aug 2016 10:14:57 +0000 (UTC)
From:      Jared McNeill <jmcneill@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r304793 - head/sys/arm/allwinner
Message-ID:  <201608251014.u7PAEv85011081@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jmcneill
Date: Thu Aug 25 10:14:56 2016
New Revision: 304793
URL: https://svnweb.freebsd.org/changeset/base/304793

Log:
  Remove dependency on allwinner_soc_family() as it is not available on arm64.
  
  Reviewed by:	andrew, manu

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

Modified: head/sys/arm/allwinner/aw_rtc.c
==============================================================================
--- head/sys/arm/allwinner/aw_rtc.c	Thu Aug 25 09:16:25 2016	(r304792)
+++ head/sys/arm/allwinner/aw_rtc.c	Thu Aug 25 10:14:56 2016	(r304793)
@@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$");
 #define	LOSC_MAGIC			0x16aa0000
 #define	LOSC_BUSY_MASK			0x00000380
 
-#define	IS_SUN7I 			(allwinner_soc_family() == ALLWINNERSOC_SUN7I)
+#define	IS_SUN7I			(sc->type == A20_RTC)
 
 #define	YEAR_MIN			(IS_SUN7I ? 1970 : 2010)
 #define	YEAR_MAX			(IS_SUN7I ? 2100 : 2073)
@@ -108,6 +108,7 @@ static struct ofw_compat_data compat_dat
 
 struct aw_rtc_softc {
 	struct resource		*res;
+	int			type;
 	bus_size_t		rtc_date;
 	bus_size_t		rtc_time;
 };
@@ -169,8 +170,9 @@ aw_rtc_attach(device_t dev)
 		device_printf(dev, "could not allocate resources\n");
 		return (ENXIO);
 	}
-	
-	switch (ofw_bus_search_compatible(dev, compat_data)->ocd_data) {
+
+	sc->type = ofw_bus_search_compatible(dev, compat_data)->ocd_data;
+	switch (sc->type) {
 	case A10_RTC:
 	case A20_RTC:
 		sc->rtc_date = A10_RTC_DATE_REG;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608251014.u7PAEv85011081>