mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] aiodev: mc13xxx_adc: zero-initialize struct aiochannel
@ 2024-07-16 11:56 Ahmad Fatoum
  2024-07-19  6:21 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2024-07-16 11:56 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-07-19  6:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-16 11:56 [PATCH] aiodev: mc13xxx_adc: zero-initialize struct aiochannel Ahmad Fatoum
2024-07-19  6:21 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox