Skip to contentSkip to conversation

vga_switcheroo: simplify the return expression of vga_switcheroo_runtime_resume

PATCH Applied Qinglang Miao 2 participants 2 messages Sep 21, 2020 – Sep 22, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 vga_switcheroo: simplify the return expression of vga_switcheroo_runtime_resume

Simplify the return expression.

---
 drivers/gpu/vga/vga_switcheroo.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/vga/vga_switcheroo.c +1 -6
index 087304b1a..1401fd52f 100644
@@ -1034,17 +1034,12 @@ static int vga_switcheroo_runtime_suspend(struct device *dev)
 static int vga_switcheroo_runtime_resume(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
-	int ret;
 
 	mutex_lock(&vgasr_mutex);
 	vga_switcheroo_power_switch(pdev, VGA_SWITCHEROO_ON);
 	mutex_unlock(&vgasr_mutex);
 	pci_wakeup_bus(pdev->bus);
-	ret = dev->bus->pm->runtime_resume(dev);
-	if (ret)
-		return ret;
-
-	return 0;
+	return dev->bus->pm->runtime_resume(dev);
 }
 
 /**
Signature · 1 line
2.23.0
#1 lore raw
Quoted 3 lines · Qinglang Miao

Simplify the return expression.

Pushed to drm-misc-next, thanks for your patch.
-Daniel

Quoted 30 lines
---
 drivers/gpu/vga/vga_switcheroo.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/vga/vga_switcheroo.c +1 -6
index 087304b1a..1401fd52f 100644
@@ -1034,17 +1034,12 @@ static int vga_switcheroo_runtime_suspend(struct device *dev)
 static int vga_switcheroo_runtime_resume(struct device *dev)
 {
 	struct pci_dev *pdev = to_pci_dev(dev);
-	int ret;
 
 	mutex_lock(&vgasr_mutex);
 	vga_switcheroo_power_switch(pdev, VGA_SWITCHEROO_ON);
 	mutex_unlock(&vgasr_mutex);
 	pci_wakeup_bus(pdev->bus);
-	ret = dev->bus->pm->runtime_resume(dev);
-	if (ret)
-		return ret;
-
-	return 0;
+	return dev->bus->pm->runtime_resume(dev);
 }
 
 /**
Signature · 1 line
2.23.0
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch