2020-07-28 09:30:20

by Vaibhav Gupta

[permalink] [raw]
Subject: [PATCH v1] [media] 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".

Signed-off-by: Vaibhav Gupta <[email protected]>
---
drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
index 80a7c41baa90..6f3125c2d097 100644
--- a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
+++ b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
@@ -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);
--
2.27.0


2020-07-28 12:42:49

by Vaibhav Gupta

[permalink] [raw]
Subject: Re: [PATCH v1] [media] netup_unidvb: use generic power management

This patch is compile-tested only.

Thanks
Vaibhav Gupta

2020-08-30 08:12:55

by Sean Young

[permalink] [raw]
Subject: Re: [PATCH v1] [media] netup_unidvb: use generic power management

On Tue, Jul 28, 2020 at 02:57:17PM +0530, Vaibhav Gupta wrote:
> 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

>
> Signed-off-by: Vaibhav Gupta <[email protected]>
> ---
> drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
> index 80a7c41baa90..6f3125c2d097 100644
> --- a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
> +++ b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
> @@ -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);
> --
> 2.27.0

2020-08-30 08:46:47

by Vaibhav Gupta

[permalink] [raw]
Subject: Re: [PATCH v1] [media] netup_unidvb: use generic power management

On Sun, Aug 30, 2020 at 09:10:04AM +0100, Sean Young wrote:
> On Tue, Jul 28, 2020 at 02:57:17PM +0530, Vaibhav Gupta wrote:
> > 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
>
Hello Sean,

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

Thank you
Vaibhav Gupta

2020-08-30 09:49:44

by Vaibhav Gupta

[permalink] [raw]
Subject: [PATCH v2] netup_unidvb: drop initialization of PM pointers

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.

Signed-off-by: Vaibhav Gupta <[email protected]>
---
drivers/media/pci/netup_unidvb/netup_unidvb_core.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
index 80a7c41baa90..6f3125c2d097 100644
--- a/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
+++ b/drivers/media/pci/netup_unidvb/netup_unidvb_core.c
@@ -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);
--
2.28.0