aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorLevente Kurusa <levex@linux.com>2013-12-19 10:03:27 -0500
committerRalf Baechle <ralf@linux-mips.org>2014-07-30 07:27:51 -0400
commit82242d28ff8bd2b3e0230190529c1ff333c766e1 (patch)
tree332b799835dcdd66aff9c6b5010fa3c842f09981 /arch
parentf0a7a2d042807d08e5bcfd3194e74b16810c4def (diff)
MIPS: IP22: Add missing put_device call
This is required so that we give up the last reference to the device. Also, create a gio_bus_release() that calls kfree on the device argument to properly kfree() the memory allocated for the device. [ralf@linux-mips.org: Reformat to Linux coding style and make gio_bus_release static.] Signed-off-by: Levente Kurusa <levex@linux.com> Cc: LKML <linux-kernel@vger.kernel.org> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/6261/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/mips/sgi-ip22/ip22-gio.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/arch/mips/sgi-ip22/ip22-gio.c b/arch/mips/sgi-ip22/ip22-gio.c
index 8e52446286ca..8f1b86d4da84 100644
--- a/arch/mips/sgi-ip22/ip22-gio.c
+++ b/arch/mips/sgi-ip22/ip22-gio.c
@@ -27,8 +27,14 @@ static struct {
27 { .name = "SGI GR2/GR3", .id = 0x7f }, 27 { .name = "SGI GR2/GR3", .id = 0x7f },
28}; 28};
29 29
30static void gio_bus_release(struct device *dev)
31{
32 kfree(dev);
33}
34
30static struct device gio_bus = { 35static struct device gio_bus = {
31 .init_name = "gio", 36 .init_name = "gio",
37 .release = &gio_bus_release,
32}; 38};
33 39
34/** 40/**
@@ -413,8 +419,10 @@ int __init ip22_gio_init(void)
413 int ret; 419 int ret;
414 420
415 ret = device_register(&gio_bus); 421 ret = device_register(&gio_bus);
416 if (ret) 422 if (ret) {
423 put_device(&gio_bus);
417 return ret; 424 return ret;
425 }
418 426
419 ret = bus_register(&gio_bus_type); 427 ret = bus_register(&gio_bus_type);
420 if (!ret) { 428 if (!ret) {