Skip to content

Commit

Permalink
gpio: ws16c48: Fix off-by-one error in WS16C48 resource region extent
Browse files Browse the repository at this point in the history
commit 33f83d1 upstream.

The WinSystems WS16C48 I/O address region spans offsets 0x0 through 0xA,
which is a total of 11 bytes. Fix the WS16C48_EXTENT define to the
correct value of 11 so that access to necessary device registers is
properly requested in the ws16c48_probe() callback by the
devm_request_region() function call.

Fixes: 2c05a0f ("gpio: ws16c48: Implement and utilize register structures")
Cc: stable@vger.kernel.org
Cc: Paul Demetrotion <pdemetrotion@winsystems.com>
Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
vilhelmgray authored and gregkh committed Aug 16, 2023
1 parent 5e17b8e commit 227bd2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpio/gpio-ws16c48.c
Expand Up @@ -18,7 +18,7 @@
#include <linux/spinlock.h>
#include <linux/types.h>

#define WS16C48_EXTENT 10
#define WS16C48_EXTENT 11
#define MAX_NUM_WS16C48 max_num_isa_dev(WS16C48_EXTENT)

static unsigned int base[MAX_NUM_WS16C48];
Expand Down

0 comments on commit 227bd2c

Please sign in to comment.