--- zzzz-none-000/linux-3.10.107/drivers/leds/leds-da9052.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/leds/leds-da9052.c 2021-02-04 17:41:59.000000000 +0000 @@ -14,7 +14,6 @@ #include #include -#include #include #include #include @@ -112,7 +111,7 @@ int i; da9052 = dev_get_drvdata(pdev->dev.parent); - pdata = da9052->dev->platform_data; + pdata = dev_get_platdata(da9052->dev); if (pdata == NULL) { dev_err(&pdev->dev, "No platform data\n"); goto err; @@ -127,8 +126,7 @@ led = devm_kzalloc(&pdev->dev, sizeof(struct da9052_led) * pled->num_leds, GFP_KERNEL); - if (led == NULL) { - dev_err(&pdev->dev, "Failed to alloc memory\n"); + if (!led) { error = -ENOMEM; goto err; } @@ -185,7 +183,7 @@ int i; da9052 = dev_get_drvdata(pdev->dev.parent); - pdata = da9052->dev->platform_data; + pdata = dev_get_platdata(da9052->dev); pled = pdata->pled; for (i = 0; i < pled->num_leds; i++) { @@ -201,7 +199,6 @@ static struct platform_driver da9052_led_driver = { .driver = { .name = "da9052-leds", - .owner = THIS_MODULE, }, .probe = da9052_led_probe, .remove = da9052_led_remove,