]> git.baikalelectronics.ru Git - kernel.git/commit
pwm: lpc18xx-sct: Reduce number of devm memory allocations
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 10 Nov 2021 08:49:49 +0000 (09:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:15 +0000 (14:23 +0200)
commit1e58bdfea0e00fde3a8cde4afb8ba3bca2a0670b
treef36f6f5f5f3531f53b1ff548310cd8968a1ed2e8
parent50699d3cf928b041753cb3f791888826c321d62b
pwm: lpc18xx-sct: Reduce number of devm memory allocations

[ Upstream commit b4a7c66384a88f75f58e39f64a620e1fa4ff7c69 ]

Each devm allocations has an overhead of 24 bytes to store the related
struct devres_node additionally to the fragmentation of the allocator.
So allocating 16 struct lpc18xx_pwm_data (which only hold a single int)
adds quite some overhead. Instead put the per-channel data into the
driver data struct and allocate it in one go.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pwm/pwm-lpc18xx-sct.c