mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
comedi: comedi_8254: Replace comedi_8254_init() and comedi_8254_mm_init()
`comedi_8254_init()` and `comedi_8254_mm_init()` return `NULL` on failure, but the failure is not necessarily due to lack of memory. Change them to return an `ERR_PTR` value on failure and rename the functions to make it obvious the API has changed. `comedi_8254_init()` has been replaced with `comedi_8254_io_alloc()`, and `comedi_8254_mm_init()` has been replaced with `comedi_8254_mm_alloc()`. Cc: Arnd Bergmann <arnd@kernel.org> Cc: Niklas Schnelle <schnelle@linux.ibm.com> Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Link: https://lore.kernel.org/r/20230913170712.111719-4-abbotti@mev.co.uk Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c62f5032f7
commit
fade5e5b0b
@@ -177,7 +177,8 @@ static void comedi_device_detach_cleanup(struct comedi_device *dev)
|
||||
dev->n_subdevices = 0;
|
||||
}
|
||||
kfree(dev->private);
|
||||
kfree(dev->pacer);
|
||||
if (!IS_ERR(dev->pacer))
|
||||
kfree(dev->pacer);
|
||||
dev->private = NULL;
|
||||
dev->pacer = NULL;
|
||||
dev->driver = NULL;
|
||||
|
||||
Reference in New Issue
Block a user