LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
To: Sourabh Jain <sourabhjain@linux.ibm.com>,
	linuxppc-dev@lists.ozlabs.org, maddy@linux.ibm.com,
	mpe@ellerman.id.au
Cc: npiggin@gmail.com, chleroy@kernel.org, shivangu@linux.ibm.com,
	hbathini@linux.ibm.com, mahesh@linux.ibm.com,
	adityag@linux.ibm.com, venkat88@linux.ibm.com,
	stable@vger.kernel.org, Sourabh Jain <sourabhjain@linux.ibm.com>
Subject: Re: [PATCH v2 2/3] powerpc/pseries: Handle and log pseries-wdt registration failures
Date: Mon, 13 Jul 2026 09:59:58 +0530	[thread overview]
Message-ID: <qzl7v7eh.ritesh.list@gmail.com> (raw)
In-Reply-To: <20260713035954.1559605-3-sourabhjain@linux.ibm.com>

Sourabh Jain <sourabhjain@linux.ibm.com> writes:

> The pseries watchdog initialization registers the pseries-wdt platform
> device using platform_device_register_simple(), but currently ignores
> its return value.
>
> Check the returned pointer for errors, log a descriptive error message
> when registration fails, and propagate the failure code to the caller.
> This avoids silently ignoring platform device registration failures.
>

Fair enough.

> Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
> ---
>  arch/powerpc/platforms/pseries/setup.c | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
> index 1223dc961242..bbb2813f8ede 100644
> --- a/arch/powerpc/platforms/pseries/setup.c
> +++ b/arch/powerpc/platforms/pseries/setup.c
> @@ -191,8 +191,18 @@ static void __init fwnmi_init(void)
>   */
>  static __init int pseries_wdt_init(void)
>  {
> -	if (firmware_has_feature(FW_FEATURE_WATCHDOG))
> -		platform_device_register_simple("pseries-wdt", 0, NULL, 0);
> +	struct platform_device *pseries_wdt_dev;

minor nit: we should rename this to pdev, since it is already under
pseries_wdt_init(). That is generally how all platform drivers use it
unless it requires more than one platform device.

But either ways the patch looks good to me:

Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>

> +
> +	if (!firmware_has_feature(FW_FEATURE_WATCHDOG))
> +		return 0;
> +
> +	pseries_wdt_dev = platform_device_register_simple("pseries-wdt", 0, NULL, 0);
> +
> +	if (IS_ERR(pseries_wdt_dev)) {
> +		pr_err("Failed to register pseries-wdt platform device\n");
> +		return PTR_ERR(pseries_wdt_dev);
> +	}
> +
>  	return 0;
>  }
>  machine_subsys_initcall(pseries, pseries_wdt_init);
> -- 
> 2.52.0


  reply	other threads:[~2026-07-13  4:35 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-13  3:59 [PATCH v2 0/3] powerpc/crash: protect kdump from active watchdogs Sourabh Jain
2026-07-13  3:59 ` [PATCH v2 1/3] powerpc/pseries: Move H_WATCHDOG definitions to a common header Sourabh Jain
2026-07-13  4:18   ` Ritesh Harjani
2026-07-13  4:29     ` Sourabh Jain
2026-07-13  3:59 ` [PATCH v2 2/3] powerpc/pseries: Handle and log pseries-wdt registration failures Sourabh Jain
2026-07-13  4:29   ` Ritesh Harjani [this message]
2026-07-13  4:44     ` Sourabh Jain
2026-07-13  3:59 ` [PATCH v2 3/3] powerpc/crash: stop watchdogs before booting kdump kernel Sourabh Jain
2026-07-13  5:10   ` Ritesh Harjani
2026-07-13 13:37     ` Sourabh Jain
2026-07-13  5:21 ` [PATCH v2 0/3] powerpc/crash: protect kdump from active watchdogs Ritesh Harjani
2026-07-13  5:59   ` Sourabh Jain
2026-07-13  6:40     ` Ritesh Harjani
2026-07-13 11:30       ` Sourabh Jain
2026-07-13 11:39         ` Ritesh Harjani

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=qzl7v7eh.ritesh.list@gmail.com \
    --to=ritesh.list@gmail.com \
    --cc=adityag@linux.ibm.com \
    --cc=chleroy@kernel.org \
    --cc=hbathini@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mahesh@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=shivangu@linux.ibm.com \
    --cc=sourabhjain@linux.ibm.com \
    --cc=stable@vger.kernel.org \
    --cc=venkat88@linux.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox