From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: drivers/clocksource/timer-atmel-st.c:247 atmel_st_timer_init() warn: 'sclk' from clk_prepare_enable() not released on lines: 231.
Date: Tue, 26 Nov 2024 20:25:34 +0800 [thread overview]
Message-ID: <202411262044.zAgkiJSZ-lkp@intel.com> (raw)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=unknown-8bit, Size: 9505 bytes --]
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Adrian Hunter <adrian.hunter@intel.com>
CC: Thomas Gleixner <tglx@linutronix.de>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 7eef7e306d3c40a0c5b9ff6adc9b273cc894dbd5
commit: 5284984a4fbacb0883bfebe905902cdda2891a07 bug: Fix no-return-statement warning with !CONFIG_BUG
date: 8 months ago
:::::: branch date: 9 hours ago
:::::: commit date: 8 months ago
config: nios2-randconfig-r073-20241126 (https://download.01.org/0day-ci/archive/20241126/202411262044.zAgkiJSZ-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 14.2.0
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@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202411262044.zAgkiJSZ-lkp@intel.com/
New smatch warnings:
drivers/clocksource/timer-atmel-st.c:247 atmel_st_timer_init() warn: 'sclk' from clk_prepare_enable() not released on lines: 231.
Old smatch warnings:
drivers/clocksource/timer-atmel-st.c:247 atmel_st_timer_init() warn: 'irq' from request_irq() not released on lines: 219,225,231.
vim +/sclk +247 drivers/clocksource/timer-atmel-st.c
5e802dfab7bbbe arch/arm/mach-at91/at91rm9200_time.c David Brownell 2007-07-31 179
73a59c1c4af06c arch/arm/mach-at91rm9200/time.c SAN People 2006-01-09 180 /*
5e802dfab7bbbe arch/arm/mach-at91/at91rm9200_time.c David Brownell 2007-07-31 181 * ST (system timer) module supports both clockevents and clocksource.
73a59c1c4af06c arch/arm/mach-at91rm9200/time.c SAN People 2006-01-09 182 */
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 183 static int __init atmel_st_timer_init(struct device_node *node)
73a59c1c4af06c arch/arm/mach-at91rm9200/time.c SAN People 2006-01-09 184 {
216ab8f155fba6 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-08-16 185 struct clk *sclk;
216ab8f155fba6 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-08-16 186 unsigned int sclk_rate, val;
0afb46b248eff6 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-03-13 187 int irq, ret;
adf2edfd6003c4 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-03-12 188
adf2edfd6003c4 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-03-12 189 regmap_st = syscon_node_to_regmap(node);
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 190 if (IS_ERR(regmap_st)) {
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 191 pr_err("Unable to get regmap\n");
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 192 return PTR_ERR(regmap_st);
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 193 }
454c46df839456 arch/arm/mach-at91/at91rm9200_time.c Joachim Eastwood 2012-10-28 194
5e802dfab7bbbe arch/arm/mach-at91/at91rm9200_time.c David Brownell 2007-07-31 195 /* Disable all timer interrupts, and clear any pending ones */
adf2edfd6003c4 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-03-12 196 regmap_write(regmap_st, AT91_ST_IDR,
5e802dfab7bbbe arch/arm/mach-at91/at91rm9200_time.c David Brownell 2007-07-31 197 AT91_ST_PITS | AT91_ST_WDOVF | AT91_ST_RTTINC | AT91_ST_ALMS);
adf2edfd6003c4 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-03-12 198 regmap_read(regmap_st, AT91_ST_SR, &val);
adf2edfd6003c4 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-03-12 199
adf2edfd6003c4 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-03-12 200 /* Get the interrupts property */
0afb46b248eff6 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-03-13 201 irq = irq_of_parse_and_map(node, 0);
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 202 if (!irq) {
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 203 pr_err("Unable to get IRQ from DT\n");
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 204 return -EINVAL;
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 205 }
73a59c1c4af06c arch/arm/mach-at91rm9200/time.c SAN People 2006-01-09 206
2a6f9902c6a799 arch/arm/mach-at91rm9200/time.c Andrew Victor 2006-06-19 207 /* Make IRQs happen for the system timer */
0afb46b248eff6 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-03-13 208 ret = request_irq(irq, at91rm9200_timer_interrupt,
0afb46b248eff6 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-03-13 209 IRQF_SHARED | IRQF_TIMER | IRQF_IRQPOLL,
0afb46b248eff6 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-03-13 210 "at91_tick", regmap_st);
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 211 if (ret) {
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 212 pr_err("Unable to setup IRQ\n");
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 213 return ret;
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 214 }
73a59c1c4af06c arch/arm/mach-at91rm9200/time.c SAN People 2006-01-09 215
216ab8f155fba6 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-08-16 216 sclk = of_clk_get(node, 0);
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 217 if (IS_ERR(sclk)) {
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 218 pr_err("Unable to get slow clock\n");
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 219 return PTR_ERR(sclk);
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 220 }
216ab8f155fba6 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-08-16 221
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 222 ret = clk_prepare_enable(sclk);
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 223 if (ret) {
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 224 pr_err("Could not enable slow clock\n");
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 225 return ret;
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 226 }
216ab8f155fba6 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-08-16 227
216ab8f155fba6 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-08-16 228 sclk_rate = clk_get_rate(sclk);
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 229 if (!sclk_rate) {
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 230 pr_err("Invalid slow clock rate\n");
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 231 return -EINVAL;
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 232 }
216ab8f155fba6 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-08-16 233 timer_latch = (sclk_rate + HZ / 2) / HZ;
216ab8f155fba6 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-08-16 234
5e802dfab7bbbe arch/arm/mach-at91/at91rm9200_time.c David Brownell 2007-07-31 235 /* The 32KiHz "Slow Clock" (tick every 30517.58 nanoseconds) is used
5e802dfab7bbbe arch/arm/mach-at91/at91rm9200_time.c David Brownell 2007-07-31 236 * directly for the clocksource and all clockevents, after adjusting
5e802dfab7bbbe arch/arm/mach-at91/at91rm9200_time.c David Brownell 2007-07-31 237 * its prescaler from the 1 Hz default.
5e802dfab7bbbe arch/arm/mach-at91/at91rm9200_time.c David Brownell 2007-07-31 238 */
adf2edfd6003c4 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-03-12 239 regmap_write(regmap_st, AT91_ST_RTMR, 1);
73a59c1c4af06c arch/arm/mach-at91rm9200/time.c SAN People 2006-01-09 240
5e802dfab7bbbe arch/arm/mach-at91/at91rm9200_time.c David Brownell 2007-07-31 241 /* Setup timer clockevent, with minimum of two ticks (important!!) */
320ab2b0b1e08e arch/arm/mach-at91/at91rm9200_time.c Rusty Russell 2008-12-13 242 clkevt.cpumask = cpumask_of(0);
216ab8f155fba6 drivers/clocksource/timer-atmel-st.c Alexandre Belloni 2015-08-16 243 clockevents_config_and_register(&clkevt, sclk_rate,
1c283531115bda arch/arm/mach-at91/at91rm9200_time.c Uwe Kleine-König 2013-10-08 244 2, AT91_ST_ALMV);
2a6f9902c6a799 arch/arm/mach-at91rm9200/time.c Andrew Victor 2006-06-19 245
5e802dfab7bbbe arch/arm/mach-at91/at91rm9200_time.c David Brownell 2007-07-31 246 /* register clocksource */
adbaf5254152f3 drivers/clocksource/timer-atmel-st.c Daniel Lezcano 2016-06-06 @247 return clocksource_register_hz(&clk32k, sclk_rate);
:::::: The code at line 247 was first introduced by commit
:::::: adbaf5254152f322b873d0a9cd0f150dd30c64aa clocksource/drivers/atmel-st: Convert init function to return error
:::::: TO: Daniel Lezcano <daniel.lezcano@linaro.org>
:::::: CC: Daniel Lezcano <daniel.lezcano@linaro.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2024-11-26 12:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-26 12:25 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-11-01 16:57 drivers/clocksource/timer-atmel-st.c:247 atmel_st_timer_init() warn: 'sclk' from clk_prepare_enable() not released on lines: 231 kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202411262044.zAgkiJSZ-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.