Skip to content
Commit 340b4dd6 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab
Browse files

media: atomisp: gc0310: Use devm_kzalloc() for data struct



Use devm_kzalloc() to allocate the data struct. It is always free-ed as
the last step of probe-error-exit or remove, so it can be devm-managed.

This will make unwinding things easier when support is added to the gc0310
code to use standard GPIO APIs instead of the custom atomisp_gmin code.

This also allows dropping the out_free label and use direct return
on errors.

This may seem like a functional change since the out_free label also
did a v4l2_device_unregister_subdev() but at the 1 changed return
the device is not registered yet, so that always is a no-op and can
be dropped.

Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 2726c899
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment