File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ static int fb_notifier_callback(struct notifier_block *self,
112112
113113 if (!bd -> ops )
114114 goto out ;
115- if (bd -> ops -> check_fb && !bd -> ops -> check_fb (bd , info ))
115+ if (bd -> ops -> controls_device && !bd -> ops -> controls_device (bd , info -> device ))
116116 goto out ;
117117 if (fb_bd && fb_bd != bd )
118118 goto out ;
Original file line number Diff line number Diff line change @@ -99,18 +99,18 @@ static int bd6107_backlight_update_status(struct backlight_device *backlight)
9999 return 0 ;
100100}
101101
102- static int bd6107_backlight_check_fb (struct backlight_device * backlight ,
103- struct fb_info * info )
102+ static bool bd6107_backlight_controls_device (struct backlight_device * backlight ,
103+ struct device * display_dev )
104104{
105105 struct bd6107 * bd = bl_get_data (backlight );
106106
107- return !bd -> pdata -> dev || bd -> pdata -> dev == info -> device ;
107+ return !bd -> pdata -> dev || bd -> pdata -> dev == display_dev ;
108108}
109109
110110static const struct backlight_ops bd6107_backlight_ops = {
111- .options = BL_CORE_SUSPENDRESUME ,
112- .update_status = bd6107_backlight_update_status ,
113- .check_fb = bd6107_backlight_check_fb ,
111+ .options = BL_CORE_SUSPENDRESUME ,
112+ .update_status = bd6107_backlight_update_status ,
113+ .controls_device = bd6107_backlight_controls_device ,
114114};
115115
116116static int bd6107_probe (struct i2c_client * client )
Original file line number Diff line number Diff line change @@ -30,18 +30,18 @@ static int gpio_backlight_update_status(struct backlight_device *bl)
3030 return 0 ;
3131}
3232
33- static int gpio_backlight_check_fb (struct backlight_device * bl ,
34- struct fb_info * info )
33+ static bool gpio_backlight_controls_device (struct backlight_device * bl ,
34+ struct device * display_dev )
3535{
3636 struct gpio_backlight * gbl = bl_get_data (bl );
3737
38- return !gbl -> dev || gbl -> dev == info -> device ;
38+ return !gbl -> dev || gbl -> dev == display_dev ;
3939}
4040
4141static const struct backlight_ops gpio_backlight_ops = {
42- .options = BL_CORE_SUSPENDRESUME ,
43- .update_status = gpio_backlight_update_status ,
44- .check_fb = gpio_backlight_check_fb ,
42+ .options = BL_CORE_SUSPENDRESUME ,
43+ .update_status = gpio_backlight_update_status ,
44+ .controls_device = gpio_backlight_controls_device ,
4545};
4646
4747static int gpio_backlight_probe (struct platform_device * pdev )
Original file line number Diff line number Diff line change @@ -62,18 +62,18 @@ static int lv5207lp_backlight_update_status(struct backlight_device *backlight)
6262 return 0 ;
6363}
6464
65- static int lv5207lp_backlight_check_fb (struct backlight_device * backlight ,
66- struct fb_info * info )
65+ static bool lv5207lp_backlight_controls_device (struct backlight_device * backlight ,
66+ struct device * display_dev )
6767{
6868 struct lv5207lp * lv = bl_get_data (backlight );
6969
70- return !lv -> pdata -> dev || lv -> pdata -> dev == info -> device ;
70+ return !lv -> pdata -> dev || lv -> pdata -> dev == display_dev ;
7171}
7272
7373static const struct backlight_ops lv5207lp_backlight_ops = {
74- .options = BL_CORE_SUSPENDRESUME ,
75- .update_status = lv5207lp_backlight_update_status ,
76- .check_fb = lv5207lp_backlight_check_fb ,
74+ .options = BL_CORE_SUSPENDRESUME ,
75+ .update_status = lv5207lp_backlight_update_status ,
76+ .controls_device = lv5207lp_backlight_controls_device ,
7777};
7878
7979static int lv5207lp_probe (struct i2c_client * client )
Original file line number Diff line number Diff line change 1313#include <linux/fb.h>
1414#include <linux/mutex.h>
1515#include <linux/notifier.h>
16+ #include <linux/types.h>
1617
1718/**
1819 * enum backlight_update_reason - what method was used to update backlight
@@ -110,7 +111,6 @@ enum backlight_scale {
110111};
111112
112113struct backlight_device ;
113- struct fb_info ;
114114
115115/**
116116 * struct backlight_ops - backlight operations
@@ -160,18 +160,18 @@ struct backlight_ops {
160160 int (* get_brightness )(struct backlight_device * );
161161
162162 /**
163- * @check_fb : Check the framebuffer device.
163+ * @controls_device : Check against the display device
164164 *
165- * Check if given framebuffer device is the one bound to this backlight.
166- * This operation is optional and if not implemented it is assumed that the
167- * fbdev is always the one bound to the backlight.
165+ * Check if the backlight controls the given display device. This
166+ * operation is optional and if not implemented it is assumed that
167+ * the display is always the one controlled by the backlight.
168168 *
169169 * RETURNS:
170170 *
171- * If info is NULL or the info matches the fbdev bound to the backlight return true.
172- * If info does not match the fbdev bound to the backlight return false.
171+ * If display_dev is NULL or display_dev matches the device controlled by
172+ * the backlight, return true. Otherwise return false.
173173 */
174- int (* check_fb )(struct backlight_device * bd , struct fb_info * info );
174+ bool (* controls_device )(struct backlight_device * bd , struct device * display_dev );
175175};
176176
177177/**
You can’t perform that action at this time.
0 commit comments