mfd: smsc-ece: Use devm_of_platform_populate()
authorBenjamin Gaignard <benjamin.gaignard@linaro.org>
Mon, 29 May 2017 15:46:01 +0000 (17:46 +0200)
committerLee Jones <lee.jones@linaro.org>
Thu, 6 Jul 2017 07:29:12 +0000 (08:29 +0100)
Use devm_of_platform_populate() to be sure that of_platform_depopulate
is called when removing the driver.

Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/smsc-ece1099.c

index 1f40baf1234e3e053918e81805117027f7b40100..93a8297de52aab6a54acfbfe511a22b6273de1a1 100644 (file)
@@ -69,8 +69,7 @@ static int smsc_i2c_probe(struct i2c_client *i2c,
 
 #ifdef CONFIG_OF
        if (i2c->dev.of_node)
-               ret = of_platform_populate(i2c->dev.of_node,
-                                          NULL, NULL, &i2c->dev);
+               ret = devm_of_platform_populate(&i2c->dev);
 #endif
 
        return ret;