media: i2c: mt9v032: Extend match support for OF tables
authorBiju Das <biju.das.jz@bp.renesas.com>
Sun, 10 Sep 2023 16:54:31 +0000 (17:54 +0100)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 27 Sep 2023 07:39:57 +0000 (09:39 +0200)
commit5e1abb1a9bf29a35ac74f480307d4d18a3b8eb1c
tree447f366067299d27434354363d2ecde679e4039c
parentb4e9a2d278c955715926f332773a9f66140fc41d
media: i2c: mt9v032: Extend match support for OF tables

The driver has an OF match table, still, it uses an ID lookup table for
retrieving match data. Currently, the driver is working on the
assumption that an I2C device registered via OF will always match a
legacy I2C device ID. The correct approach is to have an OF device ID
table using i2c_get_match_data() if the devices are registered via OF/ID.

Unify the OF/ID table by using mt9v032_model_info as match data for both
these tables and replace the ID lookup table for the match data by
i2c_get_match_data() and simplifly probe().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi+renesas@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/i2c/mt9v032.c