lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240611061753.chm6egv24yxwdj3v@dhruva>
Date: Tue, 11 Jun 2024 11:47:53 +0530
From: Dhruva Gole <d-gole@...com>
To: Andrew Davis <afd@...com>
CC: Sebastian Reichel <sre@...nel.org>,
        Florian Fainelli
	<florian.fainelli@...adcom.com>,
        Broadcom internal kernel review list
	<bcm-kernel-feedback-list@...adcom.com>,
        <linux-pm@...r.kernel.org>, <linux-arm-kernel@...ts.infradead.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 4/5] power: reset: brcmstb: Use
 devm_register_sys_off_handler()

On Jun 10, 2024 at 09:28:35 -0500, Andrew Davis wrote:
> Function register_restart_handler() is deprecated. Using this new API
> removes our need to keep and manage a struct notifier_block.
> 
> Signed-off-by: Andrew Davis <afd@...com>
> ---
>  drivers/power/reset/brcmstb-reboot.c | 11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/power/reset/brcmstb-reboot.c b/drivers/power/reset/brcmstb-reboot.c
> index 94ea317f61ef4..59ed1513cfb30 100644
> --- a/drivers/power/reset/brcmstb-reboot.c
> +++ b/drivers/power/reset/brcmstb-reboot.c
> @@ -29,8 +29,7 @@ struct reset_reg_mask {
>  
>  static const struct reset_reg_mask *reset_masks;
>  
> -static int brcmstb_restart_handler(struct notifier_block *this,
> -				   unsigned long mode, void *cmd)
> +static int brcmstb_restart_handler(struct sys_off_data *data)
>  {
>  	int rc;
>  	u32 tmp;
> @@ -65,11 +64,6 @@ static int brcmstb_restart_handler(struct notifier_block *this,
>  	return NOTIFY_DONE;
>  }
>  
> -static struct notifier_block brcmstb_restart_nb = {
> -	.notifier_call = brcmstb_restart_handler,
> -	.priority = 128,
> -};
> -
>  static const struct reset_reg_mask reset_bits_40nm = {
>  	.rst_src_en_mask = BIT(0),
>  	.sw_mstr_rst_mask = BIT(0),
> @@ -100,7 +94,8 @@ static int brcmstb_reboot_probe(struct platform_device *pdev)
>  	rst_src_en = args[0];
>  	sw_mstr_rst = args[1];
>  
> -	rc = register_restart_handler(&brcmstb_restart_nb);
> +	rc = devm_register_sys_off_handler(&pdev->dev, SYS_OFF_MODE_RESTART,
> +					   128, brcmstb_restart_handler, NULL);

Reviewed-by: Dhruva Gole <d-gole@...com>


-- 
Best regards,
Dhruva

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ