--- zzzz-none-000/linux-3.10.107/drivers/video/backlight/tosa_lcd.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/video/backlight/tosa_lcd.c 2021-02-04 17:41:59.000000000 +0000 @@ -198,7 +198,7 @@ ret = devm_gpio_request_one(&spi->dev, TOSA_GPIO_TG_ON, GPIOF_OUT_INIT_LOW, "tg #pwr"); if (ret < 0) - goto err_gpio_tg; + return ret; mdelay(60); @@ -206,8 +206,8 @@ tosa_lcd_tg_on(data); - data->lcd = lcd_device_register("tosa-lcd", &spi->dev, data, - &tosa_lcd_ops); + data->lcd = devm_lcd_device_register(&spi->dev, "tosa-lcd", &spi->dev, + data, &tosa_lcd_ops); if (IS_ERR(data->lcd)) { ret = PTR_ERR(data->lcd); @@ -219,8 +219,6 @@ err_register: tosa_lcd_tg_off(data); -err_gpio_tg: - spi_set_drvdata(spi, NULL); return ret; } @@ -228,15 +226,11 @@ { struct tosa_lcd_data *data = spi_get_drvdata(spi); - lcd_device_unregister(data->lcd); - if (data->i2c) i2c_unregister_device(data->i2c); tosa_lcd_tg_off(data); - spi_set_drvdata(spi, NULL); - return 0; } @@ -269,7 +263,6 @@ static struct spi_driver tosa_lcd_driver = { .driver = { .name = "tosa-lcd", - .owner = THIS_MODULE, .pm = &tosa_lcd_pm_ops, }, .probe = tosa_lcd_probe,