From: Ping Cheng Date: Wed, 5 Oct 2011 06:51:49 +0000 (-0700) Subject: Input: wacom - make LED status readable through sysfs X-Git-Tag: v3.12-rc1~9^2~136^2~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=04c59abd3c053f9a42437d5db3af4383cf68659c;p=kernel%2Fkernel-generic.git Input: wacom - make LED status readable through sysfs Reviewed-by: Eduard Hasenleithner Tested-by: Eduard Hasenleithner Signed-off-by: Ping Cheng Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index abe5920..a205055 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c @@ -584,7 +584,14 @@ static ssize_t wacom_led##SET_ID##_select_store(struct device *dev, \ { \ return wacom_led_select_store(dev, SET_ID, buf, count); \ } \ -static DEVICE_ATTR(status_led##SET_ID##_select, S_IWUSR, NULL, \ +static ssize_t wacom_led##SET_ID##_select_show(struct device *dev, \ + struct device_attribute *attr, char *buf) \ +{ \ + struct wacom *wacom = dev_get_drvdata(dev); \ + return snprintf(buf, 2, "%d\n", wacom->led.select[SET_ID]); \ +} \ +static DEVICE_ATTR(status_led##SET_ID##_select, S_IWUSR | S_IRUSR, \ + wacom_led##SET_ID##_select_show, \ wacom_led##SET_ID##_select_store) DEVICE_LED_SELECT_ATTR(0);