Linux-MIPS Archive mirror
 help / color / mirror / Atom feed
From: "Maciej W. Rozycki" <macro@orcam.me.uk>
To: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	 Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	 Jiri Slaby <jirislaby@kernel.org>
Cc: linux-mips@vger.kernel.org, linux-serial@vger.kernel.org,
	 linux-serial@vger.kernel.org
Subject: [PATCH v3 10/10] MIPS: DEC: Ensure RTC platform device deregistration upon failure
Date: Wed, 6 May 2026 23:43:00 +0100 (BST)	[thread overview]
Message-ID: <alpine.DEB.2.21.2605062333190.46195@angie.orcam.me.uk> (raw)
In-Reply-To: <alpine.DEB.2.21.2605062240290.46195@angie.orcam.me.uk>

Switch RTC platform device registration from platform_device_register() 
to platform_add_devices() so as to make sure any failure will result in 
automatic device unregistration.

Fixes: fae67ad43114 ("arch/mips/dec: switch DECstation systems to rtc-cmos")
Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
---
Change from v2,
<https://lore.kernel.org/r/alpine.DEB.2.21.2605012105320.11074@angie.orcam.me.uk/>:

- Fix a minor style issue in the commit description.

No change from v1 (8/8),
<https://lore.kernel.org/r/alpine.DEB.2.21.2604110042130.29980@angie.orcam.me.uk/>.
---
 arch/mips/dec/platform.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

linux-mips-dec-platform-rtc-unregister.diff
Index: linux-macro/arch/mips/dec/platform.c
===================================================================
--- linux-macro.orig/arch/mips/dec/platform.c
+++ linux-macro/arch/mips/dec/platform.c
@@ -38,6 +38,10 @@ static struct platform_device dec_rtc_de
 	.num_resources = ARRAY_SIZE(dec_rtc_resources),
 };
 
+static struct platform_device *dec_rtc_devices[] __initdata = {
+	&dec_rtc_device,
+};
+
 static struct resource dec_dz_resources[] = {
 	{ .name = "dz", .flags = IORESOURCE_MEM, },
 	{ .name = "dz", .flags = IORESOURCE_IRQ, },
@@ -137,7 +141,7 @@ static int __init dec_add_devices(void)
 	}
 	num_zs = i;
 
-	ret1 = platform_device_register(&dec_rtc_device);
+	ret1 = platform_add_devices(dec_rtc_devices, 1);
 	ret2 = IS_ENABLED(CONFIG_32BIT) ?
 	       platform_add_devices(dec_dz_devices, num_dz) : 0;
 	ret3 = platform_add_devices(dec_zs_devices, num_zs);

  parent reply	other threads:[~2026-05-06 22:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-06 22:42 [PATCH v3 00/10] MIPS: DEC: Fix serial device regressions + RTC cleanup Maciej W. Rozycki
2026-05-06 22:42 ` [PATCH v3 01/10] MIPS: DEC: Ensure 32-bit stack location for o32 prom_printf() Maciej W. Rozycki
2026-05-26 14:45   ` Thomas Bogendoerfer
2026-05-06 22:42 ` [PATCH v3 02/10] MIPS: DEC: Prevent initial console buffer from landing in XKPHYS Maciej W. Rozycki
2026-05-26 14:46   ` Thomas Bogendoerfer
2026-05-06 22:42 ` [PATCH v3 03/10] serial: dz: Fix bootconsole message clobbering at chip reset Maciej W. Rozycki
2026-05-06 22:42 ` [PATCH v3 04/10] serial: dz: Fix bootconsole handover lockup Maciej W. Rozycki
2026-05-06 22:42 ` [PATCH v3 05/10] serial: zs: " Maciej W. Rozycki
2026-05-06 22:42 ` [PATCH v3 06/10] serial: zs: Switch to using channel reset Maciej W. Rozycki
2026-05-06 22:42 ` [PATCH v3 07/10] serial: dz: Convert to use a platform device Maciej W. Rozycki
2026-05-06 22:42 ` [PATCH v3 08/10] serial: zs: " Maciej W. Rozycki
2026-05-06 22:42 ` [PATCH v3 09/10] serial: dz: Enable modular build Maciej W. Rozycki
2026-05-06 22:43 ` Maciej W. Rozycki [this message]
2026-05-26 14:49   ` [PATCH v3 10/10] MIPS: DEC: Ensure RTC platform device deregistration upon failure Thomas Bogendoerfer
2026-05-22 15:15 ` [PATCH v3 00/10] MIPS: DEC: Fix serial device regressions + RTC cleanup Maciej W. Rozycki
2026-05-26 14:48   ` Thomas Bogendoerfer
2026-05-26 15:08     ` Maciej W. Rozycki

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=alpine.DEB.2.21.2605062333190.46195@angie.orcam.me.uk \
    --to=macro@orcam.me.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=tsbogend@alpha.franken.de \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).