drm/ast: Allocate instance of struct ast_i2c_chan with managed helpers
authorThomas Zimmermann <tzimmermann@suse.de>
Mon, 25 Mar 2024 20:06:49 +0000 (21:06 +0100)
committerThomas Zimmermann <tzimmermann@suse.de>
Tue, 2 Apr 2024 08:40:46 +0000 (10:40 +0200)
commite14ab3037383f4e3d026e2aea1ad53644a3735ed
tree73892c8d5e5599a39de9ebecac1415515e8de07b
parentc0af492c872b949cf3e8b91ef66094bc5f81e181
drm/ast: Allocate instance of struct ast_i2c_chan with managed helpers

Replace kzalloc() with drmm_kzalloc() and thereby put the release of
the I2C instance into a separate action. Avoids explicit error roll-
back in ast_i2c_chan_create(). No functional changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Sui Jingfeng <sui.jingfeng@linux.dev>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240325200855.21150-5-tzimmermann@suse.de
drivers/gpu/drm/ast/ast_i2c.c