summaryrefslogtreecommitdiffstats
path: root/drivers/input/rmi4/rmi_f30.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-10-30 14:10:01 +0900
committerDavid S. Miller <davem@davemloft.net>2017-10-30 21:09:24 +0900
commite1ea2f9856b765a2eaabb403a6751f70efc9ba4c (patch)
tree771f0f96fdab1b27757730e96d911c73f5499ee4 /drivers/input/rmi4/rmi_f30.c
parentaad93c70b9a3b80dbc383a31e77a119f69bdd856 (diff)
parent0b07194bb55ed836c2cc7c22e866b87a14681984 (diff)
downloadop-kernel-dev-e1ea2f9856b765a2eaabb403a6751f70efc9ba4c.zip
op-kernel-dev-e1ea2f9856b765a2eaabb403a6751f70efc9ba4c.tar.gz
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Several conflicts here. NFP driver bug fix adding nfp_netdev_is_nfp_repr() check to nfp_fl_output() needed some adjustments because the code block is in an else block now. Parallel additions to net/pkt_cls.h and net/sch_generic.h A bug fix in __tcp_retransmit_skb() conflicted with some of the rbtree changes in net-next. The tc action RCU callback fixes in 'net' had some overlap with some of the recent tcf_block reworking. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/input/rmi4/rmi_f30.c')
-rw-r--r--drivers/input/rmi4/rmi_f30.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/input/rmi4/rmi_f30.c b/drivers/input/rmi4/rmi_f30.c
index 34dfee5..82e0f0d 100644
--- a/drivers/input/rmi4/rmi_f30.c
+++ b/drivers/input/rmi4/rmi_f30.c
@@ -232,9 +232,10 @@ static int rmi_f30_map_gpios(struct rmi_function *fn,
unsigned int trackstick_button = BTN_LEFT;
bool button_mapped = false;
int i;
+ int button_count = min_t(u8, f30->gpioled_count, TRACKSTICK_RANGE_END);
f30->gpioled_key_map = devm_kcalloc(&fn->dev,
- f30->gpioled_count,
+ button_count,
sizeof(f30->gpioled_key_map[0]),
GFP_KERNEL);
if (!f30->gpioled_key_map) {
@@ -242,7 +243,7 @@ static int rmi_f30_map_gpios(struct rmi_function *fn,
return -ENOMEM;
}
- for (i = 0; i < f30->gpioled_count; i++) {
+ for (i = 0; i < button_count; i++) {
if (!rmi_f30_is_valid_button(i, f30->ctrl))
continue;
OpenPOWER on IntegriCloud