[PATCH -mmotm] backlight: fix adp8860_bl build errors

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Randy Dunlap
Date: Wednesday, May 12, 2010 - 1:39 pm

From: Randy Dunlap <randy.dunlap@oracle.com>

Add slab.h to fix part of build.
Add a parameter in backlight_device_register() call to fix part of build.

drivers/video/backlight/adp8860_bl.c:215: error: implicit declaration of function 'kzalloc'
drivers/video/backlight/adp8860_bl.c:215: warning: assignment makes pointer from integer without a cast
drivers/video/backlight/adp8860_bl.c:285: error: implicit declaration of function 'kfree'
drivers/video/backlight/adp8860_bl.c:673: warning: assignment makes pointer from integer without a cast
drivers/video/backlight/adp8860_bl.c:689: error: too few arguments to function 'backlight_device_register'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Michael Hennerich <michael.hennerich@analog.com>
---
 drivers/video/backlight/adp8860_bl.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- mmotm-2010-0511-1820.orig/drivers/video/backlight/adp8860_bl.c
+++ mmotm-2010-0511-1820/drivers/video/backlight/adp8860_bl.c
@@ -16,6 +16,7 @@
 #include <linux/fb.h>
 #include <linux/backlight.h>
 #include <linux/leds.h>
+#include <linux/slab.h>
 #include <linux/workqueue.h>
 
 #include <linux/i2c/adp8860.h>
@@ -647,6 +648,7 @@ static int __devinit adp8860_probe(struc
 	struct adp8860_bl *data;
 	struct adp8860_backlight_platform_data *pdata =
 		client->dev.platform_data;
+	struct backlight_properties props;
 	uint8_t reg_val;
 	int ret;
 
@@ -683,10 +685,13 @@ static int __devinit adp8860_probe(struc
 	data->current_brightness = 0;
 	i2c_set_clientdata(client, data);
 
+	memset(&props, 0, sizeof(props));
+	props.max_brightness = ADP8860_MAX_BRIGHTNESS;
+
 	mutex_init(&data->lock);
 
 	bl = backlight_device_register(dev_driver_string(&client->dev),
-			&client->dev, data, &adp8860_bl_ops);
+			&client->dev, data, &adp8860_bl_ops, &props);
 	if (IS_ERR(bl)) {
 		dev_err(&client->dev, "failed to register backlight\n");
 		ret = PTR_ERR(bl);
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
mmotm 2010-05-11-18-20 uploaded, akpm, (Tue May 11, 6:21 pm)
Re: mmotm 2010-05-11-18-20 uploaded (aio build), Randy Dunlap, (Wed May 12, 9:50 am)
Re: mmotm 2010-05-11-18-20 uploaded (aio build), Jeff Moyer, (Wed May 12, 10:07 am)
Re: mmotm 2010-05-11-18-20 uploaded (aio build), Randy Dunlap, (Wed May 12, 10:09 am)
Re: mmotm 2010-05-11-18-20 uploaded (aio build; add numa), Randy Dunlap, (Wed May 12, 12:42 pm)
mmotm 2010-05-11 - dies in pm_qos_update_request(), Valdis.Kletnieks, (Wed May 12, 12:52 pm)
[PATCH -mmotm] misc: fix ad525X_dpot build, Randy Dunlap, (Wed May 12, 1:39 pm)
[PATCH -mmotm] backlight: fix adp8860_bl build errors, Randy Dunlap, (Wed May 12, 1:39 pm)
RE: [PATCH -mmotm] misc: fix ad525X_dpot build, Hennerich, Michael, (Wed May 12, 1:53 pm)
RE: [PATCH -mmotm] backlight: fix adp8860_bl build errors, Hennerich, Michael, (Wed May 12, 1:54 pm)
Re: mmotm 2010-05-11 - dies in pm_qos_update_request(), Rafael J. Wysocki, (Wed May 12, 2:07 pm)
Re: mmotm 2010-05-11 - dies in pm_qos_update_request(), Valdis.Kletnieks, (Wed May 12, 3:12 pm)
Re: mmotm 2010-05-11 - dies in pm_qos_update_request(), Rafael J. Wysocki, (Wed May 12, 3:33 pm)
Re: mmotm 2010-05-11 - dies in pm_qos_update_request(), Valdis.Kletnieks, (Thu May 13, 7:34 am)
Re: mmotm 2010-05-11-18-20 uploaded, Valdis.Kletnieks, (Thu May 13, 8:06 am)
Re: mmotm 2010-05-11-18-20 uploaded, Dmitry Torokhov, (Thu May 13, 9:02 am)
Re: mmotm 2010-05-11-18-20 uploaded, Mauro Carvalho Chehab, (Thu May 13, 9:20 am)
Re: mmotm 2010-05-11-18-20 uploaded, Valdis.Kletnieks, (Thu May 13, 9:29 am)
Re: mmotm 2010-05-11-18-20 uploaded, Mauro Carvalho Chehab, (Thu May 13, 10:32 am)
Re: mmotm 2010-05-11 - dies in pm_qos_update_request(), Rafael J. Wysocki, (Thu May 13, 3:24 pm)
Re: mmotm 2010-05-11 - dies in pm_qos_update_request(), Rafael J. Wysocki, (Thu May 13, 3:32 pm)
Re: mmotm 2010-05-11-18-20 uploaded, Mauro Carvalho Chehab, (Wed May 19, 4:34 pm)
Re: mmotm 2010-05-11-18-20 uploaded, Mauro Carvalho Chehab, (Wed May 19, 9:57 pm)