git: 354beb15b738 - stable/13 - twsi: Make ext_resources non-optional

From: Emmanuel Vadot <manu_at_FreeBSD.org>
Date: Mon, 16 May 2022 12:09:40 UTC
The branch stable/13 has been updated by manu:

URL: https://cgit.FreeBSD.org/src/commit/?id=354beb15b738508b4f314da68096f479e6f6deba

commit 354beb15b738508b4f314da68096f479e6f6deba
Author:     Emmanuel Vadot <manu@FreeBSD.org>
AuthorDate: 2022-01-11 09:39:47 +0000
Commit:     Emmanuel Vadot <manu@FreeBSD.org>
CommitDate: 2022-05-16 11:45:35 +0000

    twsi: Make ext_resources non-optional
    
    EXT_RESOURCES have been introduced in 12-CURRENT and all supported
    releases have it enabled in their kernel config.
    
    MFC after:      1 month
    Differential Revision:  https://reviews.freebsd.org/D33823
    
    (cherry picked from commit 36498b14083d5be64052e65bd7d1c81c1352dce4)
---
 sys/dev/iicbus/twsi/mv_twsi.c | 2 --
 sys/dev/iicbus/twsi/twsi.c    | 8 --------
 sys/dev/iicbus/twsi/twsi.h    | 4 ----
 3 files changed, 14 deletions(-)

diff --git a/sys/dev/iicbus/twsi/mv_twsi.c b/sys/dev/iicbus/twsi/mv_twsi.c
index cb10c1045347..97ed63524b9a 100644
--- a/sys/dev/iicbus/twsi/mv_twsi.c
+++ b/sys/dev/iicbus/twsi/mv_twsi.c
@@ -61,9 +61,7 @@ __FBSDID("$FreeBSD$");
 #include <dev/ofw/ofw_bus.h>
 #include <dev/ofw/ofw_bus_subr.h>
 
-#ifdef EXT_RESOURCES
 #include <dev/extres/clk/clk.h>
-#endif
 
 #include <arm/mv/mvreg.h>
 #include <arm/mv/mvvar.h>
diff --git a/sys/dev/iicbus/twsi/twsi.c b/sys/dev/iicbus/twsi/twsi.c
index 91433f2cfe4a..3baec3944fee 100644
--- a/sys/dev/iicbus/twsi/twsi.c
+++ b/sys/dev/iicbus/twsi/twsi.c
@@ -246,7 +246,6 @@ twsi_locked_start(device_t dev, struct twsi_softc *sc, int32_t mask,
 	return (IIC_NOERR);
 }
 
-#ifdef EXT_RESOURCES
 #define	TWSI_BAUD_RATE_RAW(C,M,N)	((C)/((10*(M+1))<<(N)))
 #define	ABSSUB(a,b)	(((a) > (b)) ? (a) - (b) : (b) - (a))
 
@@ -281,7 +280,6 @@ twsi_calc_baud_rate(struct twsi_softc *sc, const u_int target,
 
 	return (0);
 }
-#endif /* EXT_RESOURCES */
 
 /*
  * Only slave mode supported, disregard [old]addr
@@ -291,17 +289,13 @@ twsi_reset(device_t dev, u_char speed, u_char addr, u_char *oldaddr)
 {
 	struct twsi_softc *sc;
 	uint32_t param;
-#ifdef EXT_RESOURCES
 	u_int busfreq;
-#endif
 
 	sc = device_get_softc(dev);
 
-#ifdef EXT_RESOURCES
 	busfreq = IICBUS_GET_FREQUENCY(sc->iicbus, speed);
 
 	if (twsi_calc_baud_rate(sc, busfreq, &param) == -1) {
-#endif
 		switch (speed) {
 		case IIC_SLOW:
 		case IIC_FAST:
@@ -315,9 +309,7 @@ twsi_reset(device_t dev, u_char speed, u_char addr, u_char *oldaddr)
 			debugf(sc, "Using IIC_FASTEST/UNKNOWN mode with speed param=%x\n", param);
 			break;
 		}
-#ifdef EXT_RESOURCES
 	}
-#endif
 
 	debugf(sc, "Using clock param=%x\n", param);
 
diff --git a/sys/dev/iicbus/twsi/twsi.h b/sys/dev/iicbus/twsi/twsi.h
index ed0ea72ab819..d61a1eb5aa09 100644
--- a/sys/dev/iicbus/twsi/twsi.h
+++ b/sys/dev/iicbus/twsi/twsi.h
@@ -34,9 +34,7 @@
 #ifndef _TWSI_H_
 #define	_TWSI_H_
 
-#ifdef EXT_RESOURCES
 #include <dev/extres/clk/clk.h>
-#endif
 
 struct twsi_baud_rate {
 	uint32_t	raw;
@@ -50,10 +48,8 @@ struct twsi_softc {
 	struct resource	*res[2];
 	struct mtx	mutex;
 	device_t	iicbus;
-#ifdef EXT_RESOURCES
 	clk_t		clk_core;
 	clk_t		clk_reg;
-#endif
 	void *			intrhand;
 	bool			have_intr;