clk: starfive: Avoid casting iomem pointersLet's use a wrapper struct for the auxiliary_device made injh7110_reset_controller_register() so that we can stop casting iomempointers. The casts trip
clk: starfive: Avoid casting iomem pointersLet's use a wrapper struct for the auxiliary_device made injh7110_reset_controller_register() so that we can stop casting iomempointers. The casts trip up tools like sparse, and make for some awkwardcasts that are largely unnecessary. While we're here, change theallocation from devm and actually free the auxiliary_device memory inthe release function. This avoids any use after free problems where theparent device driver is unbound from the device but theauxiliuary_device is still in use accessing devm freed memory.Cc: Tommaso Merciai <tomm.merciai@gmail.com>Cc: Emil Renner Berthing <emil.renner.berthing@canonical.com>Cc: Hal Feng <hal.feng@starfivetech.com>Cc: Conor Dooley <conor.dooley@microchip.com>Cc: Xingyu Wu <xingyu.wu@starfivetech.com>Reviewed-by: Conor Dooley <conor.dooley@microchip.com>Fixes: edab7204afe5 ("clk: starfive: Add StarFive JH7110 system clock driver")Signed-off-by: Stephen Boyd <sboyd@kernel.org>Link: https://lore.kernel.org/r/20230413205528.4044216-1-sboyd@kernel.org
show more ...