All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Vaibhav Gupta <vaibhavgupta40@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Bjorn Helgaas <bjorn@helgaas.com>,
	Vaibhav Gupta <vaibhav.varodek@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Kevin Curtis <kevin.curtis@farsite.co.uk>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kernel-mentees@lists.linuxfoundation.org,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH v1] farsync: use generic power management
Date: Tue, 28 Jul 2020 15:04:13 -0500	[thread overview]
Message-ID: <20200728200413.GA1857901@bjorn-Precision-5520> (raw)
In-Reply-To: <20200728042809.91436-1-vaibhavgupta40@gmail.com>

On Tue, Jul 28, 2020 at 09:58:10AM +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".

FWIW, this commit log is slightly misleading because .suspend and
.resume are NULL by default, so this patch actually is a complete
no-op as far as code generation is concerned.

This change is worthwhile because it simplifies the code a little, but
it doesn't convert the driver from legacy to generic power management.
This driver doesn't supply a .pm structure, so it doesn't seem to do
*any* power management.

> Change code indentation from space to tab in "struct pci_driver".
> 
> Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>
> ---
>  drivers/net/wan/farsync.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
> index 7916efce7188..15dacfde6b83 100644
> --- a/drivers/net/wan/farsync.c
> +++ b/drivers/net/wan/farsync.c
> @@ -2636,12 +2636,10 @@ fst_remove_one(struct pci_dev *pdev)
>  }
>  
>  static struct pci_driver fst_driver = {
> -        .name		= FST_NAME,
> -        .id_table	= fst_pci_dev_id,
> -        .probe		= fst_add_one,
> -        .remove	= fst_remove_one,
> -        .suspend	= NULL,
> -        .resume	= NULL,
> +	.name		= FST_NAME,
> +	.id_table	= fst_pci_dev_id,
> +	.probe		= fst_add_one,
> +	.remove		= fst_remove_one,
>  };
>  
>  static int __init
> -- 
> 2.27.0
> 

WARNING: multiple messages have this Message-ID (diff)
From: Bjorn Helgaas <helgaas@kernel.org>
To: Vaibhav Gupta <vaibhavgupta40@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	Kevin Curtis <kevin.curtis@farsite.co.uk>,
	netdev@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	linux-kernel-mentees@lists.linuxfoundation.org,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [Linux-kernel-mentees] [PATCH v1] farsync: use generic power management
Date: Tue, 28 Jul 2020 15:04:13 -0500	[thread overview]
Message-ID: <20200728200413.GA1857901@bjorn-Precision-5520> (raw)
In-Reply-To: <20200728042809.91436-1-vaibhavgupta40@gmail.com>

On Tue, Jul 28, 2020 at 09:58:10AM +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".

FWIW, this commit log is slightly misleading because .suspend and
.resume are NULL by default, so this patch actually is a complete
no-op as far as code generation is concerned.

This change is worthwhile because it simplifies the code a little, but
it doesn't convert the driver from legacy to generic power management.
This driver doesn't supply a .pm structure, so it doesn't seem to do
*any* power management.

> Change code indentation from space to tab in "struct pci_driver".
> 
> Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com>
> ---
>  drivers/net/wan/farsync.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
> index 7916efce7188..15dacfde6b83 100644
> --- a/drivers/net/wan/farsync.c
> +++ b/drivers/net/wan/farsync.c
> @@ -2636,12 +2636,10 @@ fst_remove_one(struct pci_dev *pdev)
>  }
>  
>  static struct pci_driver fst_driver = {
> -        .name		= FST_NAME,
> -        .id_table	= fst_pci_dev_id,
> -        .probe		= fst_add_one,
> -        .remove	= fst_remove_one,
> -        .suspend	= NULL,
> -        .resume	= NULL,
> +	.name		= FST_NAME,
> +	.id_table	= fst_pci_dev_id,
> +	.probe		= fst_add_one,
> +	.remove		= fst_remove_one,
>  };
>  
>  static int __init
> -- 
> 2.27.0
> 
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

  parent reply	other threads:[~2020-07-28 20:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-28  4:28 [PATCH v1] farsync: use generic power management Vaibhav Gupta
2020-07-28  4:28 ` [Linux-kernel-mentees] " Vaibhav Gupta
2020-07-28 12:36 ` Vaibhav Gupta
2020-07-28 12:36   ` [Linux-kernel-mentees] " Vaibhav Gupta
2020-07-28 19:57 ` David Miller
2020-07-28 19:57   ` [Linux-kernel-mentees] " David Miller
2020-07-28 20:04 ` Bjorn Helgaas [this message]
2020-07-28 20:04   ` Bjorn Helgaas
2020-07-29 10:17   ` Vaibhav Gupta
2020-07-29 10:17     ` [Linux-kernel-mentees] " Vaibhav Gupta
2020-07-29 12:29     ` Bjorn Helgaas
2020-07-29 12:29       ` [Linux-kernel-mentees] " Bjorn Helgaas
2020-07-29 13:21       ` Vaibhav Gupta
2020-07-29 13:21         ` [Linux-kernel-mentees] " Vaibhav Gupta

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200728200413.GA1857901@bjorn-Precision-5520 \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=bjorn@helgaas.com \
    --cc=davem@davemloft.net \
    --cc=kevin.curtis@farsite.co.uk \
    --cc=kuba@kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=vaibhav.varodek@gmail.com \
    --cc=vaibhavgupta40@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.