diff options
| author | Lukas Wunner <lukas@wunner.de> | 2015-08-28 06:54:07 -0400 |
|---|---|---|
| committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-10-16 09:50:56 -0400 |
| commit | fa3e967fffaf267ccab7959429722da34e45ad77 (patch) | |
| tree | 2bd19d2c4ccffa81225cb1cd1b1dfdbfec711f7e /drivers/gpu/vga | |
| parent | 21c5ba8c1ee02f204e556c26703cebaf9c4019e0 (diff) | |
vga_switcheroo: Use enum vga_switcheroo_client_id instead of int
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/vga')
| -rw-r--r-- | drivers/gpu/vga/vga_switcheroo.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c index 989630528529..af0d372ff7d4 100644 --- a/drivers/gpu/vga/vga_switcheroo.c +++ b/drivers/gpu/vga/vga_switcheroo.c | |||
| @@ -102,7 +102,7 @@ struct vga_switcheroo_client { | |||
| 102 | struct fb_info *fb_info; | 102 | struct fb_info *fb_info; |
| 103 | enum vga_switcheroo_state pwr_state; | 103 | enum vga_switcheroo_state pwr_state; |
| 104 | const struct vga_switcheroo_client_ops *ops; | 104 | const struct vga_switcheroo_client_ops *ops; |
| 105 | int id; | 105 | enum vga_switcheroo_client_id id; |
| 106 | bool active; | 106 | bool active; |
| 107 | bool driver_power_control; | 107 | bool driver_power_control; |
| 108 | struct list_head list; | 108 | struct list_head list; |
| @@ -233,7 +233,8 @@ EXPORT_SYMBOL(vga_switcheroo_unregister_handler); | |||
| 233 | 233 | ||
| 234 | static int register_client(struct pci_dev *pdev, | 234 | static int register_client(struct pci_dev *pdev, |
| 235 | const struct vga_switcheroo_client_ops *ops, | 235 | const struct vga_switcheroo_client_ops *ops, |
| 236 | int id, bool active, bool driver_power_control) | 236 | enum vga_switcheroo_client_id id, bool active, |
| 237 | bool driver_power_control) | ||
| 237 | { | 238 | { |
| 238 | struct vga_switcheroo_client *client; | 239 | struct vga_switcheroo_client *client; |
| 239 | 240 | ||
| @@ -288,7 +289,7 @@ EXPORT_SYMBOL(vga_switcheroo_register_client); | |||
| 288 | * vga_switcheroo_register_audio_client - register audio client | 289 | * vga_switcheroo_register_audio_client - register audio client |
| 289 | * @pdev: client pci device | 290 | * @pdev: client pci device |
| 290 | * @ops: client callbacks | 291 | * @ops: client callbacks |
| 291 | * @id: client identifier, see enum vga_switcheroo_client_id | 292 | * @id: client identifier |
| 292 | * | 293 | * |
| 293 | * Register audio client (audio device on a GPU). The power state of the | 294 | * Register audio client (audio device on a GPU). The power state of the |
| 294 | * client is assumed to be ON. | 295 | * client is assumed to be ON. |
| @@ -297,7 +298,7 @@ EXPORT_SYMBOL(vga_switcheroo_register_client); | |||
| 297 | */ | 298 | */ |
| 298 | int vga_switcheroo_register_audio_client(struct pci_dev *pdev, | 299 | int vga_switcheroo_register_audio_client(struct pci_dev *pdev, |
| 299 | const struct vga_switcheroo_client_ops *ops, | 300 | const struct vga_switcheroo_client_ops *ops, |
| 300 | int id) | 301 | enum vga_switcheroo_client_id id) |
| 301 | { | 302 | { |
| 302 | return register_client(pdev, ops, id | ID_BIT_AUDIO, false, false); | 303 | return register_client(pdev, ops, id | ID_BIT_AUDIO, false, false); |
| 303 | } | 304 | } |
| @@ -315,7 +316,8 @@ find_client_from_pci(struct list_head *head, struct pci_dev *pdev) | |||
| 315 | } | 316 | } |
| 316 | 317 | ||
| 317 | static struct vga_switcheroo_client * | 318 | static struct vga_switcheroo_client * |
| 318 | find_client_from_id(struct list_head *head, int client_id) | 319 | find_client_from_id(struct list_head *head, |
| 320 | enum vga_switcheroo_client_id client_id) | ||
| 319 | { | 321 | { |
| 320 | struct vga_switcheroo_client *client; | 322 | struct vga_switcheroo_client *client; |
| 321 | 323 | ||
| @@ -497,7 +499,8 @@ static int vga_switchoff(struct vga_switcheroo_client *client) | |||
| 497 | return 0; | 499 | return 0; |
| 498 | } | 500 | } |
| 499 | 501 | ||
| 500 | static void set_audio_state(int id, enum vga_switcheroo_state state) | 502 | static void set_audio_state(enum vga_switcheroo_client_id id, |
| 503 | enum vga_switcheroo_state state) | ||
| 501 | { | 504 | { |
| 502 | struct vga_switcheroo_client *client; | 505 | struct vga_switcheroo_client *client; |
| 503 | 506 | ||
| @@ -584,7 +587,7 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf, | |||
| 584 | int ret; | 587 | int ret; |
| 585 | bool delay = false, can_switch; | 588 | bool delay = false, can_switch; |
| 586 | bool just_mux = false; | 589 | bool just_mux = false; |
| 587 | int client_id = VGA_SWITCHEROO_UNKNOWN_ID; | 590 | enum vga_switcheroo_client_id client_id = VGA_SWITCHEROO_UNKNOWN_ID; |
| 588 | struct vga_switcheroo_client *client = NULL; | 591 | struct vga_switcheroo_client *client = NULL; |
| 589 | 592 | ||
| 590 | if (cnt > 63) | 593 | if (cnt > 63) |
