Skip to content

Commit 07fc21b

Browse files
jlabundydtor
authored andcommitted
Input: iqs5xx - use local input_dev pointer
Both iqs5xx_axis_init() and iqs5xx_irq() already define a local input_dev pointer 'input'. Use this instead of iqs5xx->input so as to make the code a bit smaller. Signed-off-by: Jeff LaBundy <jeff@labundy.com> Link: https://lore.kernel.org/r/20220320025707.404544-1-jeff@labundy.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 8a3e634 commit 07fc21b

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

drivers/input/touchscreen/iqs5xx.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -486,11 +486,11 @@ static int iqs5xx_axis_init(struct i2c_client *client)
486486
{
487487
struct iqs5xx_private *iqs5xx = i2c_get_clientdata(client);
488488
struct touchscreen_properties *prop = &iqs5xx->prop;
489-
struct input_dev *input;
489+
struct input_dev *input = iqs5xx->input;
490490
u16 max_x, max_y;
491491
int error;
492492

493-
if (!iqs5xx->input) {
493+
if (!input) {
494494
input = devm_input_allocate_device(&client->dev);
495495
if (!input)
496496
return -ENOMEM;
@@ -512,11 +512,11 @@ static int iqs5xx_axis_init(struct i2c_client *client)
512512
if (error)
513513
return error;
514514

515-
input_set_abs_params(iqs5xx->input, ABS_MT_POSITION_X, 0, max_x, 0, 0);
516-
input_set_abs_params(iqs5xx->input, ABS_MT_POSITION_Y, 0, max_y, 0, 0);
517-
input_set_abs_params(iqs5xx->input, ABS_MT_PRESSURE, 0, U16_MAX, 0, 0);
515+
input_set_abs_params(input, ABS_MT_POSITION_X, 0, max_x, 0, 0);
516+
input_set_abs_params(input, ABS_MT_POSITION_Y, 0, max_y, 0, 0);
517+
input_set_abs_params(input, ABS_MT_PRESSURE, 0, U16_MAX, 0, 0);
518518

519-
touchscreen_parse_properties(iqs5xx->input, true, prop);
519+
touchscreen_parse_properties(input, true, prop);
520520

521521
/*
522522
* The device reserves 0xFFFF for coordinates that correspond to slots
@@ -540,7 +540,7 @@ static int iqs5xx_axis_init(struct i2c_client *client)
540540
return error;
541541
}
542542

543-
error = input_mt_init_slots(iqs5xx->input, IQS5XX_NUM_CONTACTS,
543+
error = input_mt_init_slots(input, IQS5XX_NUM_CONTACTS,
544544
INPUT_MT_DIRECT);
545545
if (error)
546546
dev_err(&client->dev, "Failed to initialize slots: %d\n",
@@ -674,7 +674,7 @@ static irqreturn_t iqs5xx_irq(int irq, void *data)
674674
input_mt_slot(input, i);
675675
if (input_mt_report_slot_state(input, MT_TOOL_FINGER,
676676
pressure != 0)) {
677-
touchscreen_report_pos(iqs5xx->input, &iqs5xx->prop,
677+
touchscreen_report_pos(input, &iqs5xx->prop,
678678
be16_to_cpu(touch_data->abs_x),
679679
be16_to_cpu(touch_data->abs_y),
680680
true);

0 commit comments

Comments
 (0)