These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / leds / leds-lp5521.c
index 8ca197a..63a9254 100644 (file)
@@ -514,20 +514,19 @@ static int lp5521_probe(struct i2c_client *client,
        int ret;
        struct lp55xx_chip *chip;
        struct lp55xx_led *led;
-       struct lp55xx_platform_data *pdata;
+       struct lp55xx_platform_data *pdata = dev_get_platdata(&client->dev);
        struct device_node *np = client->dev.of_node;
 
-       if (!dev_get_platdata(&client->dev)) {
+       if (!pdata) {
                if (np) {
-                       ret = lp55xx_of_populate_pdata(&client->dev, np);
-                       if (ret < 0)
-                               return ret;
+                       pdata = lp55xx_of_populate_pdata(&client->dev, np);
+                       if (IS_ERR(pdata))
+                               return PTR_ERR(pdata);
                } else {
                        dev_err(&client->dev, "no platform data\n");
                        return -EINVAL;
                }
        }
-       pdata = dev_get_platdata(&client->dev);
 
        chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL);
        if (!chip)