Commit 70eb4083 authored by Jeremy Sowden's avatar Jeremy Sowden Committed by Greg Kroah-Hartman

staging: kpc2000: clean up after probe failure.

On error, kp2000_probe_cores just returned an error without freeing
resources which had previously been allocated.  Added the missing
clean-up code.

Updated TODO.
Signed-off-by: default avatarJeremy Sowden <jeremy@azazel.net>
Reviewed-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent abb611d2
- the kpc_spi driver doesn't seem to let multiple transactions (to different instances of the core) happen in parallel... - the kpc_spi driver doesn't seem to let multiple transactions (to different instances of the core) happen in parallel...
- The kpc_i2c driver is a hot mess, it should probably be cleaned up a ton. It functions against current hardware though. - The kpc_i2c driver is a hot mess, it should probably be cleaned up a ton. It functions against current hardware though.
- pcard->card_num in kp2000_pcie_probe() is a global variable and needs atomic / locking / something better. - pcard->card_num in kp2000_pcie_probe() is a global variable and needs atomic / locking / something better.
- the loop in kp2000_probe_cores() that uses probe_core_uio() also probably needs error handling
- would be nice if the AIO fileops in kpc_dma could be made to work - would be nice if the AIO fileops in kpc_dma could be made to work
- probably want to add a CONFIG_ option to control compilation of the AIO functions - probably want to add a CONFIG_ option to control compilation of the AIO functions
- if the AIO fileops in kpc_dma start working, next would be making iov_count > 1 work too - if the AIO fileops in kpc_dma start working, next would be making iov_count > 1 work too
...@@ -438,7 +438,7 @@ int kp2000_probe_cores(struct kp2000_device *pcard) ...@@ -438,7 +438,7 @@ int kp2000_probe_cores(struct kp2000_device *pcard)
dev_err(&pcard->pdev->dev, dev_err(&pcard->pdev->dev,
"kp2000_probe_cores: failed to add core %d: %d\n", "kp2000_probe_cores: failed to add core %d: %d\n",
i, err); i, err);
return err; goto error;
} }
core_num++; core_num++;
} }
...@@ -457,10 +457,15 @@ int kp2000_probe_cores(struct kp2000_device *pcard) ...@@ -457,10 +457,15 @@ int kp2000_probe_cores(struct kp2000_device *pcard)
err = probe_core_uio(0, pcard, "kpc_uio", cte); err = probe_core_uio(0, pcard, "kpc_uio", cte);
if (err){ if (err){
dev_err(&pcard->pdev->dev, "kp2000_probe_cores: failed to add board_info core: %d\n", err); dev_err(&pcard->pdev->dev, "kp2000_probe_cores: failed to add board_info core: %d\n", err);
return err; goto error;
} }
return 0; return 0;
error:
kp2000_remove_cores(pcard);
mfd_remove_devices(PCARD_TO_DEV(pcard));
return err;
} }
void kp2000_remove_cores(struct kp2000_device *pcard) void kp2000_remove_cores(struct kp2000_device *pcard)
......
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