Commit 689f5358 authored by Wolfram Sang's avatar Wolfram Sang Committed by Wolfram Sang
Browse files

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: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent a55aa89a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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) {