From 78e05b1b98d8389846332ab559dacdf02bbac17c Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Sun, 13 Sep 2009 21:15:18 +0200 Subject: [PATCH] --- yaml --- r: 162815 b: refs/heads/master c: 70ebadc8e30efef3bf21ba94b3571537de8bcf4e h: refs/heads/master i: 162813: e3d018a1cfebc8fc9434dc0dac4c866b6cf2f9c0 162811: d79c399c81840298fd6f68bb6a58db0dd21c1d3b 162807: 3bdba1c0a6762ab920a088b6259991a4acdf4723 162799: 688cb07fc972eb4bf77219d9e1248b4dc13321cf 162783: 1620c42b71ee3f4110fa7c7cbc794bc70319b6a8 162751: 52102e1cc9ad68ced492c62b05c7966dabf2f1b0 162687: 1958357d2fa9c0dd6e572f48fdd33869a5e95f33 162559: 8fce62315e92a5531c91b089051f53362061e64e 162303: dca10f0a446429aeaa5184ceff4af7a37c207b6e 161791: 4f3f50339e45ac96c4942e63e12be86f1efa5bf5 v: v3 --- [refs] | 2 +- trunk/arch/mips/txx9/generic/setup.c | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index d3338e96d938..90d3fd217a9a 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 13680ade4e57090a8ccad332e84e1f3d48b67125 +refs/heads/master: 70ebadc8e30efef3bf21ba94b3571537de8bcf4e diff --git a/trunk/arch/mips/txx9/generic/setup.c b/trunk/arch/mips/txx9/generic/setup.c index a205e2ba8e7b..c860810722c0 100644 --- a/trunk/arch/mips/txx9/generic/setup.c +++ b/trunk/arch/mips/txx9/generic/setup.c @@ -782,7 +782,7 @@ void __init txx9_iocled_init(unsigned long baseaddr, return; iocled->mmioaddr = ioremap(baseaddr, 1); if (!iocled->mmioaddr) - return; + goto out_free; iocled->chip.get = txx9_iocled_get; iocled->chip.set = txx9_iocled_set; iocled->chip.direction_input = txx9_iocled_dir_in; @@ -791,13 +791,13 @@ void __init txx9_iocled_init(unsigned long baseaddr, iocled->chip.base = basenum; iocled->chip.ngpio = num; if (gpiochip_add(&iocled->chip)) - return; + goto out_unmap; if (basenum < 0) basenum = iocled->chip.base; pdev = platform_device_alloc("leds-gpio", basenum); if (!pdev) - return; + goto out_gpio; iocled->pdata.num_leds = num; iocled->pdata.leds = iocled->leds; for (i = 0; i < num; i++) { @@ -812,7 +812,16 @@ void __init txx9_iocled_init(unsigned long baseaddr, } pdev->dev.platform_data = &iocled->pdata; if (platform_device_add(pdev)) - platform_device_put(pdev); + goto out_pdev; + return; +out_pdev: + platform_device_put(pdev); +out_gpio: + gpio_remove(&iocled->chip); +out_unmap: + iounmap(iocled->mmioaddr); +out_free: + kfree(iocled); } #else /* CONFIG_LEDS_GPIO */ void __init txx9_iocled_init(unsigned long baseaddr,