]> git.baikalelectronics.ru Git - kernel.git/commit
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>
Fri, 17 Dec 2021 09:30:16 +0000 (10:30 +0100)
commit2a3cd67e0eda66a4d76ba2486a4d4f789e7a594f
treebc3cb0f50c48e9b667b296142a3da6f19cf12f27
parent09e9b52bf40bbe5a5ab43b1884a15f50716c979f
staging: most: dim2: use device release method

commit e191abf129eb434502358658c36cd68fbc81497c upstream.

Commit f74058f3dcaa ("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: f74058f3dcaa ("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