]> git.ipfire.org Git - thirdparty/linux.git/commit
mtd: slram: simplify register_device() cleanup
authorRuoyu Wang <ruoyuw560@gmail.com>
Tue, 9 Jun 2026 08:45:28 +0000 (16:45 +0800)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 11 Jun 2026 07:20:39 +0000 (09:20 +0200)
commit4fe97a54daddb221009964161fb362b2b930d657
tree2ad303fcfb31e857d573aaef97d731068cc2f8dd
parent36f1648644d769c496a8e47e53603e863e358d73
mtd: slram: simplify register_device() cleanup

Use local variables for the list entry, mtd_info, and private data while
initializing a new device. This keeps the initialization path easier to
read and publishes the new list entry only after mtd_device_register()
has succeeded.

Signed-off-by: Ruoyu Wang <ruoyuw560@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
drivers/mtd/devices/slram.c