staging: most: dim2: use device release method
authorNikita Yushchenko <nikita.yoush@cogentembedded.com>
Tue, 5 Oct 2021 14:34:50 +0000 (17:34 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Oct 2021 12:27:55 +0000 (14:27 +0200)
commitd445aa402d60014a37a199fae2bba379696b007d
tree17a603a3ba36c97748ecb8a67b0110531aad1f90
parent2ab189164056b05474275bb40caa038a37713061
staging: most: dim2: use device release method

Commit 723de0f9171e ("staging: most: remove device from interface
structure") moved registration of driver-provided struct device to
the most subsystem. This updated dim2 driver as well.

However, struct device passed to register_device() becomes refcounted,
and must not be explicitly deallocated, but must provide release method
instead. Which is incompatible with managing it via devres.

This patch makes the device structure allocated without devres, adds
device release method, and moves device destruction there.

Fixes: 723de0f9171e ("staging: most: remove device from interface structure")
Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Link: https://lore.kernel.org/r/20211005143448.8660-2-nikita.yoush@cogentembedded.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/most/dim2/dim2.c