uio: uio_sercos3: use device-managed functions for simple allocs
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Fri, 20 Nov 2020 08:42:05 +0000 (10:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 9 Dec 2020 18:58:54 +0000 (19:58 +0100)
commit023c9c6dc2c414f1bef2e9ee649fb2e459f52326
tree656338dcdf585b93be0e3fdb7cfe9827d92b2da7
parentba022851f3b161040e79cc61c2bd760917490016
uio: uio_sercos3: use device-managed functions for simple allocs

This change converts the simple allocations [kzalloc()] to devm_kzalloc()
tying the life-time of these objects to the PCI device object.
It cleans up the error and exit path and bit, and does a minor correction
that -ENOMEM is returned (vs -ENODEV) in case the 'priv' object cannot be
allocated.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20201120084207.50736-1-alexandru.ardelean@analog.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/uio/uio_sercos3.c