--- zzzz-none-000/linux-3.10.107/drivers/mfd/t7l66xb.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/mfd/t7l66xb.c 2021-02-04 17:41:59.000000000 +0000 @@ -87,7 +87,7 @@ unsigned long flags; u8 dev_ctl; - clk_enable(t7l66xb->clk32k); + clk_prepare_enable(t7l66xb->clk32k); spin_lock_irqsave(&t7l66xb->lock, flags); @@ -118,7 +118,7 @@ spin_unlock_irqrestore(&t7l66xb->lock, flags); - clk_disable(t7l66xb->clk32k); + clk_disable_unprepare(t7l66xb->clk32k); return 0; } @@ -185,9 +185,9 @@ /*--------------------------------------------------------------------------*/ /* Handle the T7L66XB interrupt mux */ -static void t7l66xb_irq(unsigned int irq, struct irq_desc *desc) +static void t7l66xb_irq(struct irq_desc *desc) { - struct t7l66xb *t7l66xb = irq_get_handler_data(irq); + struct t7l66xb *t7l66xb = irq_desc_get_handler_data(desc); unsigned int isr; unsigned int i, irq_base; @@ -246,14 +246,10 @@ for (irq = irq_base; irq < irq_base + T7L66XB_NR_IRQS; irq++) { irq_set_chip_and_handler(irq, &t7l66xb_chip, handle_level_irq); irq_set_chip_data(irq, t7l66xb); -#ifdef CONFIG_ARM - set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); -#endif } irq_set_irq_type(t7l66xb->irq, IRQ_TYPE_EDGE_FALLING); - irq_set_handler_data(t7l66xb->irq, t7l66xb); - irq_set_chained_handler(t7l66xb->irq, t7l66xb_irq); + irq_set_chained_handler_and_data(t7l66xb->irq, t7l66xb_irq, t7l66xb); } static void t7l66xb_detach_irq(struct platform_device *dev) @@ -263,13 +259,9 @@ irq_base = t7l66xb->irq_base; - irq_set_chained_handler(t7l66xb->irq, NULL); - irq_set_handler_data(t7l66xb->irq, NULL); + irq_set_chained_handler_and_data(t7l66xb->irq, NULL, NULL); for (irq = irq_base; irq < irq_base + T7L66XB_NR_IRQS; irq++) { -#ifdef CONFIG_ARM - set_irq_flags(irq, 0); -#endif irq_set_chip(irq, NULL); irq_set_chip_data(irq, NULL); } @@ -281,11 +273,11 @@ static int t7l66xb_suspend(struct platform_device *dev, pm_message_t state) { struct t7l66xb *t7l66xb = platform_get_drvdata(dev); - struct t7l66xb_platform_data *pdata = dev->dev.platform_data; + struct t7l66xb_platform_data *pdata = dev_get_platdata(&dev->dev); if (pdata && pdata->suspend) pdata->suspend(dev); - clk_disable(t7l66xb->clk48m); + clk_disable_unprepare(t7l66xb->clk48m); return 0; } @@ -293,9 +285,9 @@ static int t7l66xb_resume(struct platform_device *dev) { struct t7l66xb *t7l66xb = platform_get_drvdata(dev); - struct t7l66xb_platform_data *pdata = dev->dev.platform_data; + struct t7l66xb_platform_data *pdata = dev_get_platdata(&dev->dev); - clk_enable(t7l66xb->clk48m); + clk_prepare_enable(t7l66xb->clk48m); if (pdata && pdata->resume) pdata->resume(dev); @@ -313,12 +305,12 @@ static int t7l66xb_probe(struct platform_device *dev) { - struct t7l66xb_platform_data *pdata = dev->dev.platform_data; + struct t7l66xb_platform_data *pdata = dev_get_platdata(&dev->dev); struct t7l66xb *t7l66xb; struct resource *iomem, *rscr; int ret; - if (pdata == NULL) + if (!pdata) return -EINVAL; iomem = platform_get_resource(dev, IORESOURCE_MEM, 0); @@ -369,9 +361,9 @@ goto err_ioremap; } - clk_enable(t7l66xb->clk48m); + clk_prepare_enable(t7l66xb->clk48m); - if (pdata && pdata->enable) + if (pdata->enable) pdata->enable(dev); /* Mask all interrupts */ @@ -409,20 +401,19 @@ static int t7l66xb_remove(struct platform_device *dev) { - struct t7l66xb_platform_data *pdata = dev->dev.platform_data; + struct t7l66xb_platform_data *pdata = dev_get_platdata(&dev->dev); struct t7l66xb *t7l66xb = platform_get_drvdata(dev); int ret; ret = pdata->disable(dev); - clk_disable(t7l66xb->clk48m); + clk_disable_unprepare(t7l66xb->clk48m); clk_put(t7l66xb->clk48m); - clk_disable(t7l66xb->clk32k); + clk_disable_unprepare(t7l66xb->clk32k); clk_put(t7l66xb->clk32k); t7l66xb_detach_irq(dev); iounmap(t7l66xb->scr); release_resource(&t7l66xb->rscr); mfd_remove_devices(&dev->dev); - platform_set_drvdata(dev, NULL); kfree(t7l66xb); return ret; @@ -432,7 +423,6 @@ static struct platform_driver t7l66xb_platform_driver = { .driver = { .name = "t7l66xb", - .owner = THIS_MODULE, }, .suspend = t7l66xb_suspend, .resume = t7l66xb_resume,