Re: [PATCH v2 2/2] iio: adc: ad7606: finish pwm_get_state_hw() TODO

From: kernel test robot
Date: Fri Nov 01 2024 - 13:52:04 EST


Hi David,

kernel test robot noticed the following build errors:

[auto build test ERROR on 6fb2fa9805c501d9ade047fc511961f3273cdcb5]

url: https://github.com/intel-lab-lkp/linux/commits/David-Lechner/pwm-core-export-pwm_get_state_hw/20241030-052134
base: 6fb2fa9805c501d9ade047fc511961f3273cdcb5
patch link: https://lore.kernel.org/r/20241029-pwm-export-pwm_get_state_hw-v2-2-03ba063a3230%40baylibre.com
patch subject: [PATCH v2 2/2] iio: adc: ad7606: finish pwm_get_state_hw() TODO
config: i386-randconfig-141-20241101 (https://download.01.org/0day-ci/archive/20241102/202411020101.5Hs6MkwQ-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241102/202411020101.5Hs6MkwQ-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202411020101.5Hs6MkwQ-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

drivers/iio/adc/ad7606.c: In function 'ad7606_read_raw':
>> drivers/iio/adc/ad7606.c:765:23: error: implicit declaration of function 'pwm_get_state_hw'; did you mean 'pwm_get_state'? [-Werror=implicit-function-declaration]
765 | ret = pwm_get_state_hw(st->cnvst_pwm, &cnvst_pwm_state);
| ^~~~~~~~~~~~~~~~
| pwm_get_state
cc1: some warnings being treated as errors


vim +765 drivers/iio/adc/ad7606.c

733
734 static int ad7606_read_raw(struct iio_dev *indio_dev,
735 struct iio_chan_spec const *chan,
736 int *val,
737 int *val2,
738 long m)
739 {
740 int ret, ch = 0;
741 struct ad7606_state *st = iio_priv(indio_dev);
742 struct ad7606_chan_scale *cs;
743 struct pwm_state cnvst_pwm_state;
744
745 switch (m) {
746 case IIO_CHAN_INFO_RAW:
747 iio_device_claim_direct_scoped(return -EBUSY, indio_dev) {
748 ret = ad7606_scan_direct(indio_dev, chan->address, val);
749 if (ret < 0)
750 return ret;
751 return IIO_VAL_INT;
752 }
753 unreachable();
754 case IIO_CHAN_INFO_SCALE:
755 if (st->sw_mode_en)
756 ch = chan->address;
757 cs = &st->chan_scales[ch];
758 *val = cs->scale_avail[cs->range][0];
759 *val2 = cs->scale_avail[cs->range][1];
760 return IIO_VAL_INT_PLUS_MICRO;
761 case IIO_CHAN_INFO_OVERSAMPLING_RATIO:
762 *val = st->oversampling;
763 return IIO_VAL_INT;
764 case IIO_CHAN_INFO_SAMP_FREQ:
> 765 ret = pwm_get_state_hw(st->cnvst_pwm, &cnvst_pwm_state);
766 if (ret < 0)
767 return ret;
768 *val = DIV_ROUND_CLOSEST_ULL(NSEC_PER_SEC, cnvst_pwm_state.period);
769 return IIO_VAL_INT;
770 }
771 return -EINVAL;
772 }
773

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki