diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2024-09-02 12:53:42 +0200 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2024-09-06 14:41:35 +0200 |
commit | 7a195f1c4042110ca37c88ec2829134541f6ecf7 (patch) | |
tree | f7e9b66d3fae15bf2ad54a755f3d0f965d8ffaea /drivers/gpu/drm/tiny | |
parent | drm/bochs: Do managed resource cleanup (diff) | |
download | linux-7a195f1c4042110ca37c88ec2829134541f6ecf7.tar.xz linux-7a195f1c4042110ca37c88ec2829134541f6ecf7.zip |
drm/bochs: Pass bochs device to various functions
Avoid upcasting from struct drm_device by passing the bochs device
directly to functions.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240902105546.792625-5-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/tiny')
-rw-r--r-- | drivers/gpu/drm/tiny/bochs.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/tiny/bochs.c b/drivers/gpu/drm/tiny/bochs.c index 5d09b4cb28ed..acb2652577d4 100644 --- a/drivers/gpu/drm/tiny/bochs.c +++ b/drivers/gpu/drm/tiny/bochs.c @@ -204,9 +204,9 @@ static const struct drm_edid *bochs_hw_read_edid(struct drm_connector *connector return drm_edid_read_custom(connector, bochs_get_edid_block, bochs); } -static int bochs_hw_init(struct drm_device *dev) +static int bochs_hw_init(struct bochs_device *bochs) { - struct bochs_device *bochs = dev->dev_private; + struct drm_device *dev = bochs->dev; struct pci_dev *pdev = to_pci_dev(dev->dev); unsigned long addr, size, mem, ioaddr, iosize; u16 id; @@ -481,9 +481,9 @@ static const struct drm_connector_funcs bochs_connector_connector_funcs = { .atomic_destroy_state = drm_atomic_helper_connector_destroy_state, }; -static void bochs_connector_init(struct drm_device *dev) +static void bochs_connector_init(struct bochs_device *bochs) { - struct bochs_device *bochs = dev->dev_private; + struct drm_device *dev = bochs->dev; struct drm_connector *connector = &bochs->connector; drm_connector_init(dev, connector, &bochs_connector_connector_funcs, @@ -516,7 +516,7 @@ static int bochs_kms_init(struct bochs_device *bochs) bochs->dev->mode_config.funcs = &bochs_mode_funcs; - bochs_connector_init(bochs->dev); + bochs_connector_init(bochs); drm_simple_display_pipe_init(bochs->dev, &bochs->pipe, &bochs_pipe_funcs, @@ -544,7 +544,7 @@ static int bochs_load(struct drm_device *dev) dev->dev_private = bochs; bochs->dev = dev; - ret = bochs_hw_init(dev); + ret = bochs_hw_init(bochs); if (ret) return ret; |