[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202210041320.xuXrNbcU-lkp@intel.com>
Date: Tue, 4 Oct 2022 13:09:59 +0800
From: kernel test robot <lkp@...el.com>
To: Kevin Kim <ckkim@...dkernel.com>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
Dongjin Kim <tobetter@...il.com>,
Olliver Schinagl <oliver@...inagl.nl>
Subject: [tobetter:odroid-6.0.y 24/69] drivers/pwm/pwm-gpio.c:138:10: error:
'const struct pwm_ops' has no member named 'config'
tree: https://github.com/tobetter/linux odroid-6.0.y
head: d0a89ea0f4b1f7c259883275f8d9619eff9e8b68
commit: 4d1b2b3baa265dc1b174579a4754cf49eb671c5d [24/69] ODROID-COMMON: pwm: gpio: Add a generic gpio based PWM driver
config: s390-allmodconfig
compiler: s390-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/tobetter/linux/commit/4d1b2b3baa265dc1b174579a4754cf49eb671c5d
git remote add tobetter https://github.com/tobetter/linux
git fetch --no-tags tobetter odroid-6.0.y
git checkout 4d1b2b3baa265dc1b174579a4754cf49eb671c5d
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=s390 SHELL=/bin/bash drivers/pwm/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All error/warnings (new ones prefixed by >>):
>> drivers/pwm/pwm-gpio.c:60:22: warning: no previous prototype for 'gpio_pwm_timer' [-Wmissing-prototypes]
60 | enum hrtimer_restart gpio_pwm_timer(struct hrtimer *timer)
| ^~~~~~~~~~~~~~
>> drivers/pwm/pwm-gpio.c:138:10: error: 'const struct pwm_ops' has no member named 'config'
138 | .config = gpio_pwm_config,
| ^~~~~~
>> drivers/pwm/pwm-gpio.c:138:19: error: initialization of 'int (*)(struct pwm_chip *, struct pwm_device *)' from incompatible pointer type 'int (*)(struct pwm_chip *, struct pwm_device *, int, int)' [-Werror=incompatible-pointer-types]
138 | .config = gpio_pwm_config,
| ^~~~~~~~~~~~~~~
drivers/pwm/pwm-gpio.c:138:19: note: (near initialization for 'gpio_pwm_ops.request')
>> drivers/pwm/pwm-gpio.c:139:10: error: 'const struct pwm_ops' has no member named 'set_polarity'
139 | .set_polarity = gpio_pwm_set_polarity,
| ^~~~~~~~~~~~
>> drivers/pwm/pwm-gpio.c:139:25: error: initialization of 'void (*)(struct pwm_chip *, struct pwm_device *)' from incompatible pointer type 'int (*)(struct pwm_chip *, struct pwm_device *, enum pwm_polarity)' [-Werror=incompatible-pointer-types]
139 | .set_polarity = gpio_pwm_set_polarity,
| ^~~~~~~~~~~~~~~~~~~~~
drivers/pwm/pwm-gpio.c:139:25: note: (near initialization for 'gpio_pwm_ops.free')
>> drivers/pwm/pwm-gpio.c:140:10: error: 'const struct pwm_ops' has no member named 'enable'
140 | .enable = gpio_pwm_enable,
| ^~~~~~
>> drivers/pwm/pwm-gpio.c:140:19: error: initialization of 'int (*)(struct pwm_chip *, struct pwm_device *, struct pwm_capture *, long unsigned int)' from incompatible pointer type 'int (*)(struct pwm_chip *, struct pwm_device *)' [-Werror=incompatible-pointer-types]
140 | .enable = gpio_pwm_enable,
| ^~~~~~~~~~~~~~~
drivers/pwm/pwm-gpio.c:140:19: note: (near initialization for 'gpio_pwm_ops.capture')
>> drivers/pwm/pwm-gpio.c:141:10: error: 'const struct pwm_ops' has no member named 'disable'
141 | .disable = gpio_pwm_disable,
| ^~~~~~~
>> drivers/pwm/pwm-gpio.c:141:20: error: initialization of 'int (*)(struct pwm_chip *, struct pwm_device *, const struct pwm_state *)' from incompatible pointer type 'void (*)(struct pwm_chip *, struct pwm_device *)' [-Werror=incompatible-pointer-types]
141 | .disable = gpio_pwm_disable,
| ^~~~~~~~~~~~~~~~
drivers/pwm/pwm-gpio.c:141:20: note: (near initialization for 'gpio_pwm_ops.apply')
cc1: some warnings being treated as errors
vim +138 drivers/pwm/pwm-gpio.c
59
> 60 enum hrtimer_restart gpio_pwm_timer(struct hrtimer *timer)
61 {
62 struct gpio_pwm_data *gpio_data = container_of(timer,
63 struct gpio_pwm_data,
64 timer);
65 if (!gpio_data->run) {
66 gpio_pwm_off(gpio_data);
67 gpio_data->pin_on = false;
68 return HRTIMER_NORESTART;
69 }
70
71 if (!gpio_data->pin_on) {
72 hrtimer_forward_now(&gpio_data->timer,
73 ns_to_ktime(gpio_data->on_time));
74 gpio_pwm_on(gpio_data);
75 gpio_data->pin_on = true;
76 } else {
77 hrtimer_forward_now(&gpio_data->timer,
78 ns_to_ktime(gpio_data->off_time));
79 gpio_pwm_off(gpio_data);
80 gpio_data->pin_on = false;
81 }
82
83 return HRTIMER_RESTART;
84 }
85
86 static int gpio_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
87 int duty_ns, int period_ns)
88 {
89 struct gpio_pwm_data *gpio_data = pwm_get_chip_data(pwm);
90
91 gpio_data->on_time = duty_ns;
92 gpio_data->off_time = period_ns - duty_ns;
93
94 return 0;
95 }
96
97 static int gpio_pwm_set_polarity(struct pwm_chip *chip, struct pwm_device *pwm,
98 enum pwm_polarity polarity)
99 {
100 struct gpio_pwm_data *gpio_data = pwm_get_chip_data(pwm);
101
102 gpio_data->polarity = (polarity != PWM_POLARITY_NORMAL) ? true : false;
103
104 return 0;
105 }
106
107 static int gpio_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
108 {
109 struct gpio_pwm_data *gpio_data = pwm_get_chip_data(pwm);
110
111 if (gpio_data->run)
112 return -EBUSY;
113
114 gpio_data->run = true;
115 if (gpio_data->off_time) {
116 hrtimer_start(&gpio_data->timer, ktime_set(0, 0),
117 HRTIMER_MODE_REL);
118 } else {
119 if (gpio_data->on_time)
120 gpio_pwm_on(gpio_data);
121 else
122 gpio_pwm_off(gpio_data);
123 }
124
125 return 0;
126 }
127
128 static void gpio_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm)
129 {
130 struct gpio_pwm_data *gpio_data = pwm_get_chip_data(pwm);
131
132 gpio_data->run = false;
133 if (!gpio_data->off_time)
134 gpio_pwm_off(gpio_data);
135 }
136
137 static const struct pwm_ops gpio_pwm_ops = {
> 138 .config = gpio_pwm_config,
> 139 .set_polarity = gpio_pwm_set_polarity,
> 140 .enable = gpio_pwm_enable,
> 141 .disable = gpio_pwm_disable,
142 .owner = THIS_MODULE,
143 };
144
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (119715 bytes)
Powered by blists - more mailing lists