diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2007-05-21 00:17:44 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2007-07-10 00:35:15 -0400 |
commit | 02fb6c385c72823af4fac83963a05be9163c73ea (patch) | |
tree | 53d5e15947cc517af5a7aedf8a47105e747cbb7b /drivers/input/tablet | |
parent | b087e1f3ee9ae4da49fdeca2b0f0f8fc5a886a79 (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/tablet')
-rw-r--r-- | drivers/input/tablet/aiptek.c | 101 |
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 | |||
1006 | { | 1006 | { |
1007 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1007 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1008 | 1008 | ||
1009 | if (aiptek == NULL) | ||
1010 | return 0; | ||
1011 | |||
1012 | return snprintf(buf, PAGE_SIZE, "%dx%d\n", | 1009 | return snprintf(buf, PAGE_SIZE, "%dx%d\n", |
1013 | aiptek->inputdev->absmax[ABS_X] + 1, | 1010 | aiptek->inputdev->absmax[ABS_X] + 1, |
1014 | aiptek->inputdev->absmax[ABS_Y] + 1); | 1011 | aiptek->inputdev->absmax[ABS_Y] + 1); |
@@ -1031,9 +1028,6 @@ static ssize_t show_tabletPointerMode(struct device *dev, struct device_attribut | |||
1031 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1028 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1032 | char *s; | 1029 | char *s; |
1033 | 1030 | ||
1034 | if (aiptek == NULL) | ||
1035 | return 0; | ||
1036 | |||
1037 | switch (aiptek->curSetting.pointerMode) { | 1031 | switch (aiptek->curSetting.pointerMode) { |
1038 | case AIPTEK_POINTER_ONLY_STYLUS_MODE: | 1032 | case AIPTEK_POINTER_ONLY_STYLUS_MODE: |
1039 | s = "stylus"; | 1033 | s = "stylus"; |
@@ -1058,8 +1052,6 @@ static ssize_t | |||
1058 | store_tabletPointerMode(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | 1052 | store_tabletPointerMode(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
1059 | { | 1053 | { |
1060 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1054 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1061 | if (aiptek == NULL) | ||
1062 | return 0; | ||
1063 | 1055 | ||
1064 | if (strcmp(buf, "stylus") == 0) { | 1056 | if (strcmp(buf, "stylus") == 0) { |
1065 | aiptek->newSetting.pointerMode = | 1057 | aiptek->newSetting.pointerMode = |
@@ -1085,9 +1077,6 @@ static ssize_t show_tabletCoordinateMode(struct device *dev, struct device_attri | |||
1085 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1077 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1086 | char *s; | 1078 | char *s; |
1087 | 1079 | ||
1088 | if (aiptek == NULL) | ||
1089 | return 0; | ||
1090 | |||
1091 | switch (aiptek->curSetting.coordinateMode) { | 1080 | switch (aiptek->curSetting.coordinateMode) { |
1092 | case AIPTEK_COORDINATE_ABSOLUTE_MODE: | 1081 | case AIPTEK_COORDINATE_ABSOLUTE_MODE: |
1093 | s = "absolute"; | 1082 | s = "absolute"; |
@@ -1108,8 +1097,6 @@ static ssize_t | |||
1108 | store_tabletCoordinateMode(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | 1097 | store_tabletCoordinateMode(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
1109 | { | 1098 | { |
1110 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1099 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1111 | if (aiptek == NULL) | ||
1112 | return 0; | ||
1113 | 1100 | ||
1114 | if (strcmp(buf, "absolute") == 0) { | 1101 | if (strcmp(buf, "absolute") == 0) { |
1115 | aiptek->newSetting.pointerMode = | 1102 | aiptek->newSetting.pointerMode = |
@@ -1134,9 +1121,6 @@ static ssize_t show_tabletToolMode(struct device *dev, struct device_attribute * | |||
1134 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1121 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1135 | char *s; | 1122 | char *s; |
1136 | 1123 | ||
1137 | if (aiptek == NULL) | ||
1138 | return 0; | ||
1139 | |||
1140 | switch (TOOL_BUTTON(aiptek->curSetting.toolMode)) { | 1124 | switch (TOOL_BUTTON(aiptek->curSetting.toolMode)) { |
1141 | case AIPTEK_TOOL_BUTTON_MOUSE_MODE: | 1125 | case AIPTEK_TOOL_BUTTON_MOUSE_MODE: |
1142 | s = "mouse"; | 1126 | s = "mouse"; |
@@ -1177,8 +1161,6 @@ static ssize_t | |||
1177 | store_tabletToolMode(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | 1161 | store_tabletToolMode(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
1178 | { | 1162 | { |
1179 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1163 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1180 | if (aiptek == NULL) | ||
1181 | return 0; | ||
1182 | 1164 | ||
1183 | if (strcmp(buf, "mouse") == 0) { | 1165 | if (strcmp(buf, "mouse") == 0) { |
1184 | aiptek->newSetting.toolMode = AIPTEK_TOOL_BUTTON_MOUSE_MODE; | 1166 | aiptek->newSetting.toolMode = AIPTEK_TOOL_BUTTON_MOUSE_MODE; |
@@ -1211,9 +1193,6 @@ static ssize_t show_tabletXtilt(struct device *dev, struct device_attribute *att | |||
1211 | { | 1193 | { |
1212 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1194 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1213 | 1195 | ||
1214 | if (aiptek == NULL) | ||
1215 | return 0; | ||
1216 | |||
1217 | if (aiptek->curSetting.xTilt == AIPTEK_TILT_DISABLE) { | 1196 | if (aiptek->curSetting.xTilt == AIPTEK_TILT_DISABLE) { |
1218 | return snprintf(buf, PAGE_SIZE, "disable\n"); | 1197 | return snprintf(buf, PAGE_SIZE, "disable\n"); |
1219 | } else { | 1198 | } else { |
@@ -1228,9 +1207,6 @@ store_tabletXtilt(struct device *dev, struct device_attribute *attr, const char | |||
1228 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1207 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1229 | int x; | 1208 | int x; |
1230 | 1209 | ||
1231 | if (aiptek == NULL) | ||
1232 | return 0; | ||
1233 | |||
1234 | if (strcmp(buf, "disable") == 0) { | 1210 | if (strcmp(buf, "disable") == 0) { |
1235 | aiptek->newSetting.xTilt = AIPTEK_TILT_DISABLE; | 1211 | aiptek->newSetting.xTilt = AIPTEK_TILT_DISABLE; |
1236 | } else { | 1212 | } else { |
@@ -1253,9 +1229,6 @@ static ssize_t show_tabletYtilt(struct device *dev, struct device_attribute *att | |||
1253 | { | 1229 | { |
1254 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1230 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1255 | 1231 | ||
1256 | if (aiptek == NULL) | ||
1257 | return 0; | ||
1258 | |||
1259 | if (aiptek->curSetting.yTilt == AIPTEK_TILT_DISABLE) { | 1232 | if (aiptek->curSetting.yTilt == AIPTEK_TILT_DISABLE) { |
1260 | return snprintf(buf, PAGE_SIZE, "disable\n"); | 1233 | return snprintf(buf, PAGE_SIZE, "disable\n"); |
1261 | } else { | 1234 | } else { |
@@ -1270,9 +1243,6 @@ store_tabletYtilt(struct device *dev, struct device_attribute *attr, const char | |||
1270 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1243 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1271 | int y; | 1244 | int y; |
1272 | 1245 | ||
1273 | if (aiptek == NULL) | ||
1274 | return 0; | ||
1275 | |||
1276 | if (strcmp(buf, "disable") == 0) { | 1246 | if (strcmp(buf, "disable") == 0) { |
1277 | aiptek->newSetting.yTilt = AIPTEK_TILT_DISABLE; | 1247 | aiptek->newSetting.yTilt = AIPTEK_TILT_DISABLE; |
1278 | } else { | 1248 | } else { |
@@ -1295,9 +1265,6 @@ static ssize_t show_tabletJitterDelay(struct device *dev, struct device_attribut | |||
1295 | { | 1265 | { |
1296 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1266 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1297 | 1267 | ||
1298 | if (aiptek == NULL) | ||
1299 | return 0; | ||
1300 | |||
1301 | return snprintf(buf, PAGE_SIZE, "%d\n", aiptek->curSetting.jitterDelay); | 1268 | return snprintf(buf, PAGE_SIZE, "%d\n", aiptek->curSetting.jitterDelay); |
1302 | } | 1269 | } |
1303 | 1270 | ||
@@ -1306,9 +1273,6 @@ store_tabletJitterDelay(struct device *dev, struct device_attribute *attr, const | |||
1306 | { | 1273 | { |
1307 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1274 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1308 | 1275 | ||
1309 | if (aiptek == NULL) | ||
1310 | return 0; | ||
1311 | |||
1312 | aiptek->newSetting.jitterDelay = (int)simple_strtol(buf, NULL, 10); | 1276 | aiptek->newSetting.jitterDelay = (int)simple_strtol(buf, NULL, 10); |
1313 | return count; | 1277 | return count; |
1314 | } | 1278 | } |
@@ -1325,9 +1289,6 @@ static ssize_t show_tabletProgrammableDelay(struct device *dev, struct device_at | |||
1325 | { | 1289 | { |
1326 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1290 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1327 | 1291 | ||
1328 | if (aiptek == NULL) | ||
1329 | return 0; | ||
1330 | |||
1331 | return snprintf(buf, PAGE_SIZE, "%d\n", | 1292 | return snprintf(buf, PAGE_SIZE, "%d\n", |
1332 | aiptek->curSetting.programmableDelay); | 1293 | aiptek->curSetting.programmableDelay); |
1333 | } | 1294 | } |
@@ -1337,9 +1298,6 @@ store_tabletProgrammableDelay(struct device *dev, struct device_attribute *attr, | |||
1337 | { | 1298 | { |
1338 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1299 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1339 | 1300 | ||
1340 | if (aiptek == NULL) | ||
1341 | return 0; | ||
1342 | |||
1343 | aiptek->newSetting.programmableDelay = (int)simple_strtol(buf, NULL, 10); | 1301 | aiptek->newSetting.programmableDelay = (int)simple_strtol(buf, NULL, 10); |
1344 | return count; | 1302 | return count; |
1345 | } | 1303 | } |
@@ -1356,9 +1314,6 @@ static ssize_t show_tabletEventsReceived(struct device *dev, struct device_attri | |||
1356 | { | 1314 | { |
1357 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1315 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1358 | 1316 | ||
1359 | if (aiptek == NULL) | ||
1360 | return 0; | ||
1361 | |||
1362 | return snprintf(buf, PAGE_SIZE, "%ld\n", aiptek->eventCount); | 1317 | return snprintf(buf, PAGE_SIZE, "%ld\n", aiptek->eventCount); |
1363 | } | 1318 | } |
1364 | 1319 | ||
@@ -1373,9 +1328,6 @@ static ssize_t show_tabletDiagnosticMessage(struct device *dev, struct device_at | |||
1373 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1328 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1374 | char *retMsg; | 1329 | char *retMsg; |
1375 | 1330 | ||
1376 | if (aiptek == NULL) | ||
1377 | return 0; | ||
1378 | |||
1379 | switch (aiptek->diagnostic) { | 1331 | switch (aiptek->diagnostic) { |
1380 | case AIPTEK_DIAGNOSTIC_NA: | 1332 | case AIPTEK_DIAGNOSTIC_NA: |
1381 | retMsg = "no errors\n"; | 1333 | retMsg = "no errors\n"; |
@@ -1415,9 +1367,6 @@ static ssize_t show_tabletStylusUpper(struct device *dev, struct device_attribut | |||
1415 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1367 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1416 | char *s; | 1368 | char *s; |
1417 | 1369 | ||
1418 | if (aiptek == NULL) | ||
1419 | return 0; | ||
1420 | |||
1421 | switch (aiptek->curSetting.stylusButtonUpper) { | 1370 | switch (aiptek->curSetting.stylusButtonUpper) { |
1422 | case AIPTEK_STYLUS_UPPER_BUTTON: | 1371 | case AIPTEK_STYLUS_UPPER_BUTTON: |
1423 | s = "upper"; | 1372 | s = "upper"; |
@@ -1439,9 +1388,6 @@ store_tabletStylusUpper(struct device *dev, struct device_attribute *attr, const | |||
1439 | { | 1388 | { |
1440 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1389 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1441 | 1390 | ||
1442 | if (aiptek == NULL) | ||
1443 | return 0; | ||
1444 | |||
1445 | if (strcmp(buf, "upper") == 0) { | 1391 | if (strcmp(buf, "upper") == 0) { |
1446 | aiptek->newSetting.stylusButtonUpper = | 1392 | aiptek->newSetting.stylusButtonUpper = |
1447 | AIPTEK_STYLUS_UPPER_BUTTON; | 1393 | AIPTEK_STYLUS_UPPER_BUTTON; |
@@ -1465,9 +1411,6 @@ static ssize_t show_tabletStylusLower(struct device *dev, struct device_attribut | |||
1465 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1411 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1466 | char *s; | 1412 | char *s; |
1467 | 1413 | ||
1468 | if (aiptek == NULL) | ||
1469 | return 0; | ||
1470 | |||
1471 | switch (aiptek->curSetting.stylusButtonLower) { | 1414 | switch (aiptek->curSetting.stylusButtonLower) { |
1472 | case AIPTEK_STYLUS_UPPER_BUTTON: | 1415 | case AIPTEK_STYLUS_UPPER_BUTTON: |
1473 | s = "upper"; | 1416 | s = "upper"; |
@@ -1489,9 +1432,6 @@ store_tabletStylusLower(struct device *dev, struct device_attribute *attr, const | |||
1489 | { | 1432 | { |
1490 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1433 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1491 | 1434 | ||
1492 | if (aiptek == NULL) | ||
1493 | return 0; | ||
1494 | |||
1495 | if (strcmp(buf, "upper") == 0) { | 1435 | if (strcmp(buf, "upper") == 0) { |
1496 | aiptek->newSetting.stylusButtonLower = | 1436 | aiptek->newSetting.stylusButtonLower = |
1497 | AIPTEK_STYLUS_UPPER_BUTTON; | 1437 | AIPTEK_STYLUS_UPPER_BUTTON; |
@@ -1515,9 +1455,6 @@ static ssize_t show_tabletMouseLeft(struct device *dev, struct device_attribute | |||
1515 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1455 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1516 | char *s; | 1456 | char *s; |
1517 | 1457 | ||
1518 | if (aiptek == NULL) | ||
1519 | return 0; | ||
1520 | |||
1521 | switch (aiptek->curSetting.mouseButtonLeft) { | 1458 | switch (aiptek->curSetting.mouseButtonLeft) { |
1522 | case AIPTEK_MOUSE_LEFT_BUTTON: | 1459 | case AIPTEK_MOUSE_LEFT_BUTTON: |
1523 | s = "left"; | 1460 | s = "left"; |
@@ -1543,9 +1480,6 @@ store_tabletMouseLeft(struct device *dev, struct device_attribute *attr, const c | |||
1543 | { | 1480 | { |
1544 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1481 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1545 | 1482 | ||
1546 | if (aiptek == NULL) | ||
1547 | return 0; | ||
1548 | |||
1549 | if (strcmp(buf, "left") == 0) { | 1483 | if (strcmp(buf, "left") == 0) { |
1550 | aiptek->newSetting.mouseButtonLeft = AIPTEK_MOUSE_LEFT_BUTTON; | 1484 | aiptek->newSetting.mouseButtonLeft = AIPTEK_MOUSE_LEFT_BUTTON; |
1551 | } else if (strcmp(buf, "middle") == 0) { | 1485 | } else if (strcmp(buf, "middle") == 0) { |
@@ -1569,9 +1503,6 @@ static ssize_t show_tabletMouseMiddle(struct device *dev, struct device_attribut | |||
1569 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1503 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1570 | char *s; | 1504 | char *s; |
1571 | 1505 | ||
1572 | if (aiptek == NULL) | ||
1573 | return 0; | ||
1574 | |||
1575 | switch (aiptek->curSetting.mouseButtonMiddle) { | 1506 | switch (aiptek->curSetting.mouseButtonMiddle) { |
1576 | case AIPTEK_MOUSE_LEFT_BUTTON: | 1507 | case AIPTEK_MOUSE_LEFT_BUTTON: |
1577 | s = "left"; | 1508 | s = "left"; |
@@ -1597,9 +1528,6 @@ store_tabletMouseMiddle(struct device *dev, struct device_attribute *attr, const | |||
1597 | { | 1528 | { |
1598 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1529 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1599 | 1530 | ||
1600 | if (aiptek == NULL) | ||
1601 | return 0; | ||
1602 | |||
1603 | if (strcmp(buf, "left") == 0) { | 1531 | if (strcmp(buf, "left") == 0) { |
1604 | aiptek->newSetting.mouseButtonMiddle = AIPTEK_MOUSE_LEFT_BUTTON; | 1532 | aiptek->newSetting.mouseButtonMiddle = AIPTEK_MOUSE_LEFT_BUTTON; |
1605 | } else if (strcmp(buf, "middle") == 0) { | 1533 | } else if (strcmp(buf, "middle") == 0) { |
@@ -1625,9 +1553,6 @@ static ssize_t show_tabletMouseRight(struct device *dev, struct device_attribute | |||
1625 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1553 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1626 | char *s; | 1554 | char *s; |
1627 | 1555 | ||
1628 | if (aiptek == NULL) | ||
1629 | return 0; | ||
1630 | |||
1631 | switch (aiptek->curSetting.mouseButtonRight) { | 1556 | switch (aiptek->curSetting.mouseButtonRight) { |
1632 | case AIPTEK_MOUSE_LEFT_BUTTON: | 1557 | case AIPTEK_MOUSE_LEFT_BUTTON: |
1633 | s = "left"; | 1558 | s = "left"; |
@@ -1653,9 +1578,6 @@ store_tabletMouseRight(struct device *dev, struct device_attribute *attr, const | |||
1653 | { | 1578 | { |
1654 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1579 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1655 | 1580 | ||
1656 | if (aiptek == NULL) | ||
1657 | return 0; | ||
1658 | |||
1659 | if (strcmp(buf, "left") == 0) { | 1581 | if (strcmp(buf, "left") == 0) { |
1660 | aiptek->newSetting.mouseButtonRight = AIPTEK_MOUSE_LEFT_BUTTON; | 1582 | aiptek->newSetting.mouseButtonRight = AIPTEK_MOUSE_LEFT_BUTTON; |
1661 | } else if (strcmp(buf, "middle") == 0) { | 1583 | } else if (strcmp(buf, "middle") == 0) { |
@@ -1679,9 +1601,6 @@ static ssize_t show_tabletWheel(struct device *dev, struct device_attribute *att | |||
1679 | { | 1601 | { |
1680 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1602 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1681 | 1603 | ||
1682 | if (aiptek == NULL) | ||
1683 | return 0; | ||
1684 | |||
1685 | if (aiptek->curSetting.wheel == AIPTEK_WHEEL_DISABLE) { | 1604 | if (aiptek->curSetting.wheel == AIPTEK_WHEEL_DISABLE) { |
1686 | return snprintf(buf, PAGE_SIZE, "disable\n"); | 1605 | return snprintf(buf, PAGE_SIZE, "disable\n"); |
1687 | } else { | 1606 | } else { |
@@ -1695,9 +1614,6 @@ store_tabletWheel(struct device *dev, struct device_attribute *attr, const char | |||
1695 | { | 1614 | { |
1696 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1615 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1697 | 1616 | ||
1698 | if (aiptek == NULL) | ||
1699 | return 0; | ||
1700 | |||
1701 | aiptek->newSetting.wheel = (int)simple_strtol(buf, NULL, 10); | 1617 | aiptek->newSetting.wheel = (int)simple_strtol(buf, NULL, 10); |
1702 | return count; | 1618 | return count; |
1703 | } | 1619 | } |
@@ -1711,11 +1627,6 @@ static DEVICE_ATTR(wheel, | |||
1711 | */ | 1627 | */ |
1712 | static ssize_t show_tabletExecute(struct device *dev, struct device_attribute *attr, char *buf) | 1628 | static ssize_t show_tabletExecute(struct device *dev, struct device_attribute *attr, char *buf) |
1713 | { | 1629 | { |
1714 | struct aiptek *aiptek = dev_get_drvdata(dev); | ||
1715 | |||
1716 | if (aiptek == NULL) | ||
1717 | return 0; | ||
1718 | |||
1719 | /* There is nothing useful to display, so a one-line manual | 1630 | /* There is nothing useful to display, so a one-line manual |
1720 | * is in order... | 1631 | * is in order... |
1721 | */ | 1632 | */ |
@@ -1728,9 +1639,6 @@ store_tabletExecute(struct device *dev, struct device_attribute *attr, const cha | |||
1728 | { | 1639 | { |
1729 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1640 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1730 | 1641 | ||
1731 | if (aiptek == NULL) | ||
1732 | return 0; | ||
1733 | |||
1734 | /* We do not care what you write to this file. Merely the action | 1642 | /* We do not care what you write to this file. Merely the action |
1735 | * of writing to this file triggers a tablet reprogramming. | 1643 | * of writing to this file triggers a tablet reprogramming. |
1736 | */ | 1644 | */ |
@@ -1754,9 +1662,6 @@ static ssize_t show_tabletODMCode(struct device *dev, struct device_attribute *a | |||
1754 | { | 1662 | { |
1755 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1663 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1756 | 1664 | ||
1757 | if (aiptek == NULL) | ||
1758 | return 0; | ||
1759 | |||
1760 | return snprintf(buf, PAGE_SIZE, "0x%04x\n", aiptek->features.odmCode); | 1665 | return snprintf(buf, PAGE_SIZE, "0x%04x\n", aiptek->features.odmCode); |
1761 | } | 1666 | } |
1762 | 1667 | ||
@@ -1770,9 +1675,6 @@ static ssize_t show_tabletModelCode(struct device *dev, struct device_attribute | |||
1770 | { | 1675 | { |
1771 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1676 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1772 | 1677 | ||
1773 | if (aiptek == NULL) | ||
1774 | return 0; | ||
1775 | |||
1776 | return snprintf(buf, PAGE_SIZE, "0x%04x\n", aiptek->features.modelCode); | 1678 | return snprintf(buf, PAGE_SIZE, "0x%04x\n", aiptek->features.modelCode); |
1777 | } | 1679 | } |
1778 | 1680 | ||
@@ -1786,9 +1688,6 @@ static ssize_t show_firmwareCode(struct device *dev, struct device_attribute *at | |||
1786 | { | 1688 | { |
1787 | struct aiptek *aiptek = dev_get_drvdata(dev); | 1689 | struct aiptek *aiptek = dev_get_drvdata(dev); |
1788 | 1690 | ||
1789 | if (aiptek == NULL) | ||
1790 | return 0; | ||
1791 | |||
1792 | return snprintf(buf, PAGE_SIZE, "%04x\n", | 1691 | return snprintf(buf, PAGE_SIZE, "%04x\n", |
1793 | aiptek->features.firmwareCode); | 1692 | aiptek->features.firmwareCode); |
1794 | } | 1693 | } |