aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Weiss <[email protected]>2020-02-09 14:42:36 -0800
committerDmitry Torokhov <[email protected]>2020-02-10 10:00:01 -0800
commitfbd1ec000213c8b457dd4fb15b6de9ba02ec5482 (patch)
treec62bff613730164126e099eddd935d5ff34799bb
parentb19efcabb587e5470a423ef778905f47e5a47f1a (diff)
Input: ili210x - fix return value of is_visible function
The is_visible function expects the permissions associated with an attribute of the sysfs group or 0 if an attribute is not visible. Change the code to return the attribute permissions when the attribute should be visible which resolves the warning: Attribute calibrate: Invalid permissions 01 Fixes: cc12ba1872c6 ("Input: ili210x - optionally show calibrate sysfs attribute") Signed-off-by: Luca Weiss <[email protected]> Reviewed-by: Sven Van Asbroeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
-rw-r--r--drivers/input/touchscreen/ili210x.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c
index 4a17096e83e1..84bf51d79888 100644
--- a/drivers/input/touchscreen/ili210x.c
+++ b/drivers/input/touchscreen/ili210x.c
@@ -321,7 +321,7 @@ static umode_t ili210x_calibrate_visible(struct kobject *kobj,
struct i2c_client *client = to_i2c_client(dev);
struct ili210x *priv = i2c_get_clientdata(client);
- return priv->chip->has_calibrate_reg;
+ return priv->chip->has_calibrate_reg ? attr->mode : 0;
}
static const struct attribute_group ili210x_attr_group = {