IRNAS / irnas-voltage-divider-driver

0 stars 1 forks source link

NCS 2.6.0 compatibility #4

Open KajbaM opened 5 months ago

KajbaM commented 5 months ago

Context

When using new version of NCS building project throws warnings about use of deprecated functionality. Library needs to be updated so it builds cleanly

Required steps / Implementation details

Resolve following warnings:

<redacted>/drivers/sensor/voltage_divider/voltage.c:118:12: warning: 'voltage_init' defined but not used [-Wunused-function]
  118 | static int voltage_init(const struct device *dev)
      |            ^~~~~~~~~~~~

<redacted>/drivers/sensor/voltage_divider/voltage.c:87:12: warning: 'pm_action' defined but not used [-Wunused-function]
   87 | static int pm_action(const struct device *dev, enum pm_device_action action)
      |            ^~~~~~~~~

<redacted>/drivers/sensor/voltage_divider/voltage.c:81:39: warning: 'voltage_api' defined but not used [-Wunused-const-variable=]
   81 | static const struct sensor_driver_api voltage_api = {
      |                                       ^~~~~~~~~~~

<redacted>/irnas/irnas-voltage-divider-driver/drivers/voltage_divider/voltage_divider.c:220:13: warning: APPLICATION device driver level is deprecated
  220 | DT_INST_FOREACH_STATUS_OKAY(VOLTAGE_DIVIDER_INIT)

Make sure changes don't break compatibility with older versions.

Definition of Done

Driver is updated for NCS2.6.0 compatibility

KajbaM commented 5 months ago

It would appear that zephyr now has its own voltage divider driver. Since it pretty much does what this driver is supposed to be doing I believe it makes no sense to use this one and should be deprecated for NCS >=2.6.0