Commit e5860312 authored by Bryan Wu's avatar Bryan Wu

leds: convert DAC124S085 LED driver to devm_kzalloc()

Cc: Guennadi Liakhovetski <lg@denx.de>
Signed-off-by: default avatarBryan Wu <bryan.wu@canonical.com>
parent 0b873f3d
......@@ -69,7 +69,7 @@ static int dac124s085_probe(struct spi_device *spi)
struct dac124s085_led *led;
int i, ret;
dac = kzalloc(sizeof(*dac), GFP_KERNEL);
dac = devm_kzalloc(&spi->dev, sizeof(*dac), GFP_KERNEL);
if (!dac)
return -ENOMEM;
......@@ -102,7 +102,6 @@ static int dac124s085_probe(struct spi_device *spi)
led_classdev_unregister(&dac->leds[i].ldev);
spi_set_drvdata(spi, NULL);
kfree(dac);
return ret;
}
......@@ -117,7 +116,6 @@ static int dac124s085_remove(struct spi_device *spi)
}
spi_set_drvdata(spi, NULL);
kfree(dac);
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment