staging: kpc2000: fix resource size calculation
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 30 Apr 2019 10:33:59 +0000 (13:33 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Apr 2019 12:19:04 +0000 (14:19 +0200)
commitf998a1180e14d0a10d2ffeccec25779ace879c2a
tree986c349f59e3259c109f790d10b67cde5866be77
parentd687bdefba270c11df0234b3285cd50d60de284b
staging: kpc2000: fix resource size calculation

The code is calculating the resource size wrong because it should be
inclusive of the "res->end" address.  In other words, "end - start + 1".
We can just use the resource_size() function to do it correctly.

Fixes: 7dc7967fc39a ("staging: kpc2000: add initial set of Daktronics drivers")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/kpc2000/kpc_i2c/i2c_driver.c
drivers/staging/kpc2000/kpc_spi/spi_driver.c