lkml.org 
[lkml]   [2014]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/5] gpio: Cygnus: add GPIO driver


On 12/5/2014 6:14 PM, Ray Jui wrote:
>>> +static struct irq_chip bcm_cygnus_gpio_irq_chip = {
>>> + .name = "bcm-cygnus-gpio",
>>> + .irq_ack = bcm_cygnus_gpio_irq_ack,
>>> + .irq_mask = bcm_cygnus_gpio_irq_mask,
>>> + .irq_unmask = bcm_cygnus_gpio_irq_unmask,
>>> + .irq_set_type = bcm_cygnus_gpio_irq_set_type,
>>> +};
>>
>> const?
>>
>
>
> Sure, will add const to bcm_cygnus_gpio_irq_chip
>
>>> +static struct irq_domain_ops bcm_cygnus_irq_ops = {
>>> + .map = bcm_cygnus_gpio_irq_map,
>>> + .unmap = bcm_cygnus_gpio_irq_unmap,
>>> + .xlate = irq_domain_xlate_twocell,
>>> +};
>>
>> const here too?
>>
>
> Yes, will make bcm_cygnus_irq_ops const.
>
Actually, I cannot make them const here. Note they are passed into other
APIs which can potentially modifies their values internally.

drivers/gpio/gpio-bcm-cygnus.c: In function ‘bcm_cygnus_gpio_irq_map’:
drivers/gpio/gpio-bcm-cygnus.c:430:4: warning: passing argument 2 of
‘irq_set_chip_and_handler’ discards ‘const’ qualifier from pointer
target type [enabled by default]
handle_simple_irq);
^
In file included from drivers/gpio/gpio-bcm-cygnus.c:17:0:
include/linux/irq.h:461:20: note: expected ‘struct irq_chip *’ but
argument is of type ‘const struct irq_chip *’
static inline void irq_set_chip_and_handler(unsigned int irq, struct
irq_chip *chip,
^
drivers/gpio/gpio-bcm-cygnus.c: In function ‘bcm_cygnus_gpio_probe’:
drivers/gpio/gpio-bcm-cygnus.c:679:5: warning: passing argument 2 of
‘irq_set_chip_and_handler’ discards ‘const’ qualifier from pointer
target type [enabled by default]
handle_simple_irq);
^
In file included from drivers/gpio/gpio-bcm-cygnus.c:17:0:
include/linux/irq.h:461:20: note: expected ‘struct irq_chip *’ but
argument is of type ‘const struct irq_chip *’
static inline void irq_set_chip_and_handler(unsigned int irq, struct
irq_chip *chip,


\
 
 \ /
  Last update: 2014-12-08 03:41    [W:1.494 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site