Hi Nishad,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.19 next-20181019]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system]
url:
https://github.com/0day-ci/linux/commits/Nishad-Kamdar/staging-olpc_dcon-olpc_dcon_xo_1-c-Switch-to-the-gpio-descriptor-interface/20181028-124517
config: i386-allmodconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All errors (new ones prefixed by >>):
drivers/staging/olpc_dcon/olpc_dcon_xo_1.c: In function 'dcon_init_xo_1':
>> drivers/staging/olpc_dcon/olpc_dcon_xo_1.c:37:43: error: dereferencing
>> pointer to incomplete type 'struct backlight_device'
*pin->ptr = devm_gpiod_get(&dcon->bl_dev->dev, pin->name,
^~
>> drivers/staging/olpc_dcon/olpc_dcon_xo_1.c:41:4: error: implicit declaration
>> of function 'dev_err'; did you mean 'pr_err'?
>> [-Werror=implicit-function-declaration]
dev_err(&dcon->bl_dev->dev,
^~~
pr_err
>> drivers/staging/olpc_dcon/olpc_dcon_xo_1.c:89:3: error: label 'err_req_irq'
>> used but not defined
goto err_req_irq;
^~~~
cc1: some warnings being treated as errors
vim +37 drivers/staging/olpc_dcon/olpc_dcon_xo_1.c
19
20 static int dcon_init_xo_1(struct dcon_priv *dcon)
21 {
22 unsigned char lob;
23 int ret, i;
24 struct dcon_gpio *pin;
25 unsigned long flags = GPIOD_ASIS;
26
27 struct dcon_gpio gpios[] = {
28 { .ptr = &dcon_stat0, .name = "dcon_stat0", .flags =
flags },
29 { .ptr = &dcon_stat1, .name = "dcon_stat1", .flags =
flags },
30 { .ptr = &dcon_irq, .name = "dcon_irq", .flags = flags
},
31 { .ptr = &dcon_load, .name = "dcon_load", .flags =
flags },
32 { .ptr = &dcon_blank, .name = "dcon_blank", .flags =
flags },
33 };
34
35 for (i = 0; i < ARRAY_SIZE(gpios); i++) {
36 pin = &gpios[i];
> 37 *pin->ptr = devm_gpiod_get(&dcon->bl_dev->dev,
pin->name,
38 pin->flags);
39 if (IS_ERR(*pin->ptr)) {
40 ret = PTR_ERR(*pin->ptr);
> 41 dev_err(&dcon->bl_dev->dev,
42 "failed to request %s GPIO: %d\n",
43 pin->name, ret);
44 return ret;
45 }
46 }
47
48 /* Turn off the event enable for GPIO7 just to be safe */
49 cs5535_gpio_clear(OLPC_GPIO_DCON_IRQ, GPIO_EVENTS_ENABLE);
50
51 /*
52 * Determine the current state by reading the GPIO bit; earlier
53 * stages of the boot process have established the state.
54 *
55 * Note that we read GPIO_OUTPUT_VAL rather than GPIO_READ_BACK
here;
56 * this is because OFW will disable input for the pin and set a
value..
57 * READ_BACK will only contain a valid value if input is
enabled and
58 * then a value is set. So, future readings of the pin can use
59 * READ_BACK, but the first one cannot. Awesome, huh?
60 */
61 dcon->curr_src = cs5535_gpio_isset(OLPC_GPIO_DCON_LOAD,
GPIO_OUTPUT_VAL)
62 ? DCON_SOURCE_CPU
63 : DCON_SOURCE_DCON;
64 dcon->pending_src = dcon->curr_src;
65
66 /* Set the directions for the GPIO pins */
67 gpiod_direction_input(dcon_stat0);
68 gpiod_direction_input(dcon_stat1);
69 gpiod_direction_input(dcon_irq);
70 gpiod_direction_input(dcon_blank);
71 gpiod_direction_output(dcon_load, dcon->curr_src ==
DCON_SOURCE_CPU);
72
73 /* Set up the interrupt mappings */
74
75 /* Set the IRQ to pair 2 */
76 cs5535_gpio_setup_event(OLPC_GPIO_DCON_IRQ, 2, 0);
77
78 /* Enable group 2 to trigger the DCON interrupt */
79 cs5535_gpio_set_irq(2, DCON_IRQ);
80
81 /* Select edge level for interrupt (in PIC) */
82 lob = inb(0x4d0);
83 lob &= ~(1 << DCON_IRQ);
84 outb(lob, 0x4d0);
85
86 /* Register the interrupt handler */
87 if (request_irq(DCON_IRQ, &dcon_interrupt, 0, "DCON", dcon)) {
88 pr_err("failed to request DCON's irq\n");
> 89 goto err_req_irq;
90 }
91
92 /* Clear INV_EN for GPIO7 (DCONIRQ)