@@ -317,7 +317,7 @@ int xmon_xive_get_irq_config(u32 hw_irq, struct irq_data *d)
317317 if (d ) {
318318 char buffer [128 ];
319319
320- xive_irq_data_dump (irq_data_get_irq_handler_data (d ),
320+ xive_irq_data_dump (irq_data_get_irq_chip_data (d ),
321321 buffer , sizeof (buffer ));
322322 xmon_printf ("%s" , buffer );
323323 }
@@ -437,7 +437,7 @@ static void xive_do_source_eoi(struct xive_irq_data *xd)
437437/* irq_chip eoi callback, called with irq descriptor lock held */
438438static void xive_irq_eoi (struct irq_data * d )
439439{
440- struct xive_irq_data * xd = irq_data_get_irq_handler_data (d );
440+ struct xive_irq_data * xd = irq_data_get_irq_chip_data (d );
441441 struct xive_cpu * xc = __this_cpu_read (xive_cpu );
442442
443443 DBG_VERBOSE ("eoi_irq: irq=%d [0x%lx] pending=%02x\n" ,
@@ -595,7 +595,7 @@ static int xive_pick_irq_target(struct irq_data *d,
595595 const struct cpumask * affinity )
596596{
597597 static unsigned int fuzz ;
598- struct xive_irq_data * xd = irq_data_get_irq_handler_data (d );
598+ struct xive_irq_data * xd = irq_data_get_irq_chip_data (d );
599599 cpumask_var_t mask ;
600600 int cpu = -1 ;
601601
@@ -628,7 +628,7 @@ static int xive_pick_irq_target(struct irq_data *d,
628628
629629static unsigned int xive_irq_startup (struct irq_data * d )
630630{
631- struct xive_irq_data * xd = irq_data_get_irq_handler_data (d );
631+ struct xive_irq_data * xd = irq_data_get_irq_chip_data (d );
632632 unsigned int hw_irq = (unsigned int )irqd_to_hwirq (d );
633633 int target , rc ;
634634
@@ -673,7 +673,7 @@ static unsigned int xive_irq_startup(struct irq_data *d)
673673/* called with irq descriptor lock held */
674674static void xive_irq_shutdown (struct irq_data * d )
675675{
676- struct xive_irq_data * xd = irq_data_get_irq_handler_data (d );
676+ struct xive_irq_data * xd = irq_data_get_irq_chip_data (d );
677677 unsigned int hw_irq = (unsigned int )irqd_to_hwirq (d );
678678
679679 pr_debug ("%s: irq %d [0x%x] data @%p\n" , __func__ , d -> irq , hw_irq , d );
@@ -698,7 +698,7 @@ static void xive_irq_shutdown(struct irq_data *d)
698698
699699static void xive_irq_unmask (struct irq_data * d )
700700{
701- struct xive_irq_data * xd = irq_data_get_irq_handler_data (d );
701+ struct xive_irq_data * xd = irq_data_get_irq_chip_data (d );
702702
703703 pr_debug ("%s: irq %d data @%p\n" , __func__ , d -> irq , xd );
704704
@@ -707,7 +707,7 @@ static void xive_irq_unmask(struct irq_data *d)
707707
708708static void xive_irq_mask (struct irq_data * d )
709709{
710- struct xive_irq_data * xd = irq_data_get_irq_handler_data (d );
710+ struct xive_irq_data * xd = irq_data_get_irq_chip_data (d );
711711
712712 pr_debug ("%s: irq %d data @%p\n" , __func__ , d -> irq , xd );
713713
@@ -718,7 +718,7 @@ static int xive_irq_set_affinity(struct irq_data *d,
718718 const struct cpumask * cpumask ,
719719 bool force )
720720{
721- struct xive_irq_data * xd = irq_data_get_irq_handler_data (d );
721+ struct xive_irq_data * xd = irq_data_get_irq_chip_data (d );
722722 unsigned int hw_irq = (unsigned int )irqd_to_hwirq (d );
723723 u32 target , old_target ;
724724 int rc = 0 ;
@@ -776,7 +776,7 @@ static int xive_irq_set_affinity(struct irq_data *d,
776776
777777static int xive_irq_set_type (struct irq_data * d , unsigned int flow_type )
778778{
779- struct xive_irq_data * xd = irq_data_get_irq_handler_data (d );
779+ struct xive_irq_data * xd = irq_data_get_irq_chip_data (d );
780780
781781 /*
782782 * We only support these. This has really no effect other than setting
@@ -815,7 +815,7 @@ static int xive_irq_set_type(struct irq_data *d, unsigned int flow_type)
815815
816816static int xive_irq_retrigger (struct irq_data * d )
817817{
818- struct xive_irq_data * xd = irq_data_get_irq_handler_data (d );
818+ struct xive_irq_data * xd = irq_data_get_irq_chip_data (d );
819819
820820 /* This should be only for MSIs */
821821 if (WARN_ON (xd -> flags & XIVE_IRQ_FLAG_LSI ))
@@ -837,7 +837,7 @@ static int xive_irq_retrigger(struct irq_data *d)
837837 */
838838static int xive_irq_set_vcpu_affinity (struct irq_data * d , void * state )
839839{
840- struct xive_irq_data * xd = irq_data_get_irq_handler_data (d );
840+ struct xive_irq_data * xd = irq_data_get_irq_chip_data (d );
841841 unsigned int hw_irq = (unsigned int )irqd_to_hwirq (d );
842842 int rc ;
843843 u8 pq ;
@@ -951,7 +951,7 @@ static int xive_irq_set_vcpu_affinity(struct irq_data *d, void *state)
951951static int xive_get_irqchip_state (struct irq_data * data ,
952952 enum irqchip_irq_state which , bool * state )
953953{
954- struct xive_irq_data * xd = irq_data_get_irq_handler_data (data );
954+ struct xive_irq_data * xd = irq_data_get_irq_chip_data (data );
955955 u8 pq ;
956956
957957 switch (which ) {
@@ -1011,21 +1011,20 @@ void xive_cleanup_irq_data(struct xive_irq_data *xd)
10111011}
10121012EXPORT_SYMBOL_GPL (xive_cleanup_irq_data );
10131013
1014- static int xive_irq_alloc_data (unsigned int virq , irq_hw_number_t hw )
1014+ static struct xive_irq_data * xive_irq_alloc_data (unsigned int virq , irq_hw_number_t hw )
10151015{
10161016 struct xive_irq_data * xd ;
10171017 int rc ;
10181018
10191019 xd = kzalloc (sizeof (struct xive_irq_data ), GFP_KERNEL );
10201020 if (!xd )
1021- return - ENOMEM ;
1021+ return ERR_PTR ( - ENOMEM ) ;
10221022 rc = xive_ops -> populate_irq_data (hw , xd );
10231023 if (rc ) {
10241024 kfree (xd );
1025- return rc ;
1025+ return ERR_PTR ( rc ) ;
10261026 }
10271027 xd -> target = XIVE_INVALID_TARGET ;
1028- irq_set_handler_data (virq , xd );
10291028
10301029 /*
10311030 * Turn OFF by default the interrupt being mapped. A side
@@ -1036,20 +1035,19 @@ static int xive_irq_alloc_data(unsigned int virq, irq_hw_number_t hw)
10361035 */
10371036 xive_esb_read (xd , XIVE_ESB_SET_PQ_01 );
10381037
1039- return 0 ;
1038+ return xd ;
10401039}
10411040
1042- void xive_irq_free_data (unsigned int virq )
1041+ static void xive_irq_free_data (unsigned int virq )
10431042{
1044- struct xive_irq_data * xd = irq_get_handler_data (virq );
1043+ struct xive_irq_data * xd = irq_get_chip_data (virq );
10451044
10461045 if (!xd )
10471046 return ;
1048- irq_set_handler_data (virq , NULL );
1047+ irq_set_chip_data (virq , NULL );
10491048 xive_cleanup_irq_data (xd );
10501049 kfree (xd );
10511050}
1052- EXPORT_SYMBOL_GPL (xive_irq_free_data );
10531051
10541052#ifdef CONFIG_SMP
10551053
@@ -1286,19 +1284,20 @@ void __init xive_smp_probe(void)
12861284static int xive_irq_domain_map (struct irq_domain * h , unsigned int virq ,
12871285 irq_hw_number_t hw )
12881286{
1289- int rc ;
1287+ struct xive_irq_data * xd ;
12901288
12911289 /*
12921290 * Mark interrupts as edge sensitive by default so that resend
12931291 * actually works. Will fix that up below if needed.
12941292 */
12951293 irq_clear_status_flags (virq , IRQ_LEVEL );
12961294
1297- rc = xive_irq_alloc_data (virq , hw );
1298- if (rc )
1299- return rc ;
1295+ xd = xive_irq_alloc_data (virq , hw );
1296+ if (IS_ERR ( xd ) )
1297+ return PTR_ERR ( xd ) ;
13001298
13011299 irq_set_chip_and_handler (virq , & xive_irq_chip , handle_fasteoi_irq );
1300+ irq_set_chip_data (virq , xd );
13021301
13031302 return 0 ;
13041303}
@@ -1366,7 +1365,7 @@ static void xive_irq_domain_debug_show(struct seq_file *m, struct irq_domain *d,
13661365 seq_printf (m , "%*sXIVE:\n" , ind , "" );
13671366 ind ++ ;
13681367
1369- xd = irq_data_get_irq_handler_data (irqd );
1368+ xd = irq_data_get_irq_chip_data (irqd );
13701369 if (!xd ) {
13711370 seq_printf (m , "%*snot assigned\n" , ind , "" );
13721371 return ;
@@ -1403,6 +1402,7 @@ static int xive_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
14031402 unsigned int nr_irqs , void * arg )
14041403{
14051404 struct irq_fwspec * fwspec = arg ;
1405+ struct xive_irq_data * xd ;
14061406 irq_hw_number_t hwirq ;
14071407 unsigned int type = IRQ_TYPE_NONE ;
14081408 int i , rc ;
@@ -1423,12 +1423,11 @@ static int xive_irq_domain_alloc(struct irq_domain *domain, unsigned int virq,
14231423 irq_clear_status_flags (virq , IRQ_LEVEL );
14241424
14251425 /* allocates and sets handler data */
1426- rc = xive_irq_alloc_data (virq + i , hwirq + i );
1427- if (rc )
1428- return rc ;
1426+ xd = xive_irq_alloc_data (virq + i , hwirq + i );
1427+ if (IS_ERR ( xd ) )
1428+ return PTR_ERR ( xd ) ;
14291429
1430- irq_domain_set_hwirq_and_chip (domain , virq + i , hwirq + i ,
1431- & xive_irq_chip , domain -> host_data );
1430+ irq_domain_set_hwirq_and_chip (domain , virq + i , hwirq + i , & xive_irq_chip , xd );
14321431 irq_set_handler (virq + i , handle_fasteoi_irq );
14331432 }
14341433
@@ -1764,7 +1763,7 @@ static void xive_debug_show_irq(struct seq_file *m, struct irq_data *d)
17641763 seq_printf (m , "IRQ 0x%08x : target=0x%x prio=%02x lirq=0x%x " ,
17651764 hw_irq , target , prio , lirq );
17661765
1767- xive_irq_data_dump (irq_data_get_irq_handler_data (d ), buffer , sizeof (buffer ));
1766+ xive_irq_data_dump (irq_data_get_irq_chip_data (d ), buffer , sizeof (buffer ));
17681767 seq_puts (m , buffer );
17691768 seq_puts (m , "\n" );
17701769}
0 commit comments