Commit 7491bfb4 authored by Thierry Reding's avatar Thierry Reding Committed by Daniel Vetter

vga_switcheroo: Wrap overly long lines

Wrap overly long lines to make checkpatch happy. While at it, also add
blank lines after declarations to eliminate additional problems flagged
by checkpatch.
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 9b0be1eb
...@@ -169,7 +169,8 @@ int vga_switcheroo_register_client(struct pci_dev *pdev, ...@@ -169,7 +169,8 @@ int vga_switcheroo_register_client(struct pci_dev *pdev,
bool driver_power_control) bool driver_power_control)
{ {
return register_client(pdev, ops, -1, return register_client(pdev, ops, -1,
pdev == vga_default_device(), driver_power_control); pdev == vga_default_device(),
driver_power_control);
} }
EXPORT_SYMBOL(vga_switcheroo_register_client); EXPORT_SYMBOL(vga_switcheroo_register_client);
...@@ -185,6 +186,7 @@ static struct vga_switcheroo_client * ...@@ -185,6 +186,7 @@ static struct vga_switcheroo_client *
find_client_from_pci(struct list_head *head, struct pci_dev *pdev) find_client_from_pci(struct list_head *head, struct pci_dev *pdev)
{ {
struct vga_switcheroo_client *client; struct vga_switcheroo_client *client;
list_for_each_entry(client, head, list) list_for_each_entry(client, head, list)
if (client->pdev == pdev) if (client->pdev == pdev)
return client; return client;
...@@ -195,6 +197,7 @@ static struct vga_switcheroo_client * ...@@ -195,6 +197,7 @@ static struct vga_switcheroo_client *
find_client_from_id(struct list_head *head, int client_id) find_client_from_id(struct list_head *head, int client_id)
{ {
struct vga_switcheroo_client *client; struct vga_switcheroo_client *client;
list_for_each_entry(client, head, list) list_for_each_entry(client, head, list)
if (client->id == client_id) if (client->id == client_id)
return client; return client;
...@@ -205,6 +208,7 @@ static struct vga_switcheroo_client * ...@@ -205,6 +208,7 @@ static struct vga_switcheroo_client *
find_active_client(struct list_head *head) find_active_client(struct list_head *head)
{ {
struct vga_switcheroo_client *client; struct vga_switcheroo_client *client;
list_for_each_entry(client, head, list) list_for_each_entry(client, head, list)
if (client->active && client_is_vga(client)) if (client->active && client_is_vga(client))
return client; return client;
...@@ -262,10 +266,12 @@ static int vga_switcheroo_show(struct seq_file *m, void *v) ...@@ -262,10 +266,12 @@ static int vga_switcheroo_show(struct seq_file *m, void *v)
{ {
struct vga_switcheroo_client *client; struct vga_switcheroo_client *client;
int i = 0; int i = 0;
mutex_lock(&vgasr_mutex); mutex_lock(&vgasr_mutex);
list_for_each_entry(client, &vgasr_priv.clients, list) { list_for_each_entry(client, &vgasr_priv.clients, list) {
seq_printf(m, "%d:%s%s:%c:%s%s:%s\n", i, seq_printf(m, "%d:%s%s:%c:%s%s:%s\n", i,
client_id(client) == VGA_SWITCHEROO_DIS ? "DIS" : "IGD", client_id(client) == VGA_SWITCHEROO_DIS ? "DIS" :
"IGD",
client_is_vga(client) ? "" : "-Audio", client_is_vga(client) ? "" : "-Audio",
client->active ? '+' : ' ', client->active ? '+' : ' ',
client->driver_power_control ? "Dyn" : "", client->driver_power_control ? "Dyn" : "",
...@@ -349,6 +355,7 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client) ...@@ -349,6 +355,7 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client)
if (new_client->fb_info) { if (new_client->fb_info) {
struct fb_event event; struct fb_event event;
console_lock(); console_lock();
event.info = new_client->fb_info; event.info = new_client->fb_info;
fb_notifier_call_chain(FB_EVENT_REMAP_ALL_CONSOLE, &event); fb_notifier_call_chain(FB_EVENT_REMAP_ALL_CONSOLE, &event);
...@@ -543,7 +550,8 @@ static int vga_switcheroo_debugfs_init(struct vgasr_priv *priv) ...@@ -543,7 +550,8 @@ static int vga_switcheroo_debugfs_init(struct vgasr_priv *priv)
} }
priv->switch_file = debugfs_create_file("switch", 0644, priv->switch_file = debugfs_create_file("switch", 0644,
priv->debugfs_root, NULL, &vga_switcheroo_debugfs_fops); priv->debugfs_root, NULL,
&vga_switcheroo_debugfs_fops);
if (!priv->switch_file) { if (!priv->switch_file) {
pr_err("cannot create %s/vgaswitcheroo/switch\n", mp); pr_err("cannot create %s/vgaswitcheroo/switch\n", mp);
goto fail; goto fail;
...@@ -584,7 +592,8 @@ int vga_switcheroo_process_delayed_switch(void) ...@@ -584,7 +592,8 @@ int vga_switcheroo_process_delayed_switch(void)
} }
EXPORT_SYMBOL(vga_switcheroo_process_delayed_switch); EXPORT_SYMBOL(vga_switcheroo_process_delayed_switch);
static void vga_switcheroo_power_switch(struct pci_dev *pdev, enum vga_switcheroo_state state) static void vga_switcheroo_power_switch(struct pci_dev *pdev,
enum vga_switcheroo_state state)
{ {
struct vga_switcheroo_client *client; struct vga_switcheroo_client *client;
...@@ -603,7 +612,8 @@ static void vga_switcheroo_power_switch(struct pci_dev *pdev, enum vga_switchero ...@@ -603,7 +612,8 @@ static void vga_switcheroo_power_switch(struct pci_dev *pdev, enum vga_switchero
/* force a PCI device to a certain state - mainly to turn off audio clients */ /* force a PCI device to a certain state - mainly to turn off audio clients */
void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev, enum vga_switcheroo_state dynamic) void vga_switcheroo_set_dynamic_switch(struct pci_dev *pdev,
enum vga_switcheroo_state dynamic)
{ {
struct vga_switcheroo_client *client; struct vga_switcheroo_client *client;
...@@ -649,7 +659,8 @@ static int vga_switcheroo_runtime_resume(struct device *dev) ...@@ -649,7 +659,8 @@ static int vga_switcheroo_runtime_resume(struct device *dev)
/* this version is for the case where the power switch is separate /* this version is for the case where the power switch is separate
to the device being powered down. */ to the device being powered down. */
int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain) int vga_switcheroo_init_domain_pm_ops(struct device *dev,
struct dev_pm_domain *domain)
{ {
/* copy over all the bus versions */ /* copy over all the bus versions */
if (dev->bus && dev->bus->pm) { if (dev->bus && dev->bus->pm) {
...@@ -680,7 +691,8 @@ static int vga_switcheroo_runtime_resume_hdmi_audio(struct device *dev) ...@@ -680,7 +691,8 @@ static int vga_switcheroo_runtime_resume_hdmi_audio(struct device *dev)
/* we need to check if we have to switch back on the video /* we need to check if we have to switch back on the video
device so the audio device can come back */ device so the audio device can come back */
list_for_each_entry(client, &vgasr_priv.clients, list) { list_for_each_entry(client, &vgasr_priv.clients, list) {
if (PCI_SLOT(client->pdev->devfn) == PCI_SLOT(pdev->devfn) && client_is_vga(client)) { if (PCI_SLOT(client->pdev->devfn) == PCI_SLOT(pdev->devfn) &&
client_is_vga(client)) {
found = client; found = client;
ret = pm_runtime_get_sync(&client->pdev->dev); ret = pm_runtime_get_sync(&client->pdev->dev);
if (ret) { if (ret) {
...@@ -700,12 +712,15 @@ static int vga_switcheroo_runtime_resume_hdmi_audio(struct device *dev) ...@@ -700,12 +712,15 @@ static int vga_switcheroo_runtime_resume_hdmi_audio(struct device *dev)
return ret; return ret;
} }
int vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev, struct dev_pm_domain *domain) int
vga_switcheroo_init_domain_pm_optimus_hdmi_audio(struct device *dev,
struct dev_pm_domain *domain)
{ {
/* copy over all the bus versions */ /* copy over all the bus versions */
if (dev->bus && dev->bus->pm) { if (dev->bus && dev->bus->pm) {
domain->ops = *dev->bus->pm; domain->ops = *dev->bus->pm;
domain->ops.runtime_resume = vga_switcheroo_runtime_resume_hdmi_audio; domain->ops.runtime_resume =
vga_switcheroo_runtime_resume_hdmi_audio;
dev->pm_domain = domain; dev->pm_domain = domain;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment