Skip to contentSkip to conversation

netup_unidvb: use generic power management

PATCH In review Vaibhav Gupta 2 participants 5 messages Jul 28, 2020 – Aug 30, 2020

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

PATCH 1/1 netup_unidvb: use generic power management

The .suspend() and .resume() callbacks are not defined for this driver. Still, their power management structure follows the legacy framework. To bring it under the generic framework, simply remove the binding of callbacks from "struct pci_driver".

---
 drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 2 --
 1 file changed, 2 deletions(-)
drivers/media/pci/netup_unidvb/netup_unidvb_core.c +0 -2
index 80a7c41baa90..6f3125c2d097 100644
@@ -1016,8 +1016,6 @@ static struct pci_driver netup_unidvb_pci_driver = {
 	.id_table = netup_unidvb_pci_tbl,
 	.probe    = netup_unidvb_initdev,
 	.remove   = netup_unidvb_finidev,
-	.suspend  = NULL,
-	.resume   = NULL,
 };
 
 module_pci_driver(netup_unidvb_pci_driver);
Signature · 6 lines
2.27.0

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
#1 lore raw

This patch is compile-tested only.

Thanks
Vaibhav Gupta

#2 lore raw
In reply to Vaibhav Gupta
Quoted 4 lines · Vaibhav Gupta

The .suspend() and .resume() callbacks are not defined for this driver. Still, their power management structure follows the legacy framework. To bring it under the generic framework, simply remove the binding of callbacks from "struct pci_driver".

Unlisted fields in a static struct initializer will get set to 0 (or NULL for pointers) already. Removing the NULL initializers will not change anything.

Possibly you want to remove the redundant initializers but your commit message should say so.

Sean

Quoted 21 lines
---
 drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 2 --
 1 file changed, 2 deletions(-)
drivers/media/pci/netup_unidvb/netup_unidvb_core.c +0 -2
index 80a7c41baa90..6f3125c2d097 100644
@@ -1016,8 +1016,6 @@ static struct pci_driver netup_unidvb_pci_driver = {
 	.id_table = netup_unidvb_pci_tbl,
 	.probe    = netup_unidvb_initdev,
 	.remove   = netup_unidvb_finidev,
-	.suspend  = NULL,
-	.resume   = NULL,
 };
 
 module_pci_driver(netup_unidvb_pci_driver);
Signature · 1 line
2.27.0
#3 lore raw
Quoted 10 lines · Sean Young
Quoted 4 lines · Vaibhav Gupta

The .suspend() and .resume() callbacks are not defined for this driver. Still, their power management structure follows the legacy framework. To bring it under the generic framework, simply remove the binding of callbacks from "struct pci_driver".

Unlisted fields in a static struct initializer will get set to 0 (or NULL for pointers) already. Removing the NULL initializers will not change anything.

Quoted 6 lines

Possibly you want to remove the redundant initializers but your commit message should say so.

Sean

Hello Sean,

Yes, you are right. I mentioned a general commit message. I will send a v2 with suggested changes.

Thank you
Vaibhav Gupta

#4 lore raw

PATCH v2 1/1 netup_unidvb: drop initialization of PM pointers

In reply to Sean Young

The .suspend() and .resume() callbacks are not defined for this driver. Thus, just the unlisting of PM pointers in the struct initializer will make no change in its behavior. Still unlisting is necessary so as to get rid of .suspend and .resume pointers as they are part of the legacy framework and should not be used in the driver code explicitly.

---
 drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 2 --
 1 file changed, 2 deletions(-)
drivers/media/pci/netup_unidvb/netup_unidvb_core.c +0 -2
index 80a7c41baa90..6f3125c2d097 100644
@@ -1016,8 +1016,6 @@ static struct pci_driver netup_unidvb_pci_driver = {
 	.id_table = netup_unidvb_pci_tbl,
 	.probe    = netup_unidvb_initdev,
 	.remove   = netup_unidvb_finidev,
-	.suspend  = NULL,
-	.resume   = NULL,
 };
 
 module_pci_driver(netup_unidvb_pci_driver);
Signature · 6 lines
2.28.0

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees