iio: ssp_sensors: don't manually free devm managed resources
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 5 Oct 2018 19:48:30 +0000 (21:48 +0200)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sun, 7 Oct 2018 19:04:30 +0000 (20:04 +0100)
commit388008bbd60ccf2787ebe053dd91ee92f275630f
treeb7aeaf39d8e4d99edb678a841a2bf86662951ab9
parent1afacfb0dfe9af88d8e831cfcfb8bda663cfc9b5
iio: ssp_sensors: don't manually free devm managed resources

The charme of devm_* functions is that you don't need to care about them
in the error path. In this case it is valid to just return NULL which makes
the device fail to probe and then the two gpios and the allocated memory
are freed automatically by the driver core.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/common/ssp_sensors/ssp_dev.c