vga_switcheroo: Use enum vga_switcheroo_state instead of int
authorLukas Wunner <lukas@wunner.de>
Fri, 28 Aug 2015 09:56:26 +0000 (11:56 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 16 Oct 2015 13:50:55 +0000 (15:50 +0200)
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/vga/vga_switcheroo.c
include/linux/vga_switcheroo.h

index 1acbe20143d422515552d3d5a9d5a36d94e6cae3..a7870d23c5ab3523499bcb323025b2fa2a204898 100644 (file)
 struct vga_switcheroo_client {
        struct pci_dev *pdev;
        struct fb_info *fb_info;
-       int pwr_state;
+       enum vga_switcheroo_state pwr_state;
        const struct vga_switcheroo_client_ops *ops;
        int id;
        bool active;
@@ -344,7 +344,7 @@ find_active_client(struct list_head *head)
  *
  * Return: Power state.
  */
-int vga_switcheroo_get_client_state(struct pci_dev *pdev)
+enum vga_switcheroo_state vga_switcheroo_get_client_state(struct pci_dev *pdev)
 {
        struct vga_switcheroo_client *client;
        enum vga_switcheroo_state ret;
@@ -496,7 +496,7 @@ static int vga_switchoff(struct vga_switcheroo_client *client)
        return 0;
 }
 
-static void set_audio_state(int id, int state)
+static void set_audio_state(int id, enum vga_switcheroo_state state)
 {
        struct vga_switcheroo_client *client;
 
index 37649919771754cb2a953a3793a600aa9e16612b..e636617575056c8fde2571e15b44f25ea1bb3fc7 100644 (file)
@@ -138,7 +138,7 @@ void vga_switcheroo_unregister_handler(void);
 
 int vga_switcheroo_process_delayed_switch(void);
 
-int vga_switcheroo_get_client_state(struct pci_dev *dev);
+enum vga_switcheroo_state vga_switcheroo_get_client_state(struct pci_dev *dev);
 
 void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic);
 
@@ -157,7 +157,7 @@ static inline int vga_switcheroo_register_audio_client(struct pci_dev *pdev,
        int id) { return 0; }
 static inline void vga_switcheroo_unregister_handler(void) {}
 static inline int vga_switcheroo_process_delayed_switch(void) { return 0; }
-static inline int vga_switcheroo_get_client_state(struct pci_dev *dev) { return VGA_SWITCHEROO_ON; }
+static inline enum vga_switcheroo_state vga_switcheroo_get_client_state(struct pci_dev *dev) { return VGA_SWITCHEROO_ON; }
 
 static inline void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic) {}