aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/tps65910.c
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2011-07-13 17:22:26 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2011-07-31 17:28:26 -0400
commitb1224cd113d4441edee4a58a1e2e428141247c0d (patch)
treee3edb8c7f024d5df4d90a1ecfbf171c10343d684 /drivers/mfd/tps65910.c
parent6daa663dc42957ca6c794a84fe07fa09f0273ff9 (diff)
mfd: Avoid two assignments if failures happen in tps65910_i2c_probe
In drivers/mfd/tps65910.c:tps65910_i2c_probe() there's potential for a tiny optimization. We assign to init_data->irq and init_data->irq_base long before we need them, and there are two potential exits from the function before they are needed. Moving the assignments below these two potential exits means we completely avoid doing them in these two (failure) cases. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Acked-by: Graeme Gregory <gg@slimlogic.co.uk> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/tps65910.c')
-rw-r--r--drivers/mfd/tps65910.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c
index 0226cdea2b47..6f5b8cf2f652 100644
--- a/drivers/mfd/tps65910.c
+++ b/drivers/mfd/tps65910.c
@@ -147,9 +147,6 @@ static int tps65910_i2c_probe(struct i2c_client *i2c,
147 if (init_data == NULL) 147 if (init_data == NULL)
148 return -ENOMEM; 148 return -ENOMEM;
149 149
150 init_data->irq = pmic_plat_data->irq;
151 init_data->irq_base = pmic_plat_data->irq;
152
153 tps65910 = kzalloc(sizeof(struct tps65910), GFP_KERNEL); 150 tps65910 = kzalloc(sizeof(struct tps65910), GFP_KERNEL);
154 if (tps65910 == NULL) { 151 if (tps65910 == NULL) {
155 kfree(init_data); 152 kfree(init_data);
@@ -170,6 +167,9 @@ static int tps65910_i2c_probe(struct i2c_client *i2c,
170 if (ret < 0) 167 if (ret < 0)
171 goto err; 168 goto err;
172 169
170 init_data->irq = pmic_plat_data->irq;
171 init_data->irq_base = pmic_plat_data->irq;
172
173 tps65910_gpio_init(tps65910, pmic_plat_data->gpio_base); 173 tps65910_gpio_init(tps65910, pmic_plat_data->gpio_base);
174 174
175 ret = tps65910_irq_init(tps65910, init_data->irq, init_data); 175 ret = tps65910_irq_init(tps65910, init_data->irq, init_data);