iio: temperature: tmp117: improve fallback capabilities
authorMarco Felsch <m.felsch@pengutronix.de>
Tue, 28 Feb 2023 09:05:15 +0000 (10:05 +0100)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 11 Mar 2023 12:18:29 +0000 (12:18 +0000)
commit07cc68996d8e83f7f1caccdc588757f6df57861a
tree1239c0693c04bb0010a2768cbc043462ffaadf83
parent70ed9ced1f415b4f68bfdfffc7240a79bca8e045
iio: temperature: tmp117: improve fallback capabilities

Don't error if the device-id found don't match the device-id for the
TMP117 sensor since other TMPxxx might be compatible to the TMP117. The
fallback mechanism tries to gather the required information from the
of_device_id or from the i2c_client information.

The commit also prepares the driver for adding new devices more easily
by making use of switch-case at the relevant parts.

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.kernel.org/r/20230228090518.529811-3-m.felsch@pengutronix.de
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/temperature/tmp117.c