@@ -608,8 +608,8 @@ static int __maybe_unused nmk_prcm_gpiocr_get_mode(struct pinctrl_dev *pctldev,
608
608
609
609
static void nmk_gpio_irq_ack (struct irq_data * d )
610
610
{
611
- struct gpio_chip * chip = irq_data_get_irq_chip_data (d );
612
- struct nmk_gpio_chip * nmk_chip = gpiochip_get_data (chip );
611
+ struct gpio_chip * gc = irq_data_get_irq_chip_data (d );
612
+ struct nmk_gpio_chip * nmk_chip = gpiochip_get_data (gc );
613
613
614
614
clk_enable (nmk_chip -> clk );
615
615
writel (BIT (d -> hwirq ), nmk_chip -> addr + NMK_GPIO_IC );
@@ -677,13 +677,10 @@ static void __nmk_gpio_set_wake(struct nmk_gpio_chip *nmk_chip,
677
677
678
678
static int nmk_gpio_irq_maskunmask (struct irq_data * d , bool enable )
679
679
{
680
- struct nmk_gpio_chip * nmk_chip ;
680
+ struct gpio_chip * gc = irq_data_get_irq_chip_data (d );
681
+ struct nmk_gpio_chip * nmk_chip = gpiochip_get_data (gc );
681
682
unsigned long flags ;
682
683
683
- nmk_chip = irq_data_get_irq_chip_data (d );
684
- if (!nmk_chip )
685
- return - EINVAL ;
686
-
687
684
clk_enable (nmk_chip -> clk );
688
685
spin_lock_irqsave (& nmk_gpio_slpm_lock , flags );
689
686
spin_lock (& nmk_chip -> lock );
@@ -712,13 +709,10 @@ static void nmk_gpio_irq_unmask(struct irq_data *d)
712
709
713
710
static int nmk_gpio_irq_set_wake (struct irq_data * d , unsigned int on )
714
711
{
715
- struct nmk_gpio_chip * nmk_chip ;
712
+ struct gpio_chip * gc = irq_data_get_irq_chip_data (d );
713
+ struct nmk_gpio_chip * nmk_chip = gpiochip_get_data (gc );
716
714
unsigned long flags ;
717
715
718
- nmk_chip = irq_data_get_irq_chip_data (d );
719
- if (!nmk_chip )
720
- return - EINVAL ;
721
-
722
716
clk_enable (nmk_chip -> clk );
723
717
spin_lock_irqsave (& nmk_gpio_slpm_lock , flags );
724
718
spin_lock (& nmk_chip -> lock );
@@ -740,14 +734,12 @@ static int nmk_gpio_irq_set_wake(struct irq_data *d, unsigned int on)
740
734
741
735
static int nmk_gpio_irq_set_type (struct irq_data * d , unsigned int type )
742
736
{
737
+ struct gpio_chip * gc = irq_data_get_irq_chip_data (d );
738
+ struct nmk_gpio_chip * nmk_chip = gpiochip_get_data (gc );
743
739
bool enabled = !irqd_irq_disabled (d );
744
740
bool wake = irqd_is_wakeup_set (d );
745
- struct nmk_gpio_chip * nmk_chip ;
746
741
unsigned long flags ;
747
742
748
- nmk_chip = irq_data_get_irq_chip_data (d );
749
- if (!nmk_chip )
750
- return - EINVAL ;
751
743
if (type & IRQ_TYPE_LEVEL_HIGH )
752
744
return - EINVAL ;
753
745
if (type & IRQ_TYPE_LEVEL_LOW )
@@ -784,7 +776,8 @@ static int nmk_gpio_irq_set_type(struct irq_data *d, unsigned int type)
784
776
785
777
static unsigned int nmk_gpio_irq_startup (struct irq_data * d )
786
778
{
787
- struct nmk_gpio_chip * nmk_chip = irq_data_get_irq_chip_data (d );
779
+ struct gpio_chip * gc = irq_data_get_irq_chip_data (d );
780
+ struct nmk_gpio_chip * nmk_chip = gpiochip_get_data (gc );
788
781
789
782
clk_enable (nmk_chip -> clk );
790
783
nmk_gpio_irq_unmask (d );
@@ -793,7 +786,8 @@ static unsigned int nmk_gpio_irq_startup(struct irq_data *d)
793
786
794
787
static void nmk_gpio_irq_shutdown (struct irq_data * d )
795
788
{
796
- struct nmk_gpio_chip * nmk_chip = irq_data_get_irq_chip_data (d );
789
+ struct gpio_chip * gc = irq_data_get_irq_chip_data (d );
790
+ struct nmk_gpio_chip * nmk_chip = gpiochip_get_data (gc );
797
791
798
792
nmk_gpio_irq_mask (d );
799
793
clk_disable (nmk_chip -> clk );
0 commit comments