The fix_mac_speed() callback takes the speed as an int on 6.18
(SPEED_UNKNOWN is negative); it was unsigned int on 6.12. Select the
prototype on LINUX_VERSION_CODE so the driver keeps building on the 6.12
main kernel and on the 6.18 testing kernel.
Signed-off-by: Julius Bairaktaris <julius@bairaktaris.de>
Link: https://github.com/openwrt/openwrt/pull/24031
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
#include <linux/platform_device.h>
#include <linux/reset.h>
#include <linux/stmmac.h>
+#include <linux/version.h>
#include "stmmac_platform.h"
struct clk *tx_clk;
};
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 18, 0)
+static void ipq5018_gmac_fix_speed(void *priv, int speed, unsigned int mode)
+#else
static void ipq5018_gmac_fix_speed(void *priv, unsigned int speed, unsigned int mode)
+#endif
{
struct ipq5018_gmac *gmac = priv;
unsigned long rate;