1359 data->update_timeouts++;
1360 if (data->update_timeouts <= ABIT_UGURU_MAX_TIMEOUTS) {
1361 ABIT_UGURU_DEBUG(3, "timeout exceeded, will "
1362 "try again next update\n");
1363
1364 success = 1;
1365 } else
1366 ABIT_UGURU_DEBUG(1, "timeout exceeded %d "
1367 "times waiting for more input state\n",
1368 (int)data->update_timeouts);
1369 }
1370
1371 if (success)
1372 data->last_updated = jiffies;
1373 }
1374 mutex_unlock(&data->update_lock);
1375
1376 if (success)
1377 return data;
1378 else
1379 return NULL;
1380}
1381
1382#ifdef CONFIG_PM
1383static int abituguru_suspend(struct platform_device *pdev, pm_message_t state)
1384{
1385 struct abituguru_data *data = platform_get_drvdata(pdev);
1386
1387
1388 mutex_lock(&data->update_lock);
1389 return 0;
1390}
1391
1392static int abituguru_resume(struct platform_device *pdev)
1393{
1394 struct abituguru_data *data = platform_get_drvdata(pdev);
1395
1396 if (inb_p(data->addr + ABIT_UGURU_DATA) != ABIT_UGURU_STATUS_INPUT)
1397 data->uguru_ready = 0;
1398 mutex_unlock(&data->update_lock);
1399 return 0;