| .. | .. |
|---|
| 462 | 462 | return -ENODEV; |
|---|
| 463 | 463 | |
|---|
| 464 | 464 | dev_dbg(&dev->dev, |
|---|
| 465 | | - "Setup PNP port: port %lx, mem %pa, irq %d, type %d\n", |
|---|
| 466 | | - uart.port.iobase, &uart.port.mapbase, |
|---|
| 465 | + "Setup PNP port: port %#lx, mem %#llx, irq %u, type %u\n", |
|---|
| 466 | + uart.port.iobase, (unsigned long long)uart.port.mapbase, |
|---|
| 467 | 467 | uart.port.irq, uart.port.iotype); |
|---|
| 468 | 468 | |
|---|
| 469 | 469 | if (flags & CIR_PORT) { |
|---|
| .. | .. |
|---|
| 498 | 498 | serial8250_unregister_port(line - 1); |
|---|
| 499 | 499 | } |
|---|
| 500 | 500 | |
|---|
| 501 | | -#ifdef CONFIG_PM |
|---|
| 502 | | -static int serial_pnp_suspend(struct pnp_dev *dev, pm_message_t state) |
|---|
| 501 | +static int __maybe_unused serial_pnp_suspend(struct device *dev) |
|---|
| 503 | 502 | { |
|---|
| 504 | | - long line = (long)pnp_get_drvdata(dev); |
|---|
| 503 | + long line = (long)dev_get_drvdata(dev); |
|---|
| 505 | 504 | |
|---|
| 506 | 505 | if (!line) |
|---|
| 507 | 506 | return -ENODEV; |
|---|
| .. | .. |
|---|
| 509 | 508 | return 0; |
|---|
| 510 | 509 | } |
|---|
| 511 | 510 | |
|---|
| 512 | | -static int serial_pnp_resume(struct pnp_dev *dev) |
|---|
| 511 | +static int __maybe_unused serial_pnp_resume(struct device *dev) |
|---|
| 513 | 512 | { |
|---|
| 514 | | - long line = (long)pnp_get_drvdata(dev); |
|---|
| 513 | + long line = (long)dev_get_drvdata(dev); |
|---|
| 515 | 514 | |
|---|
| 516 | 515 | if (!line) |
|---|
| 517 | 516 | return -ENODEV; |
|---|
| 518 | 517 | serial8250_resume_port(line - 1); |
|---|
| 519 | 518 | return 0; |
|---|
| 520 | 519 | } |
|---|
| 521 | | -#else |
|---|
| 522 | | -#define serial_pnp_suspend NULL |
|---|
| 523 | | -#define serial_pnp_resume NULL |
|---|
| 524 | | -#endif /* CONFIG_PM */ |
|---|
| 520 | + |
|---|
| 521 | +static SIMPLE_DEV_PM_OPS(serial_pnp_pm_ops, serial_pnp_suspend, serial_pnp_resume); |
|---|
| 525 | 522 | |
|---|
| 526 | 523 | static struct pnp_driver serial_pnp_driver = { |
|---|
| 527 | 524 | .name = "serial", |
|---|
| 528 | 525 | .probe = serial_pnp_probe, |
|---|
| 529 | 526 | .remove = serial_pnp_remove, |
|---|
| 530 | | - .suspend = serial_pnp_suspend, |
|---|
| 531 | | - .resume = serial_pnp_resume, |
|---|
| 527 | + .driver = { |
|---|
| 528 | + .pm = &serial_pnp_pm_ops, |
|---|
| 529 | + }, |
|---|
| 532 | 530 | .id_table = pnp_dev_table, |
|---|
| 533 | 531 | }; |
|---|
| 534 | 532 | |
|---|