From: Dan Carpenter <dan.carpenter@linaro.org>
To: Shawn Lin <shawn.lin@rock-chips.com>
Cc: linux-arm-kernel@lists.infradead.org,
linux-rockchip@lists.infradead.org,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: [bug report] soc: rockchip: grf: Support multiple grf to be handled
Date: Fri, 6 Feb 2026 16:41:21 +0300 [thread overview]
Message-ID: <aYXvgTcUJWQL2can@stanley.mountain> (raw)
In-Reply-To: <caa37f28-a2e8-4e0a-a9ce-a365ce805e4b@stanley.mountain>
[ Smatch checking is paused while we raise funding. #SadFace
https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/ -dan ]
Hello Shawn Lin,
Commit 75fb63ae0312 ("soc: rockchip: grf: Support multiple grf to be
handled") from Jan 16, 2026 (linux-next), leads to the following
Smatch static checker warning:
drivers/soc/rockchip/grf.c:249 rockchip_grf_init()
warn: inconsistent refcounting 'np->kobj.kref.refcount.refs.counter':
drivers/soc/rockchip/grf.c
212 static int __init rockchip_grf_init(void)
213 {
214 const struct rockchip_grf_info *grf_info;
215 const struct of_device_id *match;
216 struct device_node *np;
217 struct regmap *grf;
218 int ret, i;
219
220 for_each_matching_node_and_match(np, rockchip_grf_dt_match, &match) {
221 if (!of_device_is_available(np))
222 continue;
223 if (!match || !match->data) {
224 pr_err("%s: missing grf data\n", __func__);
225 of_node_put(np);
226 return -EINVAL;
227 }
228
229 grf_info = match->data;
230
231 grf = syscon_node_to_regmap(np);
232 if (IS_ERR(grf)) {
233 pr_err("%s: could not get grf syscon\n", __func__);
234 return PTR_ERR(grf);
Missing of_node_put(np) before returning.
235 }
236
237 for (i = 0; i < grf_info->num_values; i++) {
238 const struct rockchip_grf_value *val = &grf_info->values[i];
239
240 pr_debug("%s: adjusting %s in %#6x to %#10x\n", __func__,
241 val->desc, val->reg, val->val);
242 ret = regmap_write(grf, val->reg, val->val);
243 if (ret < 0)
244 pr_err("%s: write to %#6x failed with %d\n",
245 __func__, val->reg, ret);
246 }
247 }
248
249 return 0;
250 }
regards,
dan carpenter
prev parent reply other threads:[~2026-02-06 13:41 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <caa37f28-a2e8-4e0a-a9ce-a365ce805e4b@stanley.mountain>
2026-02-06 13:40 ` [bug report] phy: apple: Add Apple Type-C PHY Dan Carpenter
2026-02-06 21:47 ` Janne Grunau
2026-02-06 21:48 ` Sven Peter
2026-02-06 13:40 ` [bug report] spi: stm32: properly fail on dma_request_chan error Dan Carpenter
2026-02-06 13:41 ` [bug report] remoteproc: imx_rproc: Introduce prepare ops for imx_rproc_dcfg Dan Carpenter
2026-02-06 16:29 ` Mathieu Poirier
2026-02-08 11:45 ` Peng Fan
2026-02-06 13:41 ` Dan Carpenter [this message]
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=aYXvgTcUJWQL2can@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=shawn.lin@rock-chips.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox