diff mbox

[v3,1/7] genirq: generic chip: export irq_map_generic_chip function

Message ID 1403276487-8792-2-git-send-email-boris.brezillon@free-electrons.com (mailing list archive)
State New, archived
Headers show

Commit Message

Boris BREZILLON June 20, 2014, 3:01 p.m. UTC
Export the generic irq map function in order to provide irq_domain ops with
generic mapping and specific of xlate function (needed by the new atmel
AIC driver).

Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
---
 include/linux/irq.h       | 2 ++
 kernel/irq/generic-chip.c | 5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

Comments

Jason Cooper June 21, 2014, 11:51 p.m. UTC | #1
On Fri, Jun 20, 2014 at 05:01:21PM +0200, Boris BREZILLON wrote:
> Export the generic irq map function in order to provide irq_domain ops with
> generic mapping and specific of xlate function (needed by the new atmel
> AIC driver).
> 
> Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
> ---
>  include/linux/irq.h       | 2 ++
>  kernel/irq/generic-chip.c | 5 +++--
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/irq.h b/include/linux/irq.h
> index 0d998d8..62af592 100644
> --- a/include/linux/irq.h
> +++ b/include/linux/irq.h
> @@ -771,6 +771,8 @@ void irq_gc_eoi(struct irq_data *d);
>  int irq_gc_set_wake(struct irq_data *d, unsigned int on);
>  
>  /* Setup functions for irq_chip_generic */
> +int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
> +			 irq_hw_number_t hw_irq);
>  struct irq_chip_generic *
>  irq_alloc_generic_chip(const char *name, int nr_ct, unsigned int irq_base,
>  		       void __iomem *reg_base, irq_flow_handler_t handler);
> diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c
> index 452d6f2..cf80e7b 100644
> --- a/kernel/irq/generic-chip.c
> +++ b/kernel/irq/generic-chip.c
> @@ -341,8 +341,8 @@ static struct lock_class_key irq_nested_lock_class;
>  /*
>   * irq_map_generic_chip - Map a generic chip for an irq domain
>   */
> -static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
> -				irq_hw_number_t hw_irq)
> +int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
> +			 irq_hw_number_t hw_irq)
>  {
>  	struct irq_data *data = irq_get_irq_data(virq);
>  	struct irq_domain_chip_generic *dgc = d->gc;
> @@ -394,6 +394,7 @@ static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
>  	irq_modify_status(virq, dgc->irq_flags_to_clear, dgc->irq_flags_to_set);
>  	return 0;
>  }
> +EXPORT_SYMBOL_GPL(irq_map_generic_chip);
>  
>  struct irq_domain_ops irq_generic_chip_ops = {
>  	.map	= irq_map_generic_chip,

Why can't you use irq_generic_chip_ops.map in your code and avoid this
patch entirely?

thx,

Jason.
Boris BREZILLON June 22, 2014, 7:59 a.m. UTC | #2
On 22/06/2014 01:51, Jason Cooper wrote:
> On Fri, Jun 20, 2014 at 05:01:21PM +0200, Boris BREZILLON wrote:
>> Export the generic irq map function in order to provide irq_domain ops with
>> generic mapping and specific of xlate function (needed by the new atmel
>> AIC driver).
>>
>> Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
>> ---
>>  include/linux/irq.h       | 2 ++
>>  kernel/irq/generic-chip.c | 5 +++--
>>  2 files changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/include/linux/irq.h b/include/linux/irq.h
>> index 0d998d8..62af592 100644
>> --- a/include/linux/irq.h
>> +++ b/include/linux/irq.h
>> @@ -771,6 +771,8 @@ void irq_gc_eoi(struct irq_data *d);
>>  int irq_gc_set_wake(struct irq_data *d, unsigned int on);
>>  
>>  /* Setup functions for irq_chip_generic */
>> +int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
>> +			 irq_hw_number_t hw_irq);
>>  struct irq_chip_generic *
>>  irq_alloc_generic_chip(const char *name, int nr_ct, unsigned int irq_base,
>>  		       void __iomem *reg_base, irq_flow_handler_t handler);
>> diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c
>> index 452d6f2..cf80e7b 100644
>> --- a/kernel/irq/generic-chip.c
>> +++ b/kernel/irq/generic-chip.c
>> @@ -341,8 +341,8 @@ static struct lock_class_key irq_nested_lock_class;
>>  /*
>>   * irq_map_generic_chip - Map a generic chip for an irq domain
>>   */
>> -static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
>> -				irq_hw_number_t hw_irq)
>> +int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
>> +			 irq_hw_number_t hw_irq)
>>  {
>>  	struct irq_data *data = irq_get_irq_data(virq);
>>  	struct irq_domain_chip_generic *dgc = d->gc;
>> @@ -394,6 +394,7 @@ static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
>>  	irq_modify_status(virq, dgc->irq_flags_to_clear, dgc->irq_flags_to_set);
>>  	return 0;
>>  }
>> +EXPORT_SYMBOL_GPL(irq_map_generic_chip);
>>  
>>  struct irq_domain_ops irq_generic_chip_ops = {
>>  	.map	= irq_map_generic_chip,
> Why can't you use irq_generic_chip_ops.map in your code and avoid this
> patch entirely?

Because in this case I'll have to remove constness from my
irq_domain_ops struct and initialize it in my init function.
This is not a big concern, but in general I tend to declare ops struct
with a const constraint.

Tell me if you still want me to drop this patch and rework my init process.

Best Regards,

Boris
Jason Cooper June 23, 2014, 1:07 p.m. UTC | #3
On Sun, Jun 22, 2014 at 09:59:44AM +0200, Boris BREZILLON wrote:
> 
> On 22/06/2014 01:51, Jason Cooper wrote:
> > On Fri, Jun 20, 2014 at 05:01:21PM +0200, Boris BREZILLON wrote:
> >> Export the generic irq map function in order to provide irq_domain ops with
> >> generic mapping and specific of xlate function (needed by the new atmel
> >> AIC driver).
> >>
> >> Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
> >> ---
> >>  include/linux/irq.h       | 2 ++
> >>  kernel/irq/generic-chip.c | 5 +++--
> >>  2 files changed, 5 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/include/linux/irq.h b/include/linux/irq.h
> >> index 0d998d8..62af592 100644
> >> --- a/include/linux/irq.h
> >> +++ b/include/linux/irq.h
> >> @@ -771,6 +771,8 @@ void irq_gc_eoi(struct irq_data *d);
> >>  int irq_gc_set_wake(struct irq_data *d, unsigned int on);
> >>  
> >>  /* Setup functions for irq_chip_generic */
> >> +int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
> >> +			 irq_hw_number_t hw_irq);
> >>  struct irq_chip_generic *
> >>  irq_alloc_generic_chip(const char *name, int nr_ct, unsigned int irq_base,
> >>  		       void __iomem *reg_base, irq_flow_handler_t handler);
> >> diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c
> >> index 452d6f2..cf80e7b 100644
> >> --- a/kernel/irq/generic-chip.c
> >> +++ b/kernel/irq/generic-chip.c
> >> @@ -341,8 +341,8 @@ static struct lock_class_key irq_nested_lock_class;
> >>  /*
> >>   * irq_map_generic_chip - Map a generic chip for an irq domain
> >>   */
> >> -static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
> >> -				irq_hw_number_t hw_irq)
> >> +int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
> >> +			 irq_hw_number_t hw_irq)
> >>  {
> >>  	struct irq_data *data = irq_get_irq_data(virq);
> >>  	struct irq_domain_chip_generic *dgc = d->gc;
> >> @@ -394,6 +394,7 @@ static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
> >>  	irq_modify_status(virq, dgc->irq_flags_to_clear, dgc->irq_flags_to_set);
> >>  	return 0;
> >>  }
> >> +EXPORT_SYMBOL_GPL(irq_map_generic_chip);
> >>  
> >>  struct irq_domain_ops irq_generic_chip_ops = {
> >>  	.map	= irq_map_generic_chip,
> > Why can't you use irq_generic_chip_ops.map in your code and avoid this

s/code/declaration/, sorry for the misunderstanding.

> > patch entirely?
> 
> Because in this case I'll have to remove constness from my
> irq_domain_ops struct and initialize it in my init function.
> This is not a big concern, but in general I tend to declare ops struct
> with a const constraint.

/*
 * We're the only user of irq_map_generic_chip() who
 * doesn't also use irq_domain_xlate_onetwocell()
 */
static const struct irq_domain_ops aic_irq_ops = {
	.map    = irq_generic_chip_ops.map,
        .xlate  = aic_irq_domain_xlate,
};

Wouldn't work?

> Tell me if you still want me to drop this patch and rework my init process.

If the above is satisfactory for you, please do so.  If we get a few
more chips that need one function, but not the other, then we'll revisit
what we're exporting.  The comment should bring the issue up in a
future grep.

thx,

Jason.
Boris BREZILLON June 23, 2014, 3:07 p.m. UTC | #4
On 23/06/2014 15:07, Jason Cooper wrote:
> On Sun, Jun 22, 2014 at 09:59:44AM +0200, Boris BREZILLON wrote:
>> On 22/06/2014 01:51, Jason Cooper wrote:
>>> On Fri, Jun 20, 2014 at 05:01:21PM +0200, Boris BREZILLON wrote:
>>>> Export the generic irq map function in order to provide irq_domain ops with
>>>> generic mapping and specific of xlate function (needed by the new atmel
>>>> AIC driver).
>>>>
>>>> Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
>>>> ---
>>>>  include/linux/irq.h       | 2 ++
>>>>  kernel/irq/generic-chip.c | 5 +++--
>>>>  2 files changed, 5 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/include/linux/irq.h b/include/linux/irq.h
>>>> index 0d998d8..62af592 100644
>>>> --- a/include/linux/irq.h
>>>> +++ b/include/linux/irq.h
>>>> @@ -771,6 +771,8 @@ void irq_gc_eoi(struct irq_data *d);
>>>>  int irq_gc_set_wake(struct irq_data *d, unsigned int on);
>>>>  
>>>>  /* Setup functions for irq_chip_generic */
>>>> +int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
>>>> +			 irq_hw_number_t hw_irq);
>>>>  struct irq_chip_generic *
>>>>  irq_alloc_generic_chip(const char *name, int nr_ct, unsigned int irq_base,
>>>>  		       void __iomem *reg_base, irq_flow_handler_t handler);
>>>> diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c
>>>> index 452d6f2..cf80e7b 100644
>>>> --- a/kernel/irq/generic-chip.c
>>>> +++ b/kernel/irq/generic-chip.c
>>>> @@ -341,8 +341,8 @@ static struct lock_class_key irq_nested_lock_class;
>>>>  /*
>>>>   * irq_map_generic_chip - Map a generic chip for an irq domain
>>>>   */
>>>> -static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
>>>> -				irq_hw_number_t hw_irq)
>>>> +int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
>>>> +			 irq_hw_number_t hw_irq)
>>>>  {
>>>>  	struct irq_data *data = irq_get_irq_data(virq);
>>>>  	struct irq_domain_chip_generic *dgc = d->gc;
>>>> @@ -394,6 +394,7 @@ static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
>>>>  	irq_modify_status(virq, dgc->irq_flags_to_clear, dgc->irq_flags_to_set);
>>>>  	return 0;
>>>>  }
>>>> +EXPORT_SYMBOL_GPL(irq_map_generic_chip);
>>>>  
>>>>  struct irq_domain_ops irq_generic_chip_ops = {
>>>>  	.map	= irq_map_generic_chip,
>>> Why can't you use irq_generic_chip_ops.map in your code and avoid this
> s/code/declaration/, sorry for the misunderstanding.
>
>>> patch entirely?
>> Because in this case I'll have to remove constness from my
>> irq_domain_ops struct and initialize it in my init function.
>> This is not a big concern, but in general I tend to declare ops struct
>> with a const constraint.
> /*
>  * We're the only user of irq_map_generic_chip() who
>  * doesn't also use irq_domain_xlate_onetwocell()
>  */
> static const struct irq_domain_ops aic_irq_ops = {
> 	.map    = irq_generic_chip_ops.map,
>         .xlate  = aic_irq_domain_xlate,
> };
>
> Wouldn't work?

No, it fails  with :

"error: initializer element is not constant"


>
>> Tell me if you still want me to drop this patch and rework my init process.
> If the above is satisfactory for you, please do so.  If we get a few
> more chips that need one function, but not the other, then we'll revisit
> what we're exporting.  The comment should bring the issue up in a
> future grep.
>
> thx,
>
> Jason.
Jason Cooper June 23, 2014, 5:50 p.m. UTC | #5
On Mon, Jun 23, 2014 at 05:07:47PM +0200, Boris BREZILLON wrote:
> 
> On 23/06/2014 15:07, Jason Cooper wrote:
> > On Sun, Jun 22, 2014 at 09:59:44AM +0200, Boris BREZILLON wrote:
> >> On 22/06/2014 01:51, Jason Cooper wrote:
> >>> On Fri, Jun 20, 2014 at 05:01:21PM +0200, Boris BREZILLON wrote:
> >>>> Export the generic irq map function in order to provide irq_domain ops with
> >>>> generic mapping and specific of xlate function (needed by the new atmel
> >>>> AIC driver).
> >>>>
> >>>> Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
> >>>> ---
> >>>>  include/linux/irq.h       | 2 ++
> >>>>  kernel/irq/generic-chip.c | 5 +++--
> >>>>  2 files changed, 5 insertions(+), 2 deletions(-)
> >>>>
> >>>> diff --git a/include/linux/irq.h b/include/linux/irq.h
> >>>> index 0d998d8..62af592 100644
> >>>> --- a/include/linux/irq.h
> >>>> +++ b/include/linux/irq.h
> >>>> @@ -771,6 +771,8 @@ void irq_gc_eoi(struct irq_data *d);
> >>>>  int irq_gc_set_wake(struct irq_data *d, unsigned int on);
> >>>>  
> >>>>  /* Setup functions for irq_chip_generic */
> >>>> +int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
> >>>> +			 irq_hw_number_t hw_irq);
> >>>>  struct irq_chip_generic *
> >>>>  irq_alloc_generic_chip(const char *name, int nr_ct, unsigned int irq_base,
> >>>>  		       void __iomem *reg_base, irq_flow_handler_t handler);
> >>>> diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c
> >>>> index 452d6f2..cf80e7b 100644
> >>>> --- a/kernel/irq/generic-chip.c
> >>>> +++ b/kernel/irq/generic-chip.c
> >>>> @@ -341,8 +341,8 @@ static struct lock_class_key irq_nested_lock_class;
> >>>>  /*
> >>>>   * irq_map_generic_chip - Map a generic chip for an irq domain
> >>>>   */
> >>>> -static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
> >>>> -				irq_hw_number_t hw_irq)
> >>>> +int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
> >>>> +			 irq_hw_number_t hw_irq)
> >>>>  {
> >>>>  	struct irq_data *data = irq_get_irq_data(virq);
> >>>>  	struct irq_domain_chip_generic *dgc = d->gc;
> >>>> @@ -394,6 +394,7 @@ static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
> >>>>  	irq_modify_status(virq, dgc->irq_flags_to_clear, dgc->irq_flags_to_set);
> >>>>  	return 0;
> >>>>  }
> >>>> +EXPORT_SYMBOL_GPL(irq_map_generic_chip);
> >>>>  
> >>>>  struct irq_domain_ops irq_generic_chip_ops = {
> >>>>  	.map	= irq_map_generic_chip,
> >>> Why can't you use irq_generic_chip_ops.map in your code and avoid this
> > s/code/declaration/, sorry for the misunderstanding.
> >
> >>> patch entirely?
> >> Because in this case I'll have to remove constness from my
> >> irq_domain_ops struct and initialize it in my init function.
> >> This is not a big concern, but in general I tend to declare ops struct
> >> with a const constraint.
> > /*
> >  * We're the only user of irq_map_generic_chip() who
> >  * doesn't also use irq_domain_xlate_onetwocell()
> >  */
> > static const struct irq_domain_ops aic_irq_ops = {
> > 	.map    = irq_generic_chip_ops.map,
> >         .xlate  = aic_irq_domain_xlate,
> > };
> >
> > Wouldn't work?
> 
> No, it fails  with :
> 
> "error: initializer element is not constant"

Gah!  Of course.  That's what I get for pseudo-coding without sufficient
coffee. :)

I won't have a chance to dig deeper into this until tonight or the next
few days.  But my primary concern is that they chose to export the
struct for a reason.  I'd like to dig through the history and find out
why.

Assuming there's no big reason not to export the function(s) directly,
I'm fine with exporting them.  But it would be nice to get Thomas' Ack
before I take the original patch since it touches core code.

thx,

Jason.
Boris BREZILLON June 23, 2014, 8:10 p.m. UTC | #6
On 23/06/2014 19:50, Jason Cooper wrote:
> On Mon, Jun 23, 2014 at 05:07:47PM +0200, Boris BREZILLON wrote:
>> On 23/06/2014 15:07, Jason Cooper wrote:
>>> On Sun, Jun 22, 2014 at 09:59:44AM +0200, Boris BREZILLON wrote:
>>>> On 22/06/2014 01:51, Jason Cooper wrote:
>>>>> On Fri, Jun 20, 2014 at 05:01:21PM +0200, Boris BREZILLON wrote:
>>>>>> Export the generic irq map function in order to provide irq_domain ops with
>>>>>> generic mapping and specific of xlate function (needed by the new atmel
>>>>>> AIC driver).
>>>>>>
>>>>>> Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
>>>>>> ---
>>>>>>  include/linux/irq.h       | 2 ++
>>>>>>  kernel/irq/generic-chip.c | 5 +++--
>>>>>>  2 files changed, 5 insertions(+), 2 deletions(-)
>>>>>>
>>>>>> diff --git a/include/linux/irq.h b/include/linux/irq.h
>>>>>> index 0d998d8..62af592 100644
>>>>>> --- a/include/linux/irq.h
>>>>>> +++ b/include/linux/irq.h
>>>>>> @@ -771,6 +771,8 @@ void irq_gc_eoi(struct irq_data *d);
>>>>>>  int irq_gc_set_wake(struct irq_data *d, unsigned int on);
>>>>>>  
>>>>>>  /* Setup functions for irq_chip_generic */
>>>>>> +int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
>>>>>> +			 irq_hw_number_t hw_irq);
>>>>>>  struct irq_chip_generic *
>>>>>>  irq_alloc_generic_chip(const char *name, int nr_ct, unsigned int irq_base,
>>>>>>  		       void __iomem *reg_base, irq_flow_handler_t handler);
>>>>>> diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c
>>>>>> index 452d6f2..cf80e7b 100644
>>>>>> --- a/kernel/irq/generic-chip.c
>>>>>> +++ b/kernel/irq/generic-chip.c
>>>>>> @@ -341,8 +341,8 @@ static struct lock_class_key irq_nested_lock_class;
>>>>>>  /*
>>>>>>   * irq_map_generic_chip - Map a generic chip for an irq domain
>>>>>>   */
>>>>>> -static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
>>>>>> -				irq_hw_number_t hw_irq)
>>>>>> +int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
>>>>>> +			 irq_hw_number_t hw_irq)
>>>>>>  {
>>>>>>  	struct irq_data *data = irq_get_irq_data(virq);
>>>>>>  	struct irq_domain_chip_generic *dgc = d->gc;
>>>>>> @@ -394,6 +394,7 @@ static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
>>>>>>  	irq_modify_status(virq, dgc->irq_flags_to_clear, dgc->irq_flags_to_set);
>>>>>>  	return 0;
>>>>>>  }
>>>>>> +EXPORT_SYMBOL_GPL(irq_map_generic_chip);
>>>>>>  
>>>>>>  struct irq_domain_ops irq_generic_chip_ops = {
>>>>>>  	.map	= irq_map_generic_chip,
>>>>> Why can't you use irq_generic_chip_ops.map in your code and avoid this
>>> s/code/declaration/, sorry for the misunderstanding.
>>>
>>>>> patch entirely?
>>>> Because in this case I'll have to remove constness from my
>>>> irq_domain_ops struct and initialize it in my init function.
>>>> This is not a big concern, but in general I tend to declare ops struct
>>>> with a const constraint.
>>> /*
>>>  * We're the only user of irq_map_generic_chip() who
>>>  * doesn't also use irq_domain_xlate_onetwocell()
>>>  */
>>> static const struct irq_domain_ops aic_irq_ops = {
>>> 	.map    = irq_generic_chip_ops.map,
>>>         .xlate  = aic_irq_domain_xlate,
>>> };
>>>
>>> Wouldn't work?
>> No, it fails  with :
>>
>> "error: initializer element is not constant"
> Gah!  Of course.  That's what I get for pseudo-coding without sufficient
> coffee. :)
>
> I won't have a chance to dig deeper into this until tonight or the next
> few days.  But my primary concern is that they chose to export the
> struct for a reason.  I'd like to dig through the history and find out
> why.

IMHO exporting both (the struct and the functions independently) makes
sense.
The struct can be used by drivers that have a standard behaviour for
both xslate and map functions, and functions (irq_map_generic_chip or
irq_domain_xlate_onetwocell) could be used when only one end of the
implementation is standard.

BTW, shouldn't we declare irq_generic_chip_ops as a const instance to
prevent users from modifying its content ?

>
> Assuming there's no big reason not to export the function(s) directly,
> I'm fine with exporting them.  But it would be nice to get Thomas' Ack
> before I take the original patch since it touches core code.

Sure.

Thanks for your help.

Best Regards,

Boris
Jason Cooper June 23, 2014, 10:14 p.m. UTC | #7
> On 23/06/2014 19:50, Jason Cooper wrote:
...
> > I won't have a chance to dig deeper into this until tonight or the next
> > few days.  But my primary concern is that they chose to export the
> > struct for a reason.  I'd like to dig through the history and find out
> > why.

Ok, I took a look.  It seems that was the most expedient way to
implement the linear domain registration.  No mention of avoiding
exporting the functions directly. :)

thx,

Jason.
Jason Cooper June 23, 2014, 10:17 p.m. UTC | #8
Thomas,

Would you mind Acking this and letting me know how you'd like me to
handle it?  It's a build requirement for the rest of the series, but
it's in core code.

I can do a separate topic branch for you or just merge it in with
irqchip/core.  Whichever is easiest for you.

On Fri, Jun 20, 2014 at 05:01:21PM +0200, Boris BREZILLON wrote:
> Export the generic irq map function in order to provide irq_domain ops with
> generic mapping and specific of xlate function (needed by the new atmel
> AIC driver).
> 
> Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
> ---
>  include/linux/irq.h       | 2 ++
>  kernel/irq/generic-chip.c | 5 +++--
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/include/linux/irq.h b/include/linux/irq.h
> index 0d998d8..62af592 100644
> --- a/include/linux/irq.h
> +++ b/include/linux/irq.h
> @@ -771,6 +771,8 @@ void irq_gc_eoi(struct irq_data *d);
>  int irq_gc_set_wake(struct irq_data *d, unsigned int on);
>  
>  /* Setup functions for irq_chip_generic */
> +int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
> +			 irq_hw_number_t hw_irq);
>  struct irq_chip_generic *
>  irq_alloc_generic_chip(const char *name, int nr_ct, unsigned int irq_base,
>  		       void __iomem *reg_base, irq_flow_handler_t handler);
> diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c
> index 452d6f2..cf80e7b 100644
> --- a/kernel/irq/generic-chip.c
> +++ b/kernel/irq/generic-chip.c
> @@ -341,8 +341,8 @@ static struct lock_class_key irq_nested_lock_class;
>  /*
>   * irq_map_generic_chip - Map a generic chip for an irq domain
>   */
> -static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
> -				irq_hw_number_t hw_irq)
> +int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
> +			 irq_hw_number_t hw_irq)
>  {
>  	struct irq_data *data = irq_get_irq_data(virq);
>  	struct irq_domain_chip_generic *dgc = d->gc;
> @@ -394,6 +394,7 @@ static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
>  	irq_modify_status(virq, dgc->irq_flags_to_clear, dgc->irq_flags_to_set);
>  	return 0;
>  }
> +EXPORT_SYMBOL_GPL(irq_map_generic_chip);
>  
>  struct irq_domain_ops irq_generic_chip_ops = {
>  	.map	= irq_map_generic_chip,
> -- 
> 1.8.3.2
> 

thx,

Jason.
Thomas Gleixner June 23, 2014, 10:40 p.m. UTC | #9
On Mon, 23 Jun 2014, Jason Cooper wrote:

> Thomas,
> 
> Would you mind Acking this and letting me know how you'd like me to
> handle it?  It's a build requirement for the rest of the series, but
> it's in core code.
> 
> I can do a separate topic branch for you or just merge it in with
> irqchip/core.  Whichever is easiest for you.

Just keep it in the series.

Acked-by: Thomas Gleixner <tglx@linutronix.de>
diff mbox

Patch

diff --git a/include/linux/irq.h b/include/linux/irq.h
index 0d998d8..62af592 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -771,6 +771,8 @@  void irq_gc_eoi(struct irq_data *d);
 int irq_gc_set_wake(struct irq_data *d, unsigned int on);
 
 /* Setup functions for irq_chip_generic */
+int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
+			 irq_hw_number_t hw_irq);
 struct irq_chip_generic *
 irq_alloc_generic_chip(const char *name, int nr_ct, unsigned int irq_base,
 		       void __iomem *reg_base, irq_flow_handler_t handler);
diff --git a/kernel/irq/generic-chip.c b/kernel/irq/generic-chip.c
index 452d6f2..cf80e7b 100644
--- a/kernel/irq/generic-chip.c
+++ b/kernel/irq/generic-chip.c
@@ -341,8 +341,8 @@  static struct lock_class_key irq_nested_lock_class;
 /*
  * irq_map_generic_chip - Map a generic chip for an irq domain
  */
-static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
-				irq_hw_number_t hw_irq)
+int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
+			 irq_hw_number_t hw_irq)
 {
 	struct irq_data *data = irq_get_irq_data(virq);
 	struct irq_domain_chip_generic *dgc = d->gc;
@@ -394,6 +394,7 @@  static int irq_map_generic_chip(struct irq_domain *d, unsigned int virq,
 	irq_modify_status(virq, dgc->irq_flags_to_clear, dgc->irq_flags_to_set);
 	return 0;
 }
+EXPORT_SYMBOL_GPL(irq_map_generic_chip);
 
 struct irq_domain_ops irq_generic_chip_ops = {
 	.map	= irq_map_generic_chip,