Skip to content

Commit d231cde

Browse files
committed
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: Thomas Zimmermann <tzimmermann@suse.de> Fixes: 11e8f5f ("drm: Add simpledrm driver") Cc: <stable@vger.kernel.org> # v5.14+ Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://lore.kernel.org/r/20250407134753.985925-2-tzimmermann@suse.de
1 parent 9521f9b commit d231cde

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/gpu/drm/sysfb/simpledrm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ static struct simpledrm_device *simpledrm_device_of_dev(struct drm_device *dev)
275275

276276
static void simpledrm_device_release_clocks(void *res)
277277
{
278-
struct simpledrm_device *sdev = simpledrm_device_of_dev(res);
278+
struct simpledrm_device *sdev = res;
279279
unsigned int i;
280280

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

374374
static void simpledrm_device_release_regulators(void *res)
375375
{
376-
struct simpledrm_device *sdev = simpledrm_device_of_dev(res);
376+
struct simpledrm_device *sdev = res;
377377
unsigned int i;
378378

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

0 commit comments

Comments
 (0)