return -EINVAL;
}
- ld = lcd_device_register("s6e63m0", &spi->dev, lcd, &s6e63m0_lcd_ops);
+ ld = devm_lcd_device_register(&spi->dev, "s6e63m0", &spi->dev, lcd,
+ &s6e63m0_lcd_ops);
if (IS_ERR(ld))
return PTR_ERR(ld);
props.type = BACKLIGHT_RAW;
props.max_brightness = MAX_BRIGHTNESS;
- bd = backlight_device_register("s6e63m0bl-bl", &spi->dev, lcd,
- &s6e63m0_backlight_ops, &props);
- if (IS_ERR(bd)) {
- ret = PTR_ERR(bd);
- goto out_lcd_unregister;
- }
+ bd = devm_backlight_device_register(&spi->dev, "s6e63m0bl-bl",
+ &spi->dev, lcd, &s6e63m0_backlight_ops,
+ &props);
+ if (IS_ERR(bd))
+ return PTR_ERR(bd);
bd->props.brightness = MAX_BRIGHTNESS;
lcd->bd = bd;
dev_info(&spi->dev, "s6e63m0 panel driver has been probed.\n");
return 0;
-
-out_lcd_unregister:
- lcd_device_unregister(ld);
- return ret;
}
static int s6e63m0_remove(struct spi_device *spi)
s6e63m0_power(lcd, FB_BLANK_POWERDOWN);
device_remove_file(&spi->dev, &dev_attr_gamma_table);
device_remove_file(&spi->dev, &dev_attr_gamma_mode);
- backlight_device_unregister(lcd->bd);
- lcd_device_unregister(lcd->ld);
return 0;
}