diff options
Diffstat (limited to 'drivers/video/backlight/gpio_backlight.c')
-rw-r--r-- | drivers/video/backlight/gpio_backlight.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index 5fa217f9f445..81fb12770c2a 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c | |||
@@ -62,7 +62,8 @@ static const struct backlight_ops gpio_backlight_ops = { | |||
62 | 62 | ||
63 | static int gpio_backlight_probe(struct platform_device *pdev) | 63 | static int gpio_backlight_probe(struct platform_device *pdev) |
64 | { | 64 | { |
65 | struct gpio_backlight_platform_data *pdata = pdev->dev.platform_data; | 65 | struct gpio_backlight_platform_data *pdata = |
66 | dev_get_platdata(&pdev->dev); | ||
66 | struct backlight_properties props; | 67 | struct backlight_properties props; |
67 | struct backlight_device *bl; | 68 | struct backlight_device *bl; |
68 | struct gpio_backlight *gbl; | 69 | struct gpio_backlight *gbl; |
@@ -94,8 +95,9 @@ static int gpio_backlight_probe(struct platform_device *pdev) | |||
94 | memset(&props, 0, sizeof(props)); | 95 | memset(&props, 0, sizeof(props)); |
95 | props.type = BACKLIGHT_RAW; | 96 | props.type = BACKLIGHT_RAW; |
96 | props.max_brightness = 1; | 97 | props.max_brightness = 1; |
97 | bl = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, gbl, | 98 | bl = devm_backlight_device_register(&pdev->dev, dev_name(&pdev->dev), |
98 | &gpio_backlight_ops, &props); | 99 | &pdev->dev, gbl, &gpio_backlight_ops, |
100 | &props); | ||
99 | if (IS_ERR(bl)) { | 101 | if (IS_ERR(bl)) { |
100 | dev_err(&pdev->dev, "failed to register backlight\n"); | 102 | dev_err(&pdev->dev, "failed to register backlight\n"); |
101 | return PTR_ERR(bl); | 103 | return PTR_ERR(bl); |
@@ -108,21 +110,12 @@ static int gpio_backlight_probe(struct platform_device *pdev) | |||
108 | return 0; | 110 | return 0; |
109 | } | 111 | } |
110 | 112 | ||
111 | static int gpio_backlight_remove(struct platform_device *pdev) | ||
112 | { | ||
113 | struct backlight_device *bl = platform_get_drvdata(pdev); | ||
114 | |||
115 | backlight_device_unregister(bl); | ||
116 | return 0; | ||
117 | } | ||
118 | |||
119 | static struct platform_driver gpio_backlight_driver = { | 113 | static struct platform_driver gpio_backlight_driver = { |
120 | .driver = { | 114 | .driver = { |
121 | .name = "gpio-backlight", | 115 | .name = "gpio-backlight", |
122 | .owner = THIS_MODULE, | 116 | .owner = THIS_MODULE, |
123 | }, | 117 | }, |
124 | .probe = gpio_backlight_probe, | 118 | .probe = gpio_backlight_probe, |
125 | .remove = gpio_backlight_remove, | ||
126 | }; | 119 | }; |
127 | 120 | ||
128 | module_platform_driver(gpio_backlight_driver); | 121 | module_platform_driver(gpio_backlight_driver); |