summaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@insightbb.com>2007-05-21 00:17:44 -0400
committerDmitry Torokhov <dtor@insightbb.com>2007-07-10 00:35:15 -0400
commit02fb6c385c72823af4fac83963a05be9163c73ea (patch)
tree53d5e15947cc517af5a7aedf8a47105e747cbb7b /drivers/input
parentb087e1f3ee9ae4da49fdeca2b0f0f8fc5a886a79 (diff)
Input: aiptek - do not check for NULL in attribute methods
It makes no sense to check for NULL in attribute methods - we do usb_set_intfdata before creating attributes and once attributes have been removed we are guaranteed to not be called. Signed-off-by: Rene van Paassen <rene.vanpaassen@gmail.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/tablet/aiptek.c101
1 files changed, 0 insertions, 101 deletions
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
index 088da86f0508..274c12f4220b 100644
--- a/drivers/input/tablet/aiptek.c
+++ b/drivers/input/tablet/aiptek.c
@@ -1006,9 +1006,6 @@ static ssize_t show_tabletSize(struct device *dev, struct device_attribute *attr
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
-
return snprintf(buf, PAGE_SIZE, "%dx%d\n",
aiptek->inputdev->absmax[ABS_X] + 1,
aiptek->inputdev->absmax[ABS_Y] + 1);
@@ -1031,9 +1028,6 @@ static ssize_t show_tabletPointerMode(struct device *dev, struct device_attribut
struct aiptek *aiptek = dev_get_drvdata(dev);
char *s;
- if (aiptek == NULL)
- return 0;
-
switch (aiptek->curSetting.pointerMode) {
case AIPTEK_POINTER_ONLY_STYLUS_MODE:
s = "stylus";
@@ -1058,8 +1052,6 @@ static ssize_t
store_tabletPointerMode(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
if (strcmp(buf, "stylus") == 0) {
aiptek->newSetting.pointerMode =
@@ -1085,9 +1077,6 @@ static ssize_t show_tabletCoordinateMode(struct device *dev, struct device_attri
struct aiptek *aiptek = dev_get_drvdata(dev);
char *s;
- if (aiptek == NULL)
- return 0;
-
switch (aiptek->curSetting.coordinateMode) {
case AIPTEK_COORDINATE_ABSOLUTE_MODE:
s = "absolute";
@@ -1108,8 +1097,6 @@ static ssize_t
store_tabletCoordinateMode(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
if (strcmp(buf, "absolute") == 0) {
aiptek->newSetting.pointerMode =
@@ -1134,9 +1121,6 @@ static ssize_t show_tabletToolMode(struct device *dev, struct device_attribute *
struct aiptek *aiptek = dev_get_drvdata(dev);
char *s;
- if (aiptek == NULL)
- return 0;
-
switch (TOOL_BUTTON(aiptek->curSetting.toolMode)) {
case AIPTEK_TOOL_BUTTON_MOUSE_MODE:
s = "mouse";
@@ -1177,8 +1161,6 @@ static ssize_t
store_tabletToolMode(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
if (strcmp(buf, "mouse") == 0) {
aiptek->newSetting.toolMode = AIPTEK_TOOL_BUTTON_MOUSE_MODE;
@@ -1211,9 +1193,6 @@ static ssize_t show_tabletXtilt(struct device *dev, struct device_attribute *att
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
-
if (aiptek->curSetting.xTilt == AIPTEK_TILT_DISABLE) {
return snprintf(buf, PAGE_SIZE, "disable\n");
} else {
@@ -1228,9 +1207,6 @@ store_tabletXtilt(struct device *dev, struct device_attribute *attr, const char
struct aiptek *aiptek = dev_get_drvdata(dev);
int x;
- if (aiptek == NULL)
- return 0;
-
if (strcmp(buf, "disable") == 0) {
aiptek->newSetting.xTilt = AIPTEK_TILT_DISABLE;
} else {
@@ -1253,9 +1229,6 @@ static ssize_t show_tabletYtilt(struct device *dev, struct device_attribute *att
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
-
if (aiptek->curSetting.yTilt == AIPTEK_TILT_DISABLE) {
return snprintf(buf, PAGE_SIZE, "disable\n");
} else {
@@ -1270,9 +1243,6 @@ store_tabletYtilt(struct device *dev, struct device_attribute *attr, const char
struct aiptek *aiptek = dev_get_drvdata(dev);
int y;
- if (aiptek == NULL)
- return 0;
-
if (strcmp(buf, "disable") == 0) {
aiptek->newSetting.yTilt = AIPTEK_TILT_DISABLE;
} else {
@@ -1295,9 +1265,6 @@ static ssize_t show_tabletJitterDelay(struct device *dev, struct device_attribut
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
-
return snprintf(buf, PAGE_SIZE, "%d\n", aiptek->curSetting.jitterDelay);
}
@@ -1306,9 +1273,6 @@ store_tabletJitterDelay(struct device *dev, struct device_attribute *attr, const
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
-
aiptek->newSetting.jitterDelay = (int)simple_strtol(buf, NULL, 10);
return count;
}
@@ -1325,9 +1289,6 @@ static ssize_t show_tabletProgrammableDelay(struct device *dev, struct device_at
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
-
return snprintf(buf, PAGE_SIZE, "%d\n",
aiptek->curSetting.programmableDelay);
}
@@ -1337,9 +1298,6 @@ store_tabletProgrammableDelay(struct device *dev, struct device_attribute *attr,
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
-
aiptek->newSetting.programmableDelay = (int)simple_strtol(buf, NULL, 10);
return count;
}
@@ -1356,9 +1314,6 @@ static ssize_t show_tabletEventsReceived(struct device *dev, struct device_attri
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
-
return snprintf(buf, PAGE_SIZE, "%ld\n", aiptek->eventCount);
}
@@ -1373,9 +1328,6 @@ static ssize_t show_tabletDiagnosticMessage(struct device *dev, struct device_at
struct aiptek *aiptek = dev_get_drvdata(dev);
char *retMsg;
- if (aiptek == NULL)
- return 0;
-
switch (aiptek->diagnostic) {
case AIPTEK_DIAGNOSTIC_NA:
retMsg = "no errors\n";
@@ -1415,9 +1367,6 @@ static ssize_t show_tabletStylusUpper(struct device *dev, struct device_attribut
struct aiptek *aiptek = dev_get_drvdata(dev);
char *s;
- if (aiptek == NULL)
- return 0;
-
switch (aiptek->curSetting.stylusButtonUpper) {
case AIPTEK_STYLUS_UPPER_BUTTON:
s = "upper";
@@ -1439,9 +1388,6 @@ store_tabletStylusUpper(struct device *dev, struct device_attribute *attr, const
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
-
if (strcmp(buf, "upper") == 0) {
aiptek->newSetting.stylusButtonUpper =
AIPTEK_STYLUS_UPPER_BUTTON;
@@ -1465,9 +1411,6 @@ static ssize_t show_tabletStylusLower(struct device *dev, struct device_attribut
struct aiptek *aiptek = dev_get_drvdata(dev);
char *s;
- if (aiptek == NULL)
- return 0;
-
switch (aiptek->curSetting.stylusButtonLower) {
case AIPTEK_STYLUS_UPPER_BUTTON:
s = "upper";
@@ -1489,9 +1432,6 @@ store_tabletStylusLower(struct device *dev, struct device_attribute *attr, const
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
-
if (strcmp(buf, "upper") == 0) {
aiptek->newSetting.stylusButtonLower =
AIPTEK_STYLUS_UPPER_BUTTON;
@@ -1515,9 +1455,6 @@ static ssize_t show_tabletMouseLeft(struct device *dev, struct device_attribute
struct aiptek *aiptek = dev_get_drvdata(dev);
char *s;
- if (aiptek == NULL)
- return 0;
-
switch (aiptek->curSetting.mouseButtonLeft) {
case AIPTEK_MOUSE_LEFT_BUTTON:
s = "left";
@@ -1543,9 +1480,6 @@ store_tabletMouseLeft(struct device *dev, struct device_attribute *attr, const c
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
-
if (strcmp(buf, "left") == 0) {
aiptek->newSetting.mouseButtonLeft = AIPTEK_MOUSE_LEFT_BUTTON;
} else if (strcmp(buf, "middle") == 0) {
@@ -1569,9 +1503,6 @@ static ssize_t show_tabletMouseMiddle(struct device *dev, struct device_attribut
struct aiptek *aiptek = dev_get_drvdata(dev);
char *s;
- if (aiptek == NULL)
- return 0;
-
switch (aiptek->curSetting.mouseButtonMiddle) {
case AIPTEK_MOUSE_LEFT_BUTTON:
s = "left";
@@ -1597,9 +1528,6 @@ store_tabletMouseMiddle(struct device *dev, struct device_attribute *attr, const
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
-
if (strcmp(buf, "left") == 0) {
aiptek->newSetting.mouseButtonMiddle = AIPTEK_MOUSE_LEFT_BUTTON;
} else if (strcmp(buf, "middle") == 0) {
@@ -1625,9 +1553,6 @@ static ssize_t show_tabletMouseRight(struct device *dev, struct device_attribute
struct aiptek *aiptek = dev_get_drvdata(dev);
char *s;
- if (aiptek == NULL)
- return 0;
-
switch (aiptek->curSetting.mouseButtonRight) {
case AIPTEK_MOUSE_LEFT_BUTTON:
s = "left";
@@ -1653,9 +1578,6 @@ store_tabletMouseRight(struct device *dev, struct device_attribute *attr, const
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
-
if (strcmp(buf, "left") == 0) {
aiptek->newSetting.mouseButtonRight = AIPTEK_MOUSE_LEFT_BUTTON;
} else if (strcmp(buf, "middle") == 0) {
@@ -1679,9 +1601,6 @@ static ssize_t show_tabletWheel(struct device *dev, struct device_attribute *att
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
-
if (aiptek->curSetting.wheel == AIPTEK_WHEEL_DISABLE) {
return snprintf(buf, PAGE_SIZE, "disable\n");
} else {
@@ -1695,9 +1614,6 @@ store_tabletWheel(struct device *dev, struct device_attribute *attr, const char
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
-
aiptek->newSetting.wheel = (int)simple_strtol(buf, NULL, 10);
return count;
}
@@ -1711,11 +1627,6 @@ static DEVICE_ATTR(wheel,
*/
static ssize_t show_tabletExecute(struct device *dev, struct device_attribute *attr, char *buf)
{
- struct aiptek *aiptek = dev_get_drvdata(dev);
-
- if (aiptek == NULL)
- return 0;
-
/* There is nothing useful to display, so a one-line manual
* is in order...
*/
@@ -1728,9 +1639,6 @@ store_tabletExecute(struct device *dev, struct device_attribute *attr, const cha
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
-
/* We do not care what you write to this file. Merely the action
* of writing to this file triggers a tablet reprogramming.
*/
@@ -1754,9 +1662,6 @@ static ssize_t show_tabletODMCode(struct device *dev, struct device_attribute *a
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
-
return snprintf(buf, PAGE_SIZE, "0x%04x\n", aiptek->features.odmCode);
}
@@ -1770,9 +1675,6 @@ static ssize_t show_tabletModelCode(struct device *dev, struct device_attribute
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
-
return snprintf(buf, PAGE_SIZE, "0x%04x\n", aiptek->features.modelCode);
}
@@ -1786,9 +1688,6 @@ static ssize_t show_firmwareCode(struct device *dev, struct device_attribute *at
{
struct aiptek *aiptek = dev_get_drvdata(dev);
- if (aiptek == NULL)
- return 0;
-
return snprintf(buf, PAGE_SIZE, "%04x\n",
aiptek->features.firmwareCode);
}