--- zzzz-none-000/linux-3.10.107/drivers/mfd/sm501.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/mfd/sm501.c 2021-02-04 17:41:59.000000000 +0000 @@ -514,9 +514,9 @@ unsigned long mode = smc501_readl(sm->regs + SM501_POWER_MODE_CONTROL); unsigned long gate = smc501_readl(sm->regs + SM501_CURRENT_GATE); unsigned long clock = smc501_readl(sm->regs + SM501_CURRENT_CLOCK); - unsigned char reg; unsigned int pll_reg = 0; unsigned long sm501_freq; /* the actual frequency achieved */ + u64 reg; struct sm501_clock to; @@ -840,7 +840,7 @@ if (!pdev) return -ENOMEM; - uart_data = pdev->dev.platform_data; + uart_data = dev_get_platdata(&pdev->dev); if (devices & SM501_USE_UART0) { sm501_setup_uart_data(sm, uart_data++, 0x30000); @@ -1047,7 +1047,6 @@ struct sm501_gpio *gpio = &sm->gpio; resource_size_t iobase = sm->io_res->start + SM501_GPIO; int ret; - int tmp; dev_dbg(sm->dev, "registering gpio block %08llx\n", (unsigned long long)iobase); @@ -1086,11 +1085,7 @@ return 0; err_low_chip: - tmp = gpiochip_remove(&gpio->low.gpio); - if (tmp) { - dev_err(sm->dev, "cannot remove low chip, cannot tidy up\n"); - return ret; - } + gpiochip_remove(&gpio->low.gpio); err_mapped: iounmap(gpio->regs); @@ -1105,18 +1100,12 @@ static void sm501_gpio_remove(struct sm501_devdata *sm) { struct sm501_gpio *gpio = &sm->gpio; - int ret; if (!sm->gpio.registered) return; - ret = gpiochip_remove(&gpio->low.gpio); - if (ret) - dev_err(sm->dev, "cannot remove low chip, cannot tidy up\n"); - - ret = gpiochip_remove(&gpio->high.gpio); - if (ret) - dev_err(sm->dev, "cannot remove high chip, cannot tidy up\n"); + gpiochip_remove(&gpio->low.gpio); + gpiochip_remove(&gpio->high.gpio); iounmap(gpio->regs); release_resource(gpio->regs_res); @@ -1167,7 +1156,7 @@ if (!pdev) return -ENOMEM; - icd = pdev->dev.platform_data; + icd = dev_get_platdata(&pdev->dev); /* We keep the pin_sda and pin_scl fields relative in case the * same platform data is passed to >1 SM501. @@ -1403,7 +1392,7 @@ sm->dev = &dev->dev; sm->pdev_id = dev->id; - sm->platdata = dev->dev.platform_data; + sm->platdata = dev_get_platdata(&dev->dev); ret = platform_get_irq(dev, 0); if (ret < 0) { @@ -1660,7 +1649,6 @@ err3: pci_disable_device(dev); err2: - pci_set_drvdata(dev, NULL); kfree(sm); err1: return err; @@ -1695,7 +1683,6 @@ release_resource(sm->regs_claim); kfree(sm->regs_claim); - pci_set_drvdata(dev, NULL); pci_disable_device(dev); } @@ -1712,7 +1699,7 @@ return 0; } -static DEFINE_PCI_DEVICE_TABLE(sm501_pci_tbl) = { +static const struct pci_device_id sm501_pci_tbl[] = { { 0x126f, 0x0501, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { 0, }, }; @@ -1728,15 +1715,15 @@ MODULE_ALIAS("platform:sm501"); -static struct of_device_id of_sm501_match_tbl[] = { +static const struct of_device_id of_sm501_match_tbl[] = { { .compatible = "smi,sm501", }, { /* end */ } }; +MODULE_DEVICE_TABLE(of, of_sm501_match_tbl); static struct platform_driver sm501_plat_driver = { .driver = { .name = "sm501", - .owner = THIS_MODULE, .of_match_table = of_sm501_match_tbl, }, .probe = sm501_plat_probe,