mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
i2c: Use conftest to find return type of .remove of i2c_driver struct
Use conftest to determine the return type of .remove() of
struct i2c_driver is int or void type instead of kernel version.
The return type got changed with commmit ed5c2f5fd10d ("i2c:
Make remove callback return void")
Bug 4387902
Change-Id: Id64466613156e0efaf6cce7492d70cab1c1d1af7
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3036799
(cherry picked from commit 1eab65044c)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3053705
Tested-by: Jonathan Hunter <jonathanh@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
14abda2794
commit
5b4a093e24
@@ -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
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -508,7 +508,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)
|
||||
@@ -518,7 +518,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;
|
||||
@@ -528,7 +528,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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -1150,7 +1150,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)
|
||||
@@ -1160,7 +1160,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;
|
||||
@@ -1170,7 +1170,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
|
||||
}
|
||||
|
||||
@@ -1573,7 +1573,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)
|
||||
@@ -1583,7 +1583,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;
|
||||
@@ -1591,7 +1591,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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -119,6 +119,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
|
||||
|
||||
@@ -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 <linux/i2c.h>
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user