lkml.org 
[lkml]   [2009]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] hwmon/hdaps: remove redundant sysfs invert
Hi Frank,

On Thu, 19 Feb 2009 13:44:43 +0100, Frank Seidel wrote:
> From: Frank Seidel <frank@f-seidel.de>
>
> Get rid of sysfs attribute "invert" as its
> redundant to module parameter.

It seems it isn't that easy:

>
> Signed-off-by: Frank Seidel <frank@f-seidel.de>
> ---
> drivers/hwmon/hdaps.c | 24 ------------------------
> 1 file changed, 24 deletions(-)
>
> --- a/drivers/hwmon/hdaps.c
> +++ b/drivers/hwmon/hdaps.c
> @@ -428,28 +428,6 @@ static ssize_t hdaps_calibrate_store(str
> return count;
> }
>
> -static ssize_t hdaps_invert_show(struct device *dev,
> - struct device_attribute *attr, char *buf)
> -{
> - return sprintf(buf, "%u\n", hdaps_invert);
> -}
> -
> -static ssize_t hdaps_invert_store(struct device *dev,
> - struct device_attribute *attr,
> - const char *buf, size_t count)
> -{
> - int invert;
> -
> - if (sscanf(buf, "%d", &invert) != 1 ||
> - invert < 0 || invert > HDAPS_BOTH_AXES)
> - return -EINVAL;
> -
> - hdaps_invert = invert;
> - hdaps_calibrate();

Apparently recalibration is necessary when you change the inversion
settings. The module parameter, which you made writable in a previous
patch, does _not_ recalibrate when changed.

So it was probably not such a good idea to make the module parameter
writable, and that should be reverted. Which in turn means that the
sysfs attribute "invert" has to stay.

> -
> - return count;
> -}
> -
> static DEVICE_ATTR(position, 0444, hdaps_position_show, NULL);
> static DEVICE_ATTR(variance, 0444, hdaps_variance_show, NULL);
> static DEVICE_ATTR(temp1, 0444, hdaps_temp1_show, NULL);
> @@ -457,7 +435,6 @@ static DEVICE_ATTR(temp2, 0444, hdaps_te
> static DEVICE_ATTR(keyboard_activity, 0444, hdaps_keyboard_activity_show, NULL);
> static DEVICE_ATTR(mouse_activity, 0444, hdaps_mouse_activity_show, NULL);
> static DEVICE_ATTR(calibrate, 0644, hdaps_calibrate_show,hdaps_calibrate_store);
> -static DEVICE_ATTR(invert, 0644, hdaps_invert_show, hdaps_invert_store);
>
> static struct attribute *hdaps_attributes[] = {
> &dev_attr_position.attr,
> @@ -467,7 +444,6 @@ static struct attribute *hdaps_attribute
> &dev_attr_keyboard_activity.attr,
> &dev_attr_mouse_activity.attr,
> &dev_attr_calibrate.attr,
> - &dev_attr_invert.attr,
> NULL,
> };
>


--
Jean Delvare


\
 
 \ /
  Last update: 2009-02-19 18:29    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site