--- zzzz-none-000/linux-3.10.107/drivers/leds/leds-88pm860x.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/leds/leds-88pm860x.c 2021-02-04 17:41:59.000000000 +0000 @@ -11,7 +11,6 @@ */ #include -#include #include #include #include @@ -131,10 +130,9 @@ struct device_node *nproot, *np; int iset = 0; - nproot = of_node_get(pdev->dev.parent->of_node); - if (!nproot) + if (!pdev->dev.parent->of_node) return -ENODEV; - nproot = of_find_node_by_name(nproot, "leds"); + nproot = of_get_child_by_name(pdev->dev.parent->of_node, "leds"); if (!nproot) { dev_err(&pdev->dev, "failed to find leds node\n"); return -ENODEV; @@ -144,6 +142,7 @@ of_property_read_u32(np, "marvell,88pm860x-iset", &iset); data->iset = PM8606_LED_CURRENT(iset); + of_node_put(np); break; } } @@ -157,7 +156,7 @@ static int pm860x_led_probe(struct platform_device *pdev) { struct pm860x_chip *chip = dev_get_drvdata(pdev->dev.parent); - struct pm860x_led_pdata *pdata = pdev->dev.platform_data; + struct pm860x_led_pdata *pdata = dev_get_platdata(&pdev->dev); struct pm860x_led *data; struct resource *res; int ret = 0; @@ -204,7 +203,7 @@ sprintf(data->name, "led1-blue"); break; } - dev_set_drvdata(&pdev->dev, data); + platform_set_drvdata(pdev, data); data->chip = chip; data->i2c = (chip->id == CHIP_PM8606) ? chip->client : chip->companion; data->port = pdev->id; @@ -239,7 +238,6 @@ static struct platform_driver pm860x_led_driver = { .driver = { .name = "88pm860x-led", - .owner = THIS_MODULE, }, .probe = pm860x_led_probe, .remove = pm860x_led_remove,