--- zzzz-none-000/linux-3.10.107/drivers/mfd/tc6393xb.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/mfd/tc6393xb.c 2021-02-04 17:41:59.000000000 +0000 @@ -522,10 +522,9 @@ /*--------------------------------------------------------------------------*/ -static void -tc6393xb_irq(unsigned int irq, struct irq_desc *desc) +static void tc6393xb_irq(struct irq_desc *desc) { - struct tc6393xb *tc6393xb = irq_get_handler_data(irq); + struct tc6393xb *tc6393xb = irq_desc_get_handler_data(desc); unsigned int isr; unsigned int i, irq_base; @@ -586,12 +585,12 @@ for (irq = irq_base; irq < irq_base + TC6393XB_NR_IRQS; irq++) { irq_set_chip_and_handler(irq, &tc6393xb_chip, handle_edge_irq); irq_set_chip_data(irq, tc6393xb); - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); + irq_clear_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); } irq_set_irq_type(tc6393xb->irq, IRQ_TYPE_EDGE_FALLING); - irq_set_handler_data(tc6393xb->irq, tc6393xb); - irq_set_chained_handler(tc6393xb->irq, tc6393xb_irq); + irq_set_chained_handler_and_data(tc6393xb->irq, tc6393xb_irq, + tc6393xb); } static void tc6393xb_detach_irq(struct platform_device *dev) @@ -599,13 +598,12 @@ struct tc6393xb *tc6393xb = platform_get_drvdata(dev); unsigned int irq, irq_base; - irq_set_chained_handler(tc6393xb->irq, NULL); - irq_set_handler_data(tc6393xb->irq, NULL); + irq_set_chained_handler_and_data(tc6393xb->irq, NULL, NULL); irq_base = tc6393xb->irq_base; for (irq = irq_base; irq < irq_base + TC6393XB_NR_IRQS; irq++) { - set_irq_flags(irq, 0); + irq_set_status_flags(irq, IRQ_NOREQUEST | IRQ_NOPROBE); irq_set_chip(irq, NULL); irq_set_chip_data(irq, NULL); } @@ -615,10 +613,10 @@ static int tc6393xb_probe(struct platform_device *dev) { - struct tc6393xb_platform_data *tcpd = dev->dev.platform_data; + struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev); struct tc6393xb *tc6393xb; struct resource *iomem, *rscr; - int ret, temp; + int ret; iomem = platform_get_resource(dev, IORESOURCE_MEM, 0); if (!iomem) @@ -665,7 +663,7 @@ goto err_ioremap; } - ret = clk_enable(tc6393xb->clk); + ret = clk_prepare_enable(tc6393xb->clk); if (ret) goto err_clk_enable; @@ -725,10 +723,10 @@ err_gpio_add: if (tc6393xb->gpio.base != -1) - temp = gpiochip_remove(&tc6393xb->gpio); + gpiochip_remove(&tc6393xb->gpio); tcpd->disable(dev); err_enable: - clk_disable(tc6393xb->clk); + clk_disable_unprepare(tc6393xb->clk); err_clk_enable: iounmap(tc6393xb->scr); err_ioremap: @@ -744,7 +742,7 @@ static int tc6393xb_remove(struct platform_device *dev) { - struct tc6393xb_platform_data *tcpd = dev->dev.platform_data; + struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev); struct tc6393xb *tc6393xb = platform_get_drvdata(dev); int ret; @@ -755,19 +753,13 @@ tc6393xb_detach_irq(dev); - if (tc6393xb->gpio.base != -1) { - ret = gpiochip_remove(&tc6393xb->gpio); - if (ret) { - dev_err(&dev->dev, "Can't remove gpio chip: %d\n", ret); - return ret; - } - } + if (tc6393xb->gpio.base != -1) + gpiochip_remove(&tc6393xb->gpio); ret = tcpd->disable(dev); - clk_disable(tc6393xb->clk); + clk_disable_unprepare(tc6393xb->clk); iounmap(tc6393xb->scr); release_resource(&tc6393xb->rscr); - platform_set_drvdata(dev, NULL); clk_put(tc6393xb->clk); kfree(tc6393xb); @@ -777,7 +769,7 @@ #ifdef CONFIG_PM static int tc6393xb_suspend(struct platform_device *dev, pm_message_t state) { - struct tc6393xb_platform_data *tcpd = dev->dev.platform_data; + struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev); struct tc6393xb *tc6393xb = platform_get_drvdata(dev); int i, ret; @@ -793,19 +785,19 @@ ioread8(tc6393xb->scr + SCR_GPI_BCR(i)); } ret = tcpd->suspend(dev); - clk_disable(tc6393xb->clk); + clk_disable_unprepare(tc6393xb->clk); return ret; } static int tc6393xb_resume(struct platform_device *dev) { - struct tc6393xb_platform_data *tcpd = dev->dev.platform_data; + struct tc6393xb_platform_data *tcpd = dev_get_platdata(&dev->dev); struct tc6393xb *tc6393xb = platform_get_drvdata(dev); int ret; int i; - clk_enable(tc6393xb->clk); + clk_prepare_enable(tc6393xb->clk); ret = tcpd->resume(dev); if (ret) @@ -848,7 +840,6 @@ .driver = { .name = "tc6393xb", - .owner = THIS_MODULE, }, };