--- zzzz-none-000/linux-3.10.107/drivers/mfd/jz4740-adc.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/mfd/jz4740-adc.c 2021-02-04 17:41:59.000000000 +0000 @@ -65,7 +65,7 @@ spinlock_t lock; }; -static void jz4740_adc_irq_demux(unsigned int irq, struct irq_desc *desc) +static void jz4740_adc_irq_demux(struct irq_desc *desc) { struct irq_chip_generic *gc = irq_desc_get_handler_data(desc); uint8_t status; @@ -86,13 +86,13 @@ static inline void jz4740_adc_clk_enable(struct jz4740_adc *adc) { if (atomic_inc_return(&adc->clk_ref) == 1) - clk_enable(adc->clk); + clk_prepare_enable(adc->clk); } static inline void jz4740_adc_clk_disable(struct jz4740_adc *adc) { if (atomic_dec_return(&adc->clk_ref) == 0) - clk_disable(adc->clk); + clk_disable_unprepare(adc->clk); } static inline void jz4740_adc_set_enabled(struct jz4740_adc *adc, int engine, @@ -181,7 +181,7 @@ }, }; -static struct mfd_cell jz4740_adc_cells[] = { +static const struct mfd_cell jz4740_adc_cells[] = { { .id = 0, .name = "jz4740-hwmon", @@ -273,12 +273,12 @@ ct->chip.irq_unmask = irq_gc_mask_clr_bit; ct->chip.irq_ack = irq_gc_ack_set_bit; - irq_setup_generic_chip(gc, IRQ_MSK(5), 0, 0, IRQ_NOPROBE | IRQ_LEVEL); + irq_setup_generic_chip(gc, IRQ_MSK(5), IRQ_GC_INIT_MASK_CACHE, 0, + IRQ_NOPROBE | IRQ_LEVEL); adc->gc = gc; - irq_set_handler_data(adc->irq, gc); - irq_set_chained_handler(adc->irq, jz4740_adc_irq_demux); + irq_set_chained_handler_and_data(adc->irq, jz4740_adc_irq_demux, gc); writeb(0x00, adc->base + JZ_REG_ADC_ENABLE); writeb(0xff, adc->base + JZ_REG_ADC_CTRL); @@ -294,7 +294,6 @@ err_clk_put: clk_put(adc->clk); err_iounmap: - platform_set_drvdata(pdev, NULL); iounmap(adc->base); err_release_mem_region: release_mem_region(adc->mem->start, resource_size(adc->mem)); @@ -309,16 +308,13 @@ irq_remove_generic_chip(adc->gc, IRQ_MSK(5), IRQ_NOPROBE | IRQ_LEVEL, 0); kfree(adc->gc); - irq_set_handler_data(adc->irq, NULL); - irq_set_chained_handler(adc->irq, NULL); + irq_set_chained_handler_and_data(adc->irq, NULL, NULL); iounmap(adc->base); release_mem_region(adc->mem->start, resource_size(adc->mem)); clk_put(adc->clk); - platform_set_drvdata(pdev, NULL); - return 0; } @@ -327,7 +323,6 @@ .remove = jz4740_adc_remove, .driver = { .name = "jz4740-adc", - .owner = THIS_MODULE, }, };