summaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-pca9633.c
diff options
context:
space:
mode:
authorBryan Wu <bryan.wu@canonical.com>2012-07-04 05:40:10 +0200
committerBryan Wu <bryan.wu@canonical.com>2012-07-24 01:52:38 +0200
commit983ce8840c9cbafefd568f6973e531d77119a977 (patch)
tree77d011577c071fba3e455fa7212fa18b5ac9d09a /drivers/leds/leds-pca9633.c
parentleds: convert BD2802 RGB LED driver to devm_kzalloc() and cleanup error exit ... (diff)
downloadlinux-983ce8840c9cbafefd568f6973e531d77119a977.tar.xz
linux-983ce8840c9cbafefd568f6973e531d77119a977.zip
leds: convert PCA9633 LED driver to devm_kzalloc()
Cc: Peter Meerwald <p.meerwald@bct-electronic.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Diffstat (limited to 'drivers/leds/leds-pca9633.c')
-rw-r--r--drivers/leds/leds-pca9633.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/leds/leds-pca9633.c b/drivers/leds/leds-pca9633.c
index d8926fd031aa..edcd706c5631 100644
--- a/drivers/leds/leds-pca9633.c
+++ b/drivers/leds/leds-pca9633.c
@@ -108,7 +108,7 @@ static int __devinit pca9633_probe(struct i2c_client *client,
}
}
- pca9633 = kcalloc(4, sizeof(*pca9633), GFP_KERNEL);
+ pca9633 = devm_kzalloc(&client->dev, 4 * sizeof(*pca9633), GFP_KERNEL);
if (!pca9633)
return -ENOMEM;
@@ -156,8 +156,6 @@ exit:
cancel_work_sync(&pca9633[i].work);
}
- kfree(pca9633);
-
return err;
}
@@ -171,8 +169,6 @@ static int __devexit pca9633_remove(struct i2c_client *client)
cancel_work_sync(&pca9633[i].work);
}
- kfree(pca9633);
-
return 0;
}