aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/sbshc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/sbshc.c')
-rw-r--r--drivers/acpi/sbshc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/acpi/sbshc.c b/drivers/acpi/sbshc.c
index bcf2c70fca87..e53e590252c0 100644
--- a/drivers/acpi/sbshc.c
+++ b/drivers/acpi/sbshc.c
@@ -107,6 +107,13 @@ static int wait_transaction_complete(struct acpi_smb_hc *hc, int timeout)
107 if (wait_event_timeout(hc->wait, smb_check_done(hc), 107 if (wait_event_timeout(hc->wait, smb_check_done(hc),
108 msecs_to_jiffies(timeout))) 108 msecs_to_jiffies(timeout)))
109 return 0; 109 return 0;
110 /*
111 * After the timeout happens, OS will try to check the status of SMbus.
112 * If the status is what OS expected, it will be regarded as the bogus
113 * timeout.
114 */
115 if (smb_check_done(hc))
116 return 0;
110 else 117 else
111 return -ETIME; 118 return -ETIME;
112} 119}
@@ -251,7 +258,7 @@ extern int acpi_ec_add_query_handler(struct acpi_ec *ec, u8 query_bit,
251static int acpi_smbus_hc_add(struct acpi_device *device) 258static int acpi_smbus_hc_add(struct acpi_device *device)
252{ 259{
253 int status; 260 int status;
254 unsigned long val; 261 unsigned long long val;
255 struct acpi_smb_hc *hc; 262 struct acpi_smb_hc *hc;
256 263
257 if (!device) 264 if (!device)
@@ -275,7 +282,7 @@ static int acpi_smbus_hc_add(struct acpi_device *device)
275 hc->ec = acpi_driver_data(device->parent); 282 hc->ec = acpi_driver_data(device->parent);
276 hc->offset = (val >> 8) & 0xff; 283 hc->offset = (val >> 8) & 0xff;
277 hc->query_bit = val & 0xff; 284 hc->query_bit = val & 0xff;
278 acpi_driver_data(device) = hc; 285 device->driver_data = hc;
279 286
280 acpi_ec_add_query_handler(hc->ec, hc->query_bit, NULL, smbus_alarm, hc); 287 acpi_ec_add_query_handler(hc->ec, hc->query_bit, NULL, smbus_alarm, hc);
281 printk(KERN_INFO PREFIX "SBS HC: EC = 0x%p, offset = 0x%0x, query_bit = 0x%0x\n", 288 printk(KERN_INFO PREFIX "SBS HC: EC = 0x%p, offset = 0x%0x, query_bit = 0x%0x\n",
@@ -296,7 +303,7 @@ static int acpi_smbus_hc_remove(struct acpi_device *device, int type)
296 hc = acpi_driver_data(device); 303 hc = acpi_driver_data(device);
297 acpi_ec_remove_query_handler(hc->ec, hc->query_bit); 304 acpi_ec_remove_query_handler(hc->ec, hc->query_bit);
298 kfree(hc); 305 kfree(hc);
299 acpi_driver_data(device) = NULL; 306 device->driver_data = NULL;
300 return 0; 307 return 0;
301} 308}
302 309