Update drivers to be compatible with kernel 6.12.
Signed-off-by: Mieczyslaw Nalewaj <namiltd@yahoo.com>
return ret;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int ar934x_nfc_remove(struct platform_device *pdev)
+#else
+static void ar934x_nfc_remove(struct platform_device *pdev)
+#endif
{
struct ar934x_nfc *nfc;
ar934x_nfc_free_buf(nfc);
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
static const struct of_device_id ar934x_nfc_match[] = {
return 0;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int rb4xx_nand_remove(struct platform_device *pdev)
+#else
+static void rb4xx_nand_remove(struct platform_device *pdev)
+#endif
{
struct rb4xx_nand *nand = platform_get_drvdata(pdev);
mtd_device_unregister(nand_to_mtd(&nand->chip));
nand_cleanup(&nand->chip);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
static const struct platform_device_id rb4xx_nand_id_table[] = {
return 0;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int rb91x_nand_remove(struct platform_device *pdev)
+#else
+static void rb91x_nand_remove(struct platform_device *pdev)
+#endif
{
struct rb91x_nand_drvdata *drvdata = platform_get_drvdata(pdev);
rb91x_nand_release(drvdata);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
static const struct of_device_id rb91x_nand_match[] = {
#include <linux/clk.h>
#include <linux/of_mdio.h>
+#include <linux/version.h>
#include "ag71xx.h"
#define AG71XX_MDIO_RETRY 1000
return 0;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int ag71xx_mdio_remove(struct platform_device *pdev)
+#else
+static void ag71xx_mdio_remove(struct platform_device *pdev)
+#endif
{
struct ag71xx_mdio *am = platform_get_drvdata(pdev);
mdiobus_unregister(am->mii_bus);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
static const struct of_device_id ag71xx_mdio_match[] = {
#include <linux/of_net.h>
#include <linux/of_address.h>
#include <linux/of_platform.h>
+#include <linux/version.h>
#include "ag71xx.h"
#define AG71XX_DEFAULT_MSG_ENABLE \
return err;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int ag71xx_remove(struct platform_device *pdev)
+#else
+static void ag71xx_remove(struct platform_device *pdev)
+#endif
{
struct net_device *dev = platform_get_drvdata(pdev);
struct ag71xx *ag;
ag71xx_phy_disconnect(ag);
unregister_netdev(dev);
platform_set_drvdata(pdev, NULL);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
static const struct of_device_id ag71xx_match[] = {
#include <linux/phy.h>
#include <linux/platform_device.h>
#include <linux/reset.h>
+#include <linux/version.h>
/* DMA channels */
#define DMA_CHAN_WIDTH 0x10
return ret;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int bcm6348_emac_remove(struct platform_device *pdev)
+#else
+static void bcm6348_emac_remove(struct platform_device *pdev)
+#endif
{
struct net_device *ndev = platform_get_drvdata(pdev);
struct bcm6348_emac *emac = netdev_priv(ndev);
for (i = 0; i < emac->num_clocks; i++)
clk_disable_unprepare(emac->clock[i]);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
static const struct of_device_id bcm6348_emac_of_match[] = {
#include <linux/pm_domain.h>
#include <linux/pm_runtime.h>
#include <linux/reset.h>
+#include <linux/version.h>
/* TODO: Bigger frames may work but we do not trust that they are safe on all
* platforms so more research is needed, a max frame size of 2048 has been
return ret;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int bcm6368_enetsw_remove(struct platform_device *pdev)
+#else
+static void bcm6368_enetsw_remove(struct platform_device *pdev)
+#endif
{
struct device *dev = &pdev->dev;
struct net_device *ndev = platform_get_drvdata(pdev);
for (i = 0; i < priv->num_clocks; i++)
clk_disable_unprepare(priv->clock[i]);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
static const struct of_device_id bcm6368_enetsw_of_match[] = {
return 0;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int adm6996_gpio_remove(struct platform_device *pdev)
+#else
+static void adm6996_gpio_remove(struct platform_device *pdev)
+#endif
{
struct adm6996_priv *priv = platform_get_drvdata(pdev);
if (priv && (priv->model == ADM6996M || priv->model == ADM6996L))
unregister_switch(&priv->dev);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
static struct platform_driver adm6996_gpio_driver = {
* GNU General Public License for more details.
*/
+#include <linux/of.h>
#include <linux/list.h>
#include <linux/bitops.h>
#include <linux/switch.h>
return 0;
}
-int
+static int
ar8327_sw_get_port_igmp_snooping(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
return 0;
}
-int
+static int
ar8327_sw_set_port_igmp_snooping(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
return 0;
}
-int
+static int
ar8327_sw_get_igmp_snooping(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
return 0;
}
-int
+static int
ar8327_sw_set_igmp_snooping(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
return 0;
}
-int
+static int
ar8327_sw_get_igmp_v3(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
return 0;
}
-int
+static int
ar8327_sw_set_igmp_v3(struct switch_dev *dev,
const struct switch_attr *attr,
struct switch_val *val)
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/platform_data/b53.h>
+#include <linux/version.h>
#include "b53_priv.h"
return b53_swconfig_switch_register(dev);
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int b53_mmap_remove(struct platform_device *pdev)
+#else
+static void b53_mmap_remove(struct platform_device *pdev)
+#endif
{
struct b53_device *dev = platform_get_drvdata(pdev);
if (dev)
b53_switch_remove(dev);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
static struct platform_driver b53_mmap_driver = {
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/platform_data/b53.h>
+#include <linux/version.h>
#include "b53_priv.h"
return b53_swconfig_switch_register(dev);
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int b53_srab_remove(struct platform_device *pdev)
+#else
+static void b53_srab_remove(struct platform_device *pdev)
+#endif
{
struct b53_device *dev = platform_get_drvdata(pdev);
if (dev)
b53_switch_remove(dev);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
static struct platform_driver b53_srab_driver = {
#define MDC_MDIO_WRITE_OP 0x0003
#define MDC_REALTEK_PHY_ADDR 0x0
-int __rtl8366_mdio_read_reg(struct rtl8366_smi *smi, u32 addr, u32 *data)
+static int __rtl8366_mdio_read_reg(struct rtl8366_smi *smi, u32 addr, u32 *data)
{
u32 phy_id = smi->phy_id;
struct mii_bus *mbus = smi->ext_mbus;
reset_control_deassert(smi->reset);
}
-int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8366_smi *smi)
+static int rtl8366_smi_probe_of(struct platform_device *pdev, struct rtl8366_smi *smi)
{
int sck = of_get_named_gpio(pdev->dev.of_node, "gpio-sck", 0);
int sda = of_get_named_gpio(pdev->dev.of_node, "gpio-sda", 0);
}
#endif
-int rtl8366_smi_probe_plat(struct platform_device *pdev, struct rtl8366_smi *smi)
+static int rtl8366_smi_probe_plat(struct platform_device *pdev, struct rtl8366_smi *smi)
{
struct rtl8366_platform_data *pdata = pdev->dev.platform_data;
#include <linux/delay.h>
#include <linux/skbuff.h>
#include <linux/rtl8366.h>
+#include <linux/version.h>
#include "rtl8366_smi.h"
return err;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int rtl8366rb_remove(struct platform_device *pdev)
+#else
+static void rtl8366rb_remove(struct platform_device *pdev)
+#endif
{
struct rtl8366_smi *smi = platform_get_drvdata(pdev);
kfree(smi);
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
#ifdef CONFIG_OF
#include <linux/delay.h>
#include <linux/skbuff.h>
#include <linux/rtl8366.h>
+#include <linux/version.h>
#include "rtl8366_smi.h"
return err;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int rtl8366s_remove(struct platform_device *pdev)
+#else
+static void rtl8366s_remove(struct platform_device *pdev)
+#endif
{
struct rtl8366_smi *smi = platform_get_drvdata(pdev);
kfree(smi);
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
#ifdef CONFIG_OF
#include <linux/delay.h>
#include <linux/skbuff.h>
#include <linux/rtl8367.h>
+#include <linux/version.h>
#include "rtl8366_smi.h"
return err;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int rtl8367_remove(struct platform_device *pdev)
+#else
+static void rtl8367_remove(struct platform_device *pdev)
+#endif
{
struct rtl8366_smi *smi = platform_get_drvdata(pdev);
kfree(smi);
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
static void rtl8367_shutdown(struct platform_device *pdev)
#include <linux/delay.h>
#include <linux/skbuff.h>
#include <linux/rtl8367.h>
+#include <linux/version.h>
#include "rtl8366_smi.h"
return err;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int rtl8367b_remove(struct platform_device *pdev)
+#else
+static void rtl8367b_remove(struct platform_device *pdev)
+#endif
{
struct rtl8366_smi *smi = platform_get_drvdata(pdev);
kfree(smi);
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
static void rtl8367b_shutdown(struct platform_device *pdev)
};
#ifdef CONFIG_OF
-void
+static void
of_switch_load_portmap(struct switch_dev *dev)
{
struct device_node *port;
#include <linux/of_mdio.h>
#include <linux/of_platform.h>
#include <linux/of_gpio.h>
-
+#include <linux/version.h>
#include "./rtl8367c/include/rtk_switch.h"
#include "./rtl8367c/include/port.h"
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int rtk_gsw_remove(struct platform_device *pdev)
+#else
+static void rtk_gsw_remove(struct platform_device *pdev)
+#endif
{
platform_set_drvdata(pdev, NULL);
gsw_debug_proc_exit();
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
static struct platform_driver gsw_driver = {
#include <linux/of_dma.h>
#include <linux/reset.h>
#include <linux/of_device.h>
+#include <linux/version.h>
#include "../virt-dma.h"
return ret;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int mtk_hsdma_remove(struct platform_device *pdev)
+#else
+static void mtk_hsdma_remove(struct platform_device *pdev)
+#endif
{
struct mtk_hsdam_engine *hsdma = platform_get_drvdata(pdev);
of_dma_controller_free(pdev->dev.of_node);
dma_async_device_unregister(&hsdma->ddev);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
static struct platform_driver mtk_hsdma_driver = {
#include <linux/of_dma.h>
#include <linux/reset.h>
#include <linux/of_device.h>
+#include <linux/version.h>
#include "virt-dma.h"
return ret;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int gdma_dma_remove(struct platform_device *pdev)
+#else
+static void gdma_dma_remove(struct platform_device *pdev)
+#endif
{
struct gdma_dma_dev *dma_dev = platform_get_drvdata(pdev);
of_dma_controller_free(pdev->dev.of_node);
dma_async_device_unregister(&dma_dev->ddev);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
static struct platform_driver gdma_dma_driver = {
#include <linux/platform_device.h>
#include <linux/interrupt.h>
#include <linux/of.h>
+#include <linux/version.h>
#include <linux/mmc/host.h>
#include <linux/mmc/mmc.h>
}
/* 4 device share one driver, using "drvdata" to show difference */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int msdc_drv_remove(struct platform_device *pdev)
+#else
+static void msdc_drv_remove(struct platform_device *pdev)
+#endif
{
struct mmc_host *mmc;
struct msdc_host *host;
mmc_free_host(host->mmc);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
/* Fix me: Power Flow */
#include <linux/mtd/partitions.h>
#include <linux/mtd/mtk_bmt.h>
#include <linux/platform_device.h>
+#include <linux/version.h>
#include <asm/addrspace.h>
/* NFI core registers */
return 0;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int mt7621_nfc_remove(struct platform_device *pdev)
+#else
+static void mt7621_nfc_remove(struct platform_device *pdev)
+#endif
{
struct mt7621_nfc *nfc = platform_get_drvdata(pdev);
struct nand_chip *nand = &nfc->nand;
mtd_device_unregister(mtd);
nand_cleanup(nand);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
static const struct of_device_id mt7621_nfc_id_table[] = {
#include <asm/mach-ralink/ralink_regs.h>
#include <linux/of_device.h>
#include <linux/of_irq.h>
+#include <linux/version.h>
#include <linux/switch.h>
#include <linux/reset.h>
return 0;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int esw_remove(struct platform_device *pdev)
+#else
+static void esw_remove(struct platform_device *pdev)
+#endif
{
struct rt305x_esw *esw = platform_get_drvdata(pdev);
platform_set_drvdata(pdev, NULL);
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
static const struct of_device_id ralink_esw_match[] = {
*/
#include "mtk_eth_soc.h"
+#include "ethtool.h"
static const char fe_gdma_str[][ETH_GSTRING_LEN] = {
#define _FE(x...) # x,
struct fe_priv *priv = netdev_priv(dev);
struct fe_soc_data *soc = priv->soc;
- strlcpy(info->driver, priv->dev->driver->name, sizeof(info->driver));
- strlcpy(info->version, MTK_FE_DRV_VERSION, sizeof(info->version));
- strlcpy(info->bus_info, dev_name(priv->dev), sizeof(info->bus_info));
+ strscpy(info->driver, priv->dev->driver->name, sizeof(info->driver));
+ strscpy(info->version, MTK_FE_DRV_VERSION, sizeof(info->version));
+ strscpy(info->bus_info, dev_name(priv->dev), sizeof(info->bus_info));
if (soc->reg_table[FE_REG_FE_COUNTER_BASE])
info->n_stats = ARRAY_SIZE(fe_gdma_str);
#include <linux/platform_device.h>
#include <linux/of_device.h>
#include <linux/of_irq.h>
+#include <linux/of_platform.h>
+#include <linux/version.h>
#include <ralink_regs.h>
return 0;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int mt7620_gsw_remove(struct platform_device *pdev)
+#else
+static void mt7620_gsw_remove(struct platform_device *pdev)
+#endif
{
platform_set_drvdata(pdev, NULL);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
static struct platform_driver gsw_driver = {
#include <linux/etherdevice.h>
#include <linux/lockdep.h>
#include <linux/workqueue.h>
+#include <linux/of.h>
#include <linux/of_device.h>
#include <asm/byteorder.h>
},
};
-struct mt7530_mapping*
+static struct mt7530_mapping*
mt7530_find_mapping(struct device_node *np)
{
const char *map;
#include <linux/of_gpio.h>
#include <linux/gpio.h>
#include <linux/gpio/consumer.h>
+#include <linux/version.h>
#include <asm/mach-ralink/ralink_regs.h>
return 0;
}
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
static int fe_remove(struct platform_device *pdev)
+#else
+static void fe_remove(struct platform_device *pdev)
+#endif
{
struct net_device *dev = platform_get_drvdata(pdev);
struct fe_priv *priv = netdev_priv(dev);
platform_set_drvdata(pdev, NULL);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6,11,0)
return 0;
+#endif
}
static struct platform_driver fe_driver = {