mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
media: i2c: max967xx: Fix build for pre Linux v6.3
In Linux v6.3, commit 03c835f498b5 ("i2c: Switch .probe() to not take an
id parameter") removed the ID parameter from the I2C probe function. The
max96712 does not build for Linux kernels prior to Linux v6.3 because it
assumes that the ID parameter has been removed. There is an existing
conftest that checks to see if the probe function requires and ID
parameter and so update the max967xx drivers accordingly to fix the build
for kernels prior to Linux v6.3.
Note we should avoid using explicit kernel version checks in out-of-tree
drivers because this does not work for 3rd party kernels. Therefore,
remove the kernel version.h because this is not used or needed.
Bug 5277201
Change-Id: Idbc569d782a952ee9ea0a91aace54df20f50701d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3506342
Tested-by: Shawn Bai <xueyuanb@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Shawn Bai <xueyuanb@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
2e202467e3
commit
56068ded4d
@@ -21,8 +21,8 @@
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* Kernel version compatibility checks */
|
||||
#include <linux/version.h>
|
||||
#include <nvidia/conftest.h>
|
||||
|
||||
#include <linux/delay.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/module.h>
|
||||
@@ -605,7 +605,12 @@ static const struct v4l2_subdev_internal_ops max96712_subdev_internal_ops = {
|
||||
.open = max96712_open,
|
||||
};
|
||||
|
||||
#if defined(NV_I2C_DRIVER_STRUCT_PROBE_WITHOUT_I2C_DEVICE_ID_ARG) /* Linux 6.3 */
|
||||
static int max96712_probe(struct i2c_client *client)
|
||||
#else
|
||||
static int max96712_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
#endif
|
||||
{
|
||||
struct device *dev = &client->dev;
|
||||
struct device_node *node = dev->of_node;
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <nvidia/conftest.h>
|
||||
|
||||
#include <linux/delay.h>
|
||||
#include <linux/i2c.h>
|
||||
#include <linux/module.h>
|
||||
@@ -720,7 +722,12 @@ static const struct v4l2_subdev_internal_ops max96726_subdev_internal_ops = {
|
||||
.open = max96726_open,
|
||||
};
|
||||
|
||||
#if defined(NV_I2C_DRIVER_STRUCT_PROBE_WITHOUT_I2C_DEVICE_ID_ARG) /* Linux 6.3 */
|
||||
static int max96726_probe(struct i2c_client *client)
|
||||
#else
|
||||
static int max96726_probe(struct i2c_client *client,
|
||||
const struct i2c_device_id *id)
|
||||
#endif
|
||||
{
|
||||
struct device *dev = &client->dev;
|
||||
struct device_node *node = dev->of_node;
|
||||
|
||||
Reference in New Issue
Block a user