Commit d231cde7 authored by Thomas Zimmermann's avatar Thomas Zimmermann
Browse files

drm/simpledrm: Do not upcast in release helpers



The res pointer passed to simpledrm_device_release_clocks() and
simpledrm_device_release_regulators() points to an instance of
struct simpledrm_device. No need to upcast from struct drm_device.
The upcast is harmless, as DRM device is the first field in struct
simpledrm_device.

Signed-off-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Fixes: 11e8f5fd ("drm: Add simpledrm driver")
Cc: <stable@vger.kernel.org> # v5.14+
Reviewed-by: default avatarJavier Martinez Canillas <javierm@redhat.com>
Reviewed-by: default avatarJocelyn Falempe <jfalempe@redhat.com>
Link: https://lore.kernel.org/r/20250407134753.985925-2-tzimmermann@suse.de
parent 9521f9ba
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -275,7 +275,7 @@ static struct simpledrm_device *simpledrm_device_of_dev(struct drm_device *dev)

static void simpledrm_device_release_clocks(void *res)
{
	struct simpledrm_device *sdev = simpledrm_device_of_dev(res);
	struct simpledrm_device *sdev = res;
	unsigned int i;

	for (i = 0; i < sdev->clk_count; ++i) {
@@ -373,7 +373,7 @@ static int simpledrm_device_init_clocks(struct simpledrm_device *sdev)

static void simpledrm_device_release_regulators(void *res)
{
	struct simpledrm_device *sdev = simpledrm_device_of_dev(res);
	struct simpledrm_device *sdev = res;
	unsigned int i;

	for (i = 0; i < sdev->regulator_count; ++i) {