--- zzzz-none-000/linux-3.10.107/drivers/video/backlight/ili922x.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/video/backlight/ili922x.c 2021-02-04 17:41:59.000000000 +0000 @@ -482,10 +482,8 @@ u16 reg = 0; ili = devm_kzalloc(&spi->dev, sizeof(*ili), GFP_KERNEL); - if (!ili) { - dev_err(&spi->dev, "cannot alloc priv data\n"); + if (!ili) return -ENOMEM; - } ili->spi = spi; spi_set_drvdata(spi, ili); @@ -497,24 +495,25 @@ "no LCD found: Chip ID 0x%x, ret %d\n", reg, ret); return -ENODEV; - } else { - dev_info(&spi->dev, "ILI%x found, SPI freq %d, mode %d\n", - reg, spi->max_speed_hz, spi->mode); } + dev_info(&spi->dev, "ILI%x found, SPI freq %d, mode %d\n", + reg, spi->max_speed_hz, spi->mode); + ret = ili922x_read_status(spi, ®); if (ret) { dev_err(&spi->dev, "reading RS failed...\n"); return ret; - } else - dev_dbg(&spi->dev, "status: 0x%x\n", reg); + } + + dev_dbg(&spi->dev, "status: 0x%x\n", reg); ili922x_display_init(spi); ili->power = FB_BLANK_POWERDOWN; - lcd = lcd_device_register("ili922xlcd", &spi->dev, ili, - &ili922x_ops); + lcd = devm_lcd_device_register(&spi->dev, "ili922xlcd", &spi->dev, ili, + &ili922x_ops); if (IS_ERR(lcd)) { dev_err(&spi->dev, "cannot register LCD\n"); return PTR_ERR(lcd); @@ -530,17 +529,13 @@ static int ili922x_remove(struct spi_device *spi) { - struct ili922x *ili = spi_get_drvdata(spi); - ili922x_poweroff(spi); - lcd_device_unregister(ili->ld); return 0; } static struct spi_driver ili922x_driver = { .driver = { .name = "ili922x", - .owner = THIS_MODULE, }, .probe = ili922x_probe, .remove = ili922x_remove,