From: Pantelis Antoniou Date: Thu, 15 Jan 2015 18:33:18 +0000 (+0200) Subject: i2c: Mark instantiated device nodes with OF_POPULATE X-Git-Tag: firefly_0821_release~3680^2~19^2~4^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6f491cafa26fe73636523730bcffb4ee99f5f21c;p=firefly-linux-kernel-4.4.55.git i2c: Mark instantiated device nodes with OF_POPULATE Mark (and unmark) device nodes with the POPULATE flag as appropriate. This is required to avoid multi probing when using I2C and device overlays containing a mux. Signed-off-by: Pantelis Antoniou Signed-off-by: Wolfram Sang (cherry picked from commit 6d0a0d9ad09be16e3ca676b245643945b4bff47d) Signed-off-by: Mark Brown Conflicts: drivers/i2c/i2c-core.c --- diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 92588d3bae45..780599ce4657 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -704,8 +704,10 @@ EXPORT_SYMBOL_GPL(i2c_new_device); */ void i2c_unregister_device(struct i2c_client *client) { +#if IS_ENABLED(CONFIG_OF_DYNAMIC) if (client->dev.of_node) of_node_clear_flag(client->dev.of_node, OF_POPULATED); +#endif device_unregister(&client->dev); } EXPORT_SYMBOL_GPL(i2c_unregister_device);