diff --git a/drivers/hwmon/f75308.c b/drivers/hwmon/f75308.c index a9a3f74f..d5858313 100644 --- a/drivers/hwmon/f75308.c +++ b/drivers/hwmon/f75308.c @@ -1216,7 +1216,7 @@ destroy_lock: return status; } -#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int f75308_remove(struct i2c_client *client) #else static void f75308_remove(struct i2c_client *client) @@ -1225,7 +1225,7 @@ static void f75308_remove(struct i2c_client *client) struct f75308_priv *priv = dev_get_drvdata(&client->dev); mutex_destroy(&priv->locker); -#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/i2c/busses/i2c-nvvrs11.c b/drivers/i2c/busses/i2c-nvvrs11.c index 1f4f947a..41e0c1eb 100644 --- a/drivers/i2c/busses/i2c-nvvrs11.c +++ b/drivers/i2c/busses/i2c-nvvrs11.c @@ -310,7 +310,7 @@ exit: return ret; } -#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE +#if !defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static void nvvrs11_remove(struct i2c_client *client) { nvvrs11_delete_sys_files(&client->dev); diff --git a/drivers/media/i2c/ar1335_common.c b/drivers/media/i2c/ar1335_common.c index 313adf3a..8fa7d9cb 100644 --- a/drivers/media/i2c/ar1335_common.c +++ b/drivers/media/i2c/ar1335_common.c @@ -2785,7 +2785,7 @@ exit: devm_kfree(dev, ptr); \ } -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int cam_remove(struct i2c_client *client) #else static void cam_remove(struct i2c_client *client) @@ -2799,7 +2799,7 @@ static void cam_remove(struct i2c_client *client) if (!s_data) { dev_err(&client->dev, "camera common data is NULL\n"); -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return -EINVAL; #else return; @@ -2811,7 +2811,7 @@ static void cam_remove(struct i2c_client *client) reset_gpio = of_get_named_gpio(node, "reset-gpios", 0); if (reset_gpio < 0) { dev_err(&client->dev, "Unable to get reset GPIO\n"); -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return -EINVAL; #else return; diff --git a/drivers/media/i2c/lt6911uxc.c b/drivers/media/i2c/lt6911uxc.c index 3b9fed56..35f367ef 100644 --- a/drivers/media/i2c/lt6911uxc.c +++ b/drivers/media/i2c/lt6911uxc.c @@ -733,7 +733,7 @@ static int lt6911uxc_probe(struct i2c_client *client, return 0; } -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int lt6911uxc_remove(struct i2c_client *client) #else static void lt6911uxc_remove(struct i2c_client *client) @@ -743,7 +743,7 @@ static void lt6911uxc_remove(struct i2c_client *client) struct lt6911uxc *priv; if (!s_data) -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return -EINVAL; #else return; @@ -753,7 +753,7 @@ static void lt6911uxc_remove(struct i2c_client *client) tegracam_v4l2subdev_unregister(priv->tc_dev); tegracam_device_unregister(priv->tc_dev); -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/media/i2c/max9295.c b/drivers/media/i2c/max9295.c index e0a923b2..b363d5f6 100644 --- a/drivers/media/i2c/max9295.c +++ b/drivers/media/i2c/max9295.c @@ -514,7 +514,7 @@ static int max9295_probe(struct i2c_client *client, return err; } -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int max9295_remove(struct i2c_client *client) #else static void max9295_remove(struct i2c_client *client) @@ -528,7 +528,7 @@ static void max9295_remove(struct i2c_client *client) i2c_unregister_device(client); client = NULL; } -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/media/i2c/max9296.c b/drivers/media/i2c/max9296.c index 1854ace7..1ceaf3cd 100644 --- a/drivers/media/i2c/max9296.c +++ b/drivers/media/i2c/max9296.c @@ -894,7 +894,7 @@ static int max9296_probe(struct i2c_client *client, return 0; } -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int max9296_remove(struct i2c_client *client) #else static void max9296_remove(struct i2c_client *client) @@ -908,7 +908,7 @@ static void max9296_remove(struct i2c_client *client) i2c_unregister_device(client); client = NULL; } -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/media/i2c/max96712.c b/drivers/media/i2c/max96712.c index 05b5cad5..8e237eef 100644 --- a/drivers/media/i2c/max96712.c +++ b/drivers/media/i2c/max96712.c @@ -268,7 +268,7 @@ static int max96712_probe(struct i2c_client *client, return err; } -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int max96712_remove(struct i2c_client *client) #else static void max96712_remove(struct i2c_client *client) @@ -279,7 +279,7 @@ static void max96712_remove(struct i2c_client *client) i2c_unregister_device(client); client = NULL; } -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/media/i2c/nv_ar0234.c b/drivers/media/i2c/nv_ar0234.c index 9bbd7a3f..4b4b05c0 100644 --- a/drivers/media/i2c/nv_ar0234.c +++ b/drivers/media/i2c/nv_ar0234.c @@ -1151,7 +1151,7 @@ static int ar0234_probe(struct i2c_client *client, return 0; } -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int ar0234_remove(struct i2c_client *client) #else static void ar0234_remove(struct i2c_client *client) @@ -1161,7 +1161,7 @@ static void ar0234_remove(struct i2c_client *client) struct ar0234 *priv; if (!s_data) -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return -EINVAL; #else return; @@ -1171,7 +1171,7 @@ static void ar0234_remove(struct i2c_client *client) tegracam_v4l2subdev_unregister(priv->tc_dev); tegracam_device_unregister(priv->tc_dev); ar0234_eeprom_device_release(priv); -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/media/i2c/nv_hawk_owl.c b/drivers/media/i2c/nv_hawk_owl.c index 5d37f8e3..2ec14a8b 100644 --- a/drivers/media/i2c/nv_hawk_owl.c +++ b/drivers/media/i2c/nv_hawk_owl.c @@ -1575,7 +1575,7 @@ un_register: return err; } -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int ar0234_remove(struct i2c_client *client) #else static void ar0234_remove(struct i2c_client *client) @@ -1585,7 +1585,7 @@ static void ar0234_remove(struct i2c_client *client) struct ar0234 *priv = (struct ar0234 *)s_data->priv; if (!s_data) -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return -EINVAL; #else return; @@ -1593,7 +1593,7 @@ static void ar0234_remove(struct i2c_client *client) tegracam_v4l2subdev_unregister(priv->tc_dev); tegracam_device_unregister(priv->tc_dev); ar0234_eeprom_device_release(priv); -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/media/i2c/nv_imx185.c b/drivers/media/i2c/nv_imx185.c index 85aeadbf..b4c75564 100644 --- a/drivers/media/i2c/nv_imx185.c +++ b/drivers/media/i2c/nv_imx185.c @@ -840,11 +840,11 @@ static int imx185_probe(struct i2c_client *client, return 0; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) -static void +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ +static int imx185_remove(struct i2c_client *client) #else -static int +static void imx185_remove(struct i2c_client *client) #endif { @@ -852,17 +852,17 @@ imx185_remove(struct i2c_client *client) struct imx185 *priv; if (!s_data) -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) - return; -#else +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return -EINVAL; +#else + return; #endif priv = (struct imx185 *)s_data->priv; tegracam_v4l2subdev_unregister(priv->tc_dev); tegracam_device_unregister(priv->tc_dev); -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/media/i2c/nv_imx219.c b/drivers/media/i2c/nv_imx219.c index f1c683d5..61bea843 100644 --- a/drivers/media/i2c/nv_imx219.c +++ b/drivers/media/i2c/nv_imx219.c @@ -756,10 +756,10 @@ static int imx219_probe(struct i2c_client *client, return 0; } -#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE -static void imx219_remove(struct i2c_client *client) -#else +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int imx219_remove(struct i2c_client *client) +#else +static void imx219_remove(struct i2c_client *client) #endif { struct camera_common_data *s_data = to_camera_common_data(&client->dev); @@ -767,7 +767,7 @@ static int imx219_remove(struct i2c_client *client) if (!s_data) { dev_err(&client->dev, "camera common data is NULL\n"); -#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return -EINVAL; #else return; @@ -778,7 +778,7 @@ static int imx219_remove(struct i2c_client *client) tegracam_v4l2subdev_unregister(priv->tc_dev); tegracam_device_unregister(priv->tc_dev); -#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/media/i2c/nv_imx274.c b/drivers/media/i2c/nv_imx274.c index f4d59600..f036ab25 100644 --- a/drivers/media/i2c/nv_imx274.c +++ b/drivers/media/i2c/nv_imx274.c @@ -1335,20 +1335,20 @@ static int imx274_probe(struct i2c_client *client, return 0; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) -static void imx274_remove(struct i2c_client *client) -#else +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int imx274_remove(struct i2c_client *client) +#else +static void imx274_remove(struct i2c_client *client) #endif { struct camera_common_data *s_data = to_camera_common_data(&client->dev); struct imx274 *priv; if (!s_data) -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) - return; -#else +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return -EINVAL; +#else + return; #endif priv = (struct imx274 *)s_data->priv; @@ -1360,7 +1360,7 @@ static int imx274_remove(struct i2c_client *client) imx274_eeprom_device_release(priv); mutex_destroy(&priv->streaming_lock); -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/media/i2c/nv_imx318.c b/drivers/media/i2c/nv_imx318.c index c871e0b2..2a8276f0 100644 --- a/drivers/media/i2c/nv_imx318.c +++ b/drivers/media/i2c/nv_imx318.c @@ -761,7 +761,7 @@ static int imx318_probe(struct i2c_client *client, return 0; } -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int imx318_remove(struct i2c_client *client) #else static void imx318_remove(struct i2c_client *client) @@ -771,7 +771,7 @@ static void imx318_remove(struct i2c_client *client) struct imx318 *priv; if (!s_data) -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return -EINVAL; #else return; @@ -782,7 +782,7 @@ static void imx318_remove(struct i2c_client *client) tegracam_device_unregister(priv->tc_dev); imx318_eeprom_device_release(priv); -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/media/i2c/nv_imx390.c b/drivers/media/i2c/nv_imx390.c index d4eecc58..9ed2cdd3 100644 --- a/drivers/media/i2c/nv_imx390.c +++ b/drivers/media/i2c/nv_imx390.c @@ -856,7 +856,7 @@ static int imx390_probe(struct i2c_client *client, return 0; } -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int imx390_remove(struct i2c_client *client) #else static void imx390_remove(struct i2c_client *client) @@ -866,7 +866,7 @@ static void imx390_remove(struct i2c_client *client) struct imx390 *priv; if (!s_data) -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return -EINVAL; #else return; @@ -880,7 +880,7 @@ static void imx390_remove(struct i2c_client *client) tegracam_v4l2subdev_unregister(priv->tc_dev); tegracam_device_unregister(priv->tc_dev); -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/media/i2c/nv_imx477.c b/drivers/media/i2c/nv_imx477.c index a7c22da0..a57cdf75 100644 --- a/drivers/media/i2c/nv_imx477.c +++ b/drivers/media/i2c/nv_imx477.c @@ -782,10 +782,10 @@ static int imx477_probe(struct i2c_client *client, return 0; } -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) -static void imx477_remove(struct i2c_client *client) -#else +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int imx477_remove(struct i2c_client *client) +#else +static void imx477_remove(struct i2c_client *client) #endif { struct camera_common_data *s_data = to_camera_common_data(&client->dev); @@ -793,7 +793,7 @@ static int imx477_remove(struct i2c_client *client) if (!s_data) { dev_err(&client->dev, "camera common data is NULL\n"); -#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return -EINVAL; #else return; @@ -803,7 +803,7 @@ static int imx477_remove(struct i2c_client *client) tegracam_v4l2subdev_unregister(priv->tc_dev); tegracam_device_unregister(priv->tc_dev); -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/media/i2c/nv_ov5693.c b/drivers/media/i2c/nv_ov5693.c index 82bf4a12..372d1d87 100644 --- a/drivers/media/i2c/nv_ov5693.c +++ b/drivers/media/i2c/nv_ov5693.c @@ -1238,7 +1238,7 @@ fail: return err; } -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int ov5693_remove(struct i2c_client *client) #else @@ -1250,7 +1250,7 @@ ov5693_remove(struct i2c_client *client) struct camera_common_data *s_data = to_camera_common_data(&client->dev); if (!s_data) -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return -EINVAL; #else return; @@ -1266,7 +1266,7 @@ ov5693_remove(struct i2c_client *client) ov5693_eeprom_device_release(priv); mutex_destroy(&priv->streaming_lock); -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/media/i2c/pca9570.c b/drivers/media/i2c/pca9570.c index 29602ba8..3212c3df 100644 --- a/drivers/media/i2c/pca9570.c +++ b/drivers/media/i2c/pca9570.c @@ -310,7 +310,7 @@ static int pca9570_probe(struct i2c_client *client, return err; } -#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int pca9570_remove(struct i2c_client *client) #else static void pca9570_remove(struct i2c_client *client) @@ -321,7 +321,7 @@ static void pca9570_remove(struct i2c_client *client) client = NULL; } -#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/media/i2c/virtual_i2c_mux.c b/drivers/media/i2c/virtual_i2c_mux.c index a5bc06ac..e85d3337 100644 --- a/drivers/media/i2c/virtual_i2c_mux.c +++ b/drivers/media/i2c/virtual_i2c_mux.c @@ -106,7 +106,7 @@ err_parent: return ret; } -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int virtual_i2c_mux_remove(struct i2c_client *client) #else static void virtual_i2c_mux_remove(struct i2c_client *client) @@ -116,7 +116,7 @@ static void virtual_i2c_mux_remove(struct i2c_client *client) i2c_mux_del_adapters(muxc); i2c_put_adapter(muxc->parent); -#if (KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE) +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/media/platform/tegra/cdi/cdi_dev.c b/drivers/media/platform/tegra/cdi/cdi_dev.c index d23fa2a6..7195b0d2 100644 --- a/drivers/media/platform/tegra/cdi/cdi_dev.c +++ b/drivers/media/platform/tegra/cdi/cdi_dev.c @@ -807,7 +807,7 @@ static int cdi_dev_probe(struct i2c_client *client, return 0; } -#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int cdi_dev_remove(struct i2c_client *client) #else static void cdi_dev_remove(struct i2c_client *client) @@ -828,7 +828,7 @@ static void cdi_dev_remove(struct i2c_client *client) if (info->cdev.dev) cdev_del(&info->cdev); -#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/media/platform/tegra/isc/isc_dev.c b/drivers/media/platform/tegra/isc/isc_dev.c index 0f6c97c3..17abe5f6 100644 --- a/drivers/media/platform/tegra/isc/isc_dev.c +++ b/drivers/media/platform/tegra/isc/isc_dev.c @@ -514,7 +514,7 @@ static int isc_dev_probe(struct i2c_client *client, return 0; } -#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int isc_dev_remove(struct i2c_client *client) #else static void isc_dev_remove(struct i2c_client *client) @@ -535,7 +535,7 @@ static void isc_dev_remove(struct i2c_client *client) if (info->cdev.dev) cdev_del(&info->cdev); -#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/usb/typec/fusb301.c b/drivers/usb/typec/fusb301.c index 90a8d7dd..717ec17f 100644 --- a/drivers/usb/typec/fusb301.c +++ b/drivers/usb/typec/fusb301.c @@ -1476,27 +1476,27 @@ destroy_workqueue: return ret; } -#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE -static void fusb301_remove(struct i2c_client *client) -#else +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int fusb301_remove(struct i2c_client *client) +#else +static void fusb301_remove(struct i2c_client *client) #endif { struct fusb301_chip *chip = i2c_get_clientdata(client); struct device *cdev = &client->dev; if (!chip) -#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE - return; -#else +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return -ENODEV; +#else + return; #endif sysfs_remove_group(&cdev->kobj, &fusb_sysfs_group); destroy_workqueue(chip->cc_wq); mutex_destroy(&chip->mlock); wakeup_source_unregister(chip->wlock); -#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/video/tegra/dc/bridge/maxim_gmsl_dp_serializer.c b/drivers/video/tegra/dc/bridge/maxim_gmsl_dp_serializer.c index 412a6969..cb4a449c 100644 --- a/drivers/video/tegra/dc/bridge/maxim_gmsl_dp_serializer.c +++ b/drivers/video/tegra/dc/bridge/maxim_gmsl_dp_serializer.c @@ -1310,10 +1310,10 @@ static int max_gmsl_dp_ser_probe(struct i2c_client *client) return ret; } -#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE -static void max_gmsl_dp_ser_remove(struct i2c_client *client) -#else +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int max_gmsl_dp_ser_remove(struct i2c_client *client) +#else +static void max_gmsl_dp_ser_remove(struct i2c_client *client) #endif { struct max_gmsl_dp_ser_priv *priv = i2c_get_clientdata(client); @@ -1321,7 +1321,7 @@ static int max_gmsl_dp_ser_remove(struct i2c_client *client) i2c_unregister_device(client); gpiod_set_value_cansleep(priv->gpiod_pwrdn, 0); -#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/video/tegra/dc/bridge/maxim_gmsl_hdmi_serializer.c b/drivers/video/tegra/dc/bridge/maxim_gmsl_hdmi_serializer.c index 11e9d921..0c1dda2b 100644 --- a/drivers/video/tegra/dc/bridge/maxim_gmsl_hdmi_serializer.c +++ b/drivers/video/tegra/dc/bridge/maxim_gmsl_hdmi_serializer.c @@ -300,10 +300,10 @@ static int maxim_gmsl_hdmi_ser_probe(struct i2c_client *client) return 0; } -#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE -static void maxim_gmsl_hdmi_ser_remove(struct i2c_client *client) -#else +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int maxim_gmsl_hdmi_ser_remove(struct i2c_client *client) +#else +static void maxim_gmsl_hdmi_ser_remove(struct i2c_client *client) #endif { struct maxim_gmsl_hdmi_ser_priv *priv = i2c_get_clientdata(client); @@ -311,7 +311,7 @@ static int maxim_gmsl_hdmi_ser_remove(struct i2c_client *client) i2c_unregister_device(client); gpio_set_value(priv->ser_pwrdn, 0); -#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/drivers/video/tegra/dc/bridge/ti_fpdlink_dp_serializer.c b/drivers/video/tegra/dc/bridge/ti_fpdlink_dp_serializer.c index 74daaced..e8204300 100644 --- a/drivers/video/tegra/dc/bridge/ti_fpdlink_dp_serializer.c +++ b/drivers/video/tegra/dc/bridge/ti_fpdlink_dp_serializer.c @@ -1014,10 +1014,10 @@ static int ti_fpdlink_dp_ser_probe(struct i2c_client *client) return ret; } -#if KERNEL_VERSION(6, 1, 0) <= LINUX_VERSION_CODE -static void ti_fpdlink_dp_ser_remove(struct i2c_client *client) -#else +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ static int ti_fpdlink_dp_ser_remove(struct i2c_client *client) +#else +static void ti_fpdlink_dp_ser_remove(struct i2c_client *client) #endif { struct ti_fpdlink_dp_ser_priv *priv = i2c_get_clientdata(client); @@ -1025,7 +1025,7 @@ static int ti_fpdlink_dp_ser_remove(struct i2c_client *client) i2c_unregister_device(client); gpiod_set_value_cansleep(priv->gpiod_pwrdn, 0); -#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE +#if defined(NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT) /* Linux 6.1 */ return 0; #endif } diff --git a/scripts/conftest/Makefile b/scripts/conftest/Makefile index e5d29abe..eefc6996 100644 --- a/scripts/conftest/Makefile +++ b/scripts/conftest/Makefile @@ -121,6 +121,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += get_file_rcu_has_double_ptr_file_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += get_user_pages NV_CONFTEST_FUNCTION_COMPILE_TESTS += i2c_driver_struct_probe_without_i2c_device_id_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += i2c_driver_struct_has_probe_new +NV_CONFTEST_FUNCTION_COMPILE_TESTS += i2c_driver_struct_remove_return_type_int NV_CONFTEST_FUNCTION_COMPILE_TESTS += iio_dev_opaque_has_mlock NV_CONFTEST_FUNCTION_COMPILE_TESTS += iommu_map_has_gfp_arg NV_CONFTEST_FUNCTION_COMPILE_TESTS += kthread_complete_and_exit diff --git a/scripts/conftest/conftest.sh b/scripts/conftest/conftest.sh index 1e664e8e..526b32d2 100755 --- a/scripts/conftest/conftest.sh +++ b/scripts/conftest/conftest.sh @@ -5434,6 +5434,23 @@ compile_test() { compile_check_conftest "$CODE" "NV_I2C_DRIVER_STRUCT_HAS_PROBE_NEW" "" "types" ;; + i2c_driver_struct_remove_return_type_int) + # + # Determine if return type of .remove function of struct i2c_driver is int or void. + # + # The return type of .remove is changed with commit ed5c2f5fd10dda ("i2c: Make + # remove callback return void") in Linux 6.1. + # + CODE=" + #define _LINUX_EFI_H + #include + int conftest_i2c_i2c_driver_struct_remove_return_type_int(struct i2c_driver *i2cd) { + return i2cd->remove(NULL); + }" + + compile_check_conftest "$CODE" "NV_I2C_DRIVER_STRUCT_REMOVE_RETURN_TYPE_INT" "" "types" + ;; + of_get_named_gpio) # # Determine if of_get_named_gpio() function is present