@@ -142,7 +142,6 @@ enum soc_type {
142142 * @base_second: base address of the common registers of the TMU controller.
143143 * @irq: irq number of the TMU controller.
144144 * @soc: id of the SOC type.
145- * @irq_work: pointer to the irq work structure.
146145 * @lock: lock to implement synchronization.
147146 * @clk: pointer to the clock structure.
148147 * @clk_sec: pointer to the clock structure for accessing the base_second.
@@ -175,7 +174,6 @@ struct exynos_tmu_data {
175174 void __iomem * base_second ;
176175 int irq ;
177176 enum soc_type soc ;
178- struct work_struct irq_work ;
179177 struct mutex lock ;
180178 struct clk * clk , * clk_sec , * sclk ;
181179 u32 cal_type ;
@@ -763,10 +761,9 @@ static int exynos7_tmu_read(struct exynos_tmu_data *data)
763761 EXYNOS7_TMU_TEMP_MASK ;
764762}
765763
766- static void exynos_tmu_work ( struct work_struct * work )
764+ static irqreturn_t exynos_tmu_threaded_irq ( int irq , void * id )
767765{
768- struct exynos_tmu_data * data = container_of (work ,
769- struct exynos_tmu_data , irq_work );
766+ struct exynos_tmu_data * data = id ;
770767
771768 thermal_zone_device_update (data -> tzd , THERMAL_EVENT_UNSPECIFIED );
772769
@@ -778,7 +775,8 @@ static void exynos_tmu_work(struct work_struct *work)
778775
779776 clk_disable (data -> clk );
780777 mutex_unlock (& data -> lock );
781- enable_irq (data -> irq );
778+
779+ return IRQ_HANDLED ;
782780}
783781
784782static void exynos4210_tmu_clear_irqs (struct exynos_tmu_data * data )
@@ -812,16 +810,6 @@ static void exynos4210_tmu_clear_irqs(struct exynos_tmu_data *data)
812810 writel (val_irq , data -> base + tmu_intclear );
813811}
814812
815- static irqreturn_t exynos_tmu_irq (int irq , void * id )
816- {
817- struct exynos_tmu_data * data = id ;
818-
819- disable_irq_nosync (irq );
820- schedule_work (& data -> irq_work );
821-
822- return IRQ_HANDLED ;
823- }
824-
825813static const struct of_device_id exynos_tmu_match [] = {
826814 {
827815 .compatible = "samsung,exynos3250-tmu" ,
@@ -1023,8 +1011,6 @@ static int exynos_tmu_probe(struct platform_device *pdev)
10231011 if (ret )
10241012 goto err_sensor ;
10251013
1026- INIT_WORK (& data -> irq_work , exynos_tmu_work );
1027-
10281014 data -> clk = devm_clk_get (& pdev -> dev , "tmu_apbif" );
10291015 if (IS_ERR (data -> clk )) {
10301016 dev_err (& pdev -> dev , "Failed to get clock\n" );
@@ -1093,8 +1079,11 @@ static int exynos_tmu_probe(struct platform_device *pdev)
10931079 goto err_sclk ;
10941080 }
10951081
1096- ret = devm_request_irq (& pdev -> dev , data -> irq , exynos_tmu_irq ,
1097- IRQF_TRIGGER_RISING | IRQF_SHARED , dev_name (& pdev -> dev ), data );
1082+ ret = devm_request_threaded_irq (& pdev -> dev , data -> irq , NULL ,
1083+ exynos_tmu_threaded_irq ,
1084+ IRQF_TRIGGER_RISING
1085+ | IRQF_SHARED | IRQF_ONESHOT ,
1086+ dev_name (& pdev -> dev ), data );
10981087 if (ret ) {
10991088 dev_err (& pdev -> dev , "Failed to request irq: %d\n" , data -> irq );
11001089 goto err_sclk ;
0 commit comments