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>
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
index 088da86..274c12f4 100644
--- a/drivers/input/tablet/aiptek.c
+++ b/drivers/input/tablet/aiptek.c
@@ -1006,9 +1006,6 @@
 {
 	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 @@
 	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 @@
 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 @@
 	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 @@
 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 @@
 	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 @@
 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 @@
 {
 	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 @@
 	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 @@
 {
 	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 @@
 	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 @@
 {
 	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 @@
 {
 	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 @@
 {
 	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 @@
 {
 	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 @@
 {
 	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 @@
 	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 @@
 	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 @@
 {
 	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 @@
 	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 @@
 {
 	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 @@
 	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 @@
 {
 	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 @@
 	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 @@
 {
 	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 @@
 	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 @@
 {
 	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 @@
 {
 	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 @@
 {
 	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 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 @@
 {
 	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 @@
 {
 	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 @@
 {
 	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 @@
 {
 	struct aiptek *aiptek = dev_get_drvdata(dev);
 
-	if (aiptek == NULL)
-		return 0;
-
 	return snprintf(buf, PAGE_SIZE, "%04x\n",
 			aiptek->features.firmwareCode);
 }