diff options
Diffstat (limited to 'drivers/video/backlight/tosa_lcd.c')
-rw-r--r-- | drivers/video/backlight/tosa_lcd.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/video/backlight/tosa_lcd.c b/drivers/video/backlight/tosa_lcd.c index 2231aec23918..47823b8efff0 100644 --- a/drivers/video/backlight/tosa_lcd.c +++ b/drivers/video/backlight/tosa_lcd.c | |||
@@ -174,7 +174,8 @@ static int __devinit tosa_lcd_probe(struct spi_device *spi) | |||
174 | int ret; | 174 | int ret; |
175 | struct tosa_lcd_data *data; | 175 | struct tosa_lcd_data *data; |
176 | 176 | ||
177 | data = kzalloc(sizeof(struct tosa_lcd_data), GFP_KERNEL); | 177 | data = devm_kzalloc(&spi->dev, sizeof(struct tosa_lcd_data), |
178 | GFP_KERNEL); | ||
178 | if (!data) | 179 | if (!data) |
179 | return -ENOMEM; | 180 | return -ENOMEM; |
180 | 181 | ||
@@ -187,7 +188,7 @@ static int __devinit tosa_lcd_probe(struct spi_device *spi) | |||
187 | 188 | ||
188 | ret = spi_setup(spi); | 189 | ret = spi_setup(spi); |
189 | if (ret < 0) | 190 | if (ret < 0) |
190 | goto err_spi; | 191 | return ret; |
191 | 192 | ||
192 | data->spi = spi; | 193 | data->spi = spi; |
193 | dev_set_drvdata(&spi->dev, data); | 194 | dev_set_drvdata(&spi->dev, data); |
@@ -224,8 +225,6 @@ err_gpio_dir: | |||
224 | gpio_free(TOSA_GPIO_TG_ON); | 225 | gpio_free(TOSA_GPIO_TG_ON); |
225 | err_gpio_tg: | 226 | err_gpio_tg: |
226 | dev_set_drvdata(&spi->dev, NULL); | 227 | dev_set_drvdata(&spi->dev, NULL); |
227 | err_spi: | ||
228 | kfree(data); | ||
229 | return ret; | 228 | return ret; |
230 | } | 229 | } |
231 | 230 | ||
@@ -242,7 +241,6 @@ static int __devexit tosa_lcd_remove(struct spi_device *spi) | |||
242 | 241 | ||
243 | gpio_free(TOSA_GPIO_TG_ON); | 242 | gpio_free(TOSA_GPIO_TG_ON); |
244 | dev_set_drvdata(&spi->dev, NULL); | 243 | dev_set_drvdata(&spi->dev, NULL); |
245 | kfree(data); | ||
246 | 244 | ||
247 | return 0; | 245 | return 0; |
248 | } | 246 | } |