From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] aiodev: mc13xxx_adc: zero-initialize struct aiochannel
Date: Tue, 16 Jul 2024 13:56:21 +0200 [thread overview]
Message-ID: <20240716115621.1953788-1-a.fatoum@pengutronix.de> (raw)
The mc13xxx_adc driver is the only driver that doesn't allocate the
channels from pre-zeroed memory. The aiodev core doesn't currently
require it, but we may want to in the future, so let's explicitly
zero the channel like all other drivers do.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
drivers/aiodev/mc13xxx_adc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/aiodev/mc13xxx_adc.c b/drivers/aiodev/mc13xxx_adc.c
index 21eea1f525af..4d80ee57e3f5 100644
--- a/drivers/aiodev/mc13xxx_adc.c
+++ b/drivers/aiodev/mc13xxx_adc.c
@@ -196,7 +196,7 @@ int mc13xxx_adc_probe(struct device *dev, struct mc13xxx *mc_dev)
mc13xxx_adc->mc_dev = mc_dev;
mc13xxx_adc->aiodev.num_channels = chans;
- mc13xxx_adc->aiochan = xmalloc(mc13xxx_adc->aiodev.num_channels *
+ mc13xxx_adc->aiochan = xzalloc(mc13xxx_adc->aiodev.num_channels *
sizeof(*mc13xxx_adc->aiochan));
mc13xxx_adc->aiodev.hwdev = dev;
mc13xxx_adc->aiodev.channels =
--
2.39.2
next reply other threads:[~2024-07-16 11:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-16 11:56 Ahmad Fatoum [this message]
2024-07-19 6:21 ` Sascha Hauer
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=20240716115621.1953788-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/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