diff options
| -rw-r--r-- | drivers/input/serio/i8042.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index b54aee7cd9e3..fce8ab7e89a1 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c | |||
| @@ -1386,6 +1386,8 @@ static int __init i8042_probe(struct platform_device *dev) | |||
| 1386 | { | 1386 | { |
| 1387 | int error; | 1387 | int error; |
| 1388 | 1388 | ||
| 1389 | i8042_platform_device = dev; | ||
| 1390 | |||
| 1389 | error = i8042_controller_selftest(); | 1391 | error = i8042_controller_selftest(); |
| 1390 | if (error) | 1392 | if (error) |
| 1391 | return error; | 1393 | return error; |
| @@ -1421,6 +1423,7 @@ static int __init i8042_probe(struct platform_device *dev) | |||
| 1421 | i8042_free_aux_ports(); /* in case KBD failed but AUX not */ | 1423 | i8042_free_aux_ports(); /* in case KBD failed but AUX not */ |
| 1422 | i8042_free_irqs(); | 1424 | i8042_free_irqs(); |
| 1423 | i8042_controller_reset(); | 1425 | i8042_controller_reset(); |
| 1426 | i8042_platform_device = NULL; | ||
| 1424 | 1427 | ||
| 1425 | return error; | 1428 | return error; |
| 1426 | } | 1429 | } |
| @@ -1430,6 +1433,7 @@ static int __devexit i8042_remove(struct platform_device *dev) | |||
| 1430 | i8042_unregister_ports(); | 1433 | i8042_unregister_ports(); |
| 1431 | i8042_free_irqs(); | 1434 | i8042_free_irqs(); |
| 1432 | i8042_controller_reset(); | 1435 | i8042_controller_reset(); |
| 1436 | i8042_platform_device = NULL; | ||
| 1433 | 1437 | ||
| 1434 | return 0; | 1438 | return 0; |
| 1435 | } | 1439 | } |
| @@ -1448,6 +1452,7 @@ static struct platform_driver i8042_driver = { | |||
| 1448 | 1452 | ||
| 1449 | static int __init i8042_init(void) | 1453 | static int __init i8042_init(void) |
| 1450 | { | 1454 | { |
| 1455 | struct platform_device *pdev; | ||
| 1451 | int err; | 1456 | int err; |
| 1452 | 1457 | ||
| 1453 | dbg_init(); | 1458 | dbg_init(); |
| @@ -1460,31 +1465,18 @@ static int __init i8042_init(void) | |||
| 1460 | if (err) | 1465 | if (err) |
| 1461 | goto err_platform_exit; | 1466 | goto err_platform_exit; |
| 1462 | 1467 | ||
| 1463 | i8042_platform_device = platform_device_alloc("i8042", -1); | 1468 | pdev = platform_create_bundle(&i8042_driver, i8042_probe, NULL, 0, NULL, 0); |
| 1464 | if (!i8042_platform_device) { | 1469 | if (IS_ERR(pdev)) { |
| 1465 | err = -ENOMEM; | 1470 | err = PTR_ERR(pdev); |
| 1466 | goto err_platform_exit; | 1471 | goto err_platform_exit; |
| 1467 | } | 1472 | } |
| 1468 | 1473 | ||
| 1469 | err = platform_device_add(i8042_platform_device); | ||
| 1470 | if (err) | ||
| 1471 | goto err_free_device; | ||
| 1472 | |||
| 1473 | err = platform_driver_probe(&i8042_driver, i8042_probe); | ||
| 1474 | if (err) | ||
| 1475 | goto err_del_device; | ||
| 1476 | |||
| 1477 | panic_blink = i8042_panic_blink; | 1474 | panic_blink = i8042_panic_blink; |
| 1478 | 1475 | ||
| 1479 | return 0; | 1476 | return 0; |
| 1480 | 1477 | ||
| 1481 | err_del_device: | ||
| 1482 | platform_device_del(i8042_platform_device); | ||
| 1483 | err_free_device: | ||
| 1484 | platform_device_put(i8042_platform_device); | ||
| 1485 | err_platform_exit: | 1478 | err_platform_exit: |
| 1486 | i8042_platform_exit(); | 1479 | i8042_platform_exit(); |
| 1487 | |||
| 1488 | return err; | 1480 | return err; |
| 1489 | } | 1481 | } |
| 1490 | 1482 | ||
