--- zzzz-none-000/linux-3.10.107/drivers/sbus/char/display7seg.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/sbus/char/display7seg.c 2021-02-04 17:41:59.000000000 +0000 @@ -4,12 +4,12 @@ * Copyright (c) 2000 Eric Brower (ebrower@usa.net) */ +#include #include #include #include #include #include -#include #include #include /* request_region */ #include @@ -144,10 +144,7 @@ case D7SIOCTM: /* toggle device mode-- flip display orientation */ - if (regs & D7S_FLIP) - regs &= ~D7S_FLIP; - else - regs |= D7S_FLIP; + regs ^= D7S_FLIP; writeb(regs, p->regs); break; } @@ -181,7 +178,7 @@ if (d7s_device) goto out; - p = kzalloc(sizeof(*p), GFP_KERNEL); + p = devm_kzalloc(&op->dev, sizeof(*p), GFP_KERNEL); err = -ENOMEM; if (!p) goto out; @@ -232,7 +229,6 @@ of_iounmap(&op->resource[0], p->regs, sizeof(u8)); out_free: - kfree(p); goto out; } @@ -252,7 +248,6 @@ misc_deregister(&d7s_miscdev); of_iounmap(&op->resource[0], p->regs, sizeof(u8)); - kfree(p); return 0; } @@ -268,7 +263,6 @@ static struct platform_driver d7s_driver = { .driver = { .name = DRIVER_NAME, - .owner = THIS_MODULE, .of_match_table = d7s_match, }, .probe = d7s_probe,