vga_switcheroo: Constify vga_switcheroo_handler
authorLukas Wunner <lukas@wunner.de>
Sun, 18 Oct 2015 11:05:40 +0000 (13:05 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 20 Oct 2015 18:19:29 +0000 (20:19 +0200)
vga_switcheroo_client_ops has always been declared const since its
introduction with 26ec685ff9d9 ("vga_switcheroo: Introduce struct
vga_switcheroo_client_ops").

Do so for vga_switcheroo_handler as well.

 drivers/gpu/drm/amd/amdgpu/amdgpu.ko:
   6 .rodata       00009888
- 19 .data         00001f00
+ 19 .data         00001ee0
 drivers/gpu/drm/nouveau/nouveau.ko:
   6 .rodata       000460b8
  17 .data         00018fe0
 drivers/gpu/drm/radeon/radeon.ko:
-  7 .rodata       00030944
+  7 .rodata       00030964
- 21 .data         0000d6a0
+ 21 .data         0000d678
 drivers/platform/x86/apple-gmux.ko:
-  7 .rodata       00000140
+  7 .rodata       00000160
- 11 .data         000000e0
+ 11 .data         000000b8

Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Darren Hart <dvhart@linux.intel.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Christian König <christian.koenig@amd.com>.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c
drivers/gpu/drm/nouveau/nouveau_acpi.c
drivers/gpu/drm/radeon/radeon_atpx_handler.c
drivers/gpu/vga/vga_switcheroo.c
drivers/platform/x86/apple-gmux.c
include/linux/vga_switcheroo.h

index 1a6b239baab920d63e687954dbab2aa86c420422..5a8fbadbd27b4ca0ed663f4ad9cad804b9aae87f 100644 (file)
@@ -501,7 +501,7 @@ static int amdgpu_atpx_get_client_id(struct pci_dev *pdev)
                return VGA_SWITCHEROO_DIS;
 }
 
-static struct vga_switcheroo_handler amdgpu_atpx_handler = {
+static const struct vga_switcheroo_handler amdgpu_atpx_handler = {
        .switchto = amdgpu_atpx_switchto,
        .power_state = amdgpu_atpx_power_state,
        .init = amdgpu_atpx_init,
index df2d9818aba3a4ce9d171b3a36cef89f525b893f..8b8332e46f24059f561ca5b1f814ed849d51aa7b 100644 (file)
@@ -206,7 +206,7 @@ static int nouveau_dsm_get_client_id(struct pci_dev *pdev)
        return VGA_SWITCHEROO_DIS;
 }
 
-static struct vga_switcheroo_handler nouveau_dsm_handler = {
+static const struct vga_switcheroo_handler nouveau_dsm_handler = {
        .switchto = nouveau_dsm_switchto,
        .power_state = nouveau_dsm_power_state,
        .get_client_id = nouveau_dsm_get_client_id,
index a771b9f0bf98d60e51f1c15f3f0b69f7832b08ca..c4b4f298a2831a2ca3723bebe3ef8834bc6a6f3c 100644 (file)
@@ -499,7 +499,7 @@ static int radeon_atpx_get_client_id(struct pci_dev *pdev)
                return VGA_SWITCHEROO_DIS;
 }
 
-static struct vga_switcheroo_handler radeon_atpx_handler = {
+static const struct vga_switcheroo_handler radeon_atpx_handler = {
        .switchto = radeon_atpx_switchto,
        .power_state = radeon_atpx_power_state,
        .init = radeon_atpx_init,
index af0d372ff7d43d1e90bc9ec4a35a823a5f68acf0..56bbbd65ae8a074051a4cccb320d84acae3d74e4 100644 (file)
@@ -140,7 +140,7 @@ struct vgasr_priv {
        int registered_clients;
        struct list_head clients;
 
-       struct vga_switcheroo_handler *handler;
+       const struct vga_switcheroo_handler *handler;
 };
 
 #define ID_BIT_AUDIO           0x100
@@ -195,7 +195,7 @@ static void vga_switcheroo_enable(void)
  *
  * Return: 0 on success, -EINVAL if a handler was already registered.
  */
-int vga_switcheroo_register_handler(struct vga_switcheroo_handler *handler)
+int vga_switcheroo_register_handler(const struct vga_switcheroo_handler *handler)
 {
        mutex_lock(&vgasr_mutex);
        if (vgasr_priv.handler) {
index 0dec3f59917a7e3bcb034b242f2d60be7e7f98cb..976efeb3f2ba3f377f777c91150f7afcb7b400a2 100644 (file)
@@ -346,7 +346,7 @@ gmux_active_client(struct apple_gmux_data *gmux_data)
        return VGA_SWITCHEROO_DIS;
 }
 
-static struct vga_switcheroo_handler gmux_handler = {
+static const struct vga_switcheroo_handler gmux_handler = {
        .switchto = gmux_switchto,
        .power_state = gmux_set_power_state,
        .get_client_id = gmux_get_client_id,
index c55751155631cba7a8fa98adb44697fcd567b09f..786bc931dbd17a24ba5cc3113ede3e2750bbe197 100644 (file)
@@ -137,7 +137,7 @@ int vga_switcheroo_register_audio_client(struct pci_dev *pdev,
 void vga_switcheroo_client_fb_set(struct pci_dev *dev,
                                  struct fb_info *info);
 
-int vga_switcheroo_register_handler(struct vga_switcheroo_handler *handler);
+int vga_switcheroo_register_handler(const struct vga_switcheroo_handler *handler);
 void vga_switcheroo_unregister_handler(void);
 
 int vga_switcheroo_process_delayed_switch(void);
@@ -155,7 +155,7 @@ static inline void vga_switcheroo_unregister_client(struct pci_dev *dev) {}
 static inline int vga_switcheroo_register_client(struct pci_dev *dev,
                const struct vga_switcheroo_client_ops *ops, bool driver_power_control) { return 0; }
 static inline void vga_switcheroo_client_fb_set(struct pci_dev *dev, struct fb_info *info) {}
-static inline int vga_switcheroo_register_handler(struct vga_switcheroo_handler *handler) { return 0; }
+static inline int vga_switcheroo_register_handler(const struct vga_switcheroo_handler *handler) { return 0; }
 static inline int vga_switcheroo_register_audio_client(struct pci_dev *pdev,
        const struct vga_switcheroo_client_ops *ops,
        enum vga_switcheroo_client_id id) { return 0; }