mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Eric Piel <eric.piel@tremplin-utc.net>,
	Mark Gross <markgross@kernel.org>
Subject: Re: [PATCH v1 1/1] platform/x86: hp_accel: Use SIMPLE_DEV_PM_OPS() for PM ops
Date: Mon, 6 Dec 2021 22:43:45 +0100	[thread overview]
Message-ID: <8138caf0-8c4d-de5f-6643-5da3214d3563@redhat.com> (raw)
In-Reply-To: <20211206151521.22578-1-andriy.shevchenko@linux.intel.com>

Hi,

On 12/6/21 16:15, Andy Shevchenko wrote:
> After the commit 34570a898eef ("platform/x86: hp_accel: Remove
> _INI method call") there is no need to have separate methods for
> resume and restore, hence we may fold them together and use
> SIMPLE_DEV_PM_OPS() for PM ops.
> 
> While at it, switch to use __maybe_unused attribute.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Thank you for your patch, I've applied this patch to my review-hans 
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.

Regards,

Hans


> ---
>  drivers/platform/x86/hp_accel.c | 27 ++++-----------------------
>  1 file changed, 4 insertions(+), 23 deletions(-)
> 
> diff --git a/drivers/platform/x86/hp_accel.c b/drivers/platform/x86/hp_accel.c
> index 435a91fe2568..e9f852f7c27f 100644
> --- a/drivers/platform/x86/hp_accel.c
> +++ b/drivers/platform/x86/hp_accel.c
> @@ -355,39 +355,20 @@ static int lis3lv02d_remove(struct platform_device *device)
>  	return 0;
>  }
>  
> -#ifdef CONFIG_PM_SLEEP
> -static int lis3lv02d_suspend(struct device *dev)
> +static int __maybe_unused lis3lv02d_suspend(struct device *dev)
>  {
>  	/* make sure the device is off when we suspend */
>  	lis3lv02d_poweroff(&lis3_dev);
>  	return 0;
>  }
>  
> -static int lis3lv02d_resume(struct device *dev)
> +static int __maybe_unused lis3lv02d_resume(struct device *dev)
>  {
>  	lis3lv02d_poweron(&lis3_dev);
>  	return 0;
>  }
>  
> -static int lis3lv02d_restore(struct device *dev)
> -{
> -	lis3lv02d_poweron(&lis3_dev);
> -	return 0;
> -}
> -
> -static const struct dev_pm_ops hp_accel_pm = {
> -	.suspend = lis3lv02d_suspend,
> -	.resume = lis3lv02d_resume,
> -	.freeze = lis3lv02d_suspend,
> -	.thaw = lis3lv02d_resume,
> -	.poweroff = lis3lv02d_suspend,
> -	.restore = lis3lv02d_restore,
> -};
> -
> -#define HP_ACCEL_PM (&hp_accel_pm)
> -#else
> -#define HP_ACCEL_PM NULL
> -#endif
> +static SIMPLE_DEV_PM_OPS(hp_accel_pm, lis3lv02d_suspend, lis3lv02d_resume);
>  
>  /* For the HP MDPS aka 3D Driveguard */
>  static struct platform_driver lis3lv02d_driver = {
> @@ -395,7 +376,7 @@ static struct platform_driver lis3lv02d_driver = {
>  	.remove	= lis3lv02d_remove,
>  	.driver	= {
>  		.name	= "hp_accel",
> -		.pm	= HP_ACCEL_PM,
> +		.pm	= &hp_accel_pm,
>  		.acpi_match_table = lis3lv02d_device_ids,
>  	},
>  };
> 


      reply	other threads:[~2021-12-06 21:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-06 15:15 Andy Shevchenko
2021-12-06 21:43 ` Hans de Goede [this message]

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=8138caf0-8c4d-de5f-6643-5da3214d3563@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=eric.piel@tremplin-utc.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markgross@kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®