i2c: make i2c_unregister_device() ERR_PTR safe
We are moving towards returning ERR_PTRs when i2c_new_*_device() calls fail. Make sure its counterpart for unregistering handles ERR_PTRs as well. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
parent
a55aa89aab
commit
689f535843
@ -832,7 +832,7 @@ EXPORT_SYMBOL_GPL(i2c_new_device);
|
||||
*/
|
||||
void i2c_unregister_device(struct i2c_client *client)
|
||||
{
|
||||
if (!client)
|
||||
if (IS_ERR_OR_NULL(client))
|
||||
return;
|
||||
|
||||
if (client->dev.of_node) {
|
||||
|
Loading…
Reference in New Issue
Block a user