| .. | .. |
|---|
| 74 | 74 | /* About 10us. This is specific for single IO operations, such as inb */ |
|---|
| 75 | 75 | #define LPC_PEROP_WAITCNT 100 |
|---|
| 76 | 76 | |
|---|
| 77 | | -static int wait_lpc_idle(unsigned char *mbase, unsigned int waitcnt) |
|---|
| 77 | +static int wait_lpc_idle(void __iomem *mbase, unsigned int waitcnt) |
|---|
| 78 | 78 | { |
|---|
| 79 | 79 | u32 status; |
|---|
| 80 | 80 | |
|---|
| .. | .. |
|---|
| 209 | 209 | struct hisi_lpc_dev *lpcdev = hostdata; |
|---|
| 210 | 210 | struct lpc_cycle_para iopara; |
|---|
| 211 | 211 | unsigned long addr; |
|---|
| 212 | | - u32 rd_data = 0; |
|---|
| 212 | + __le32 rd_data = 0; |
|---|
| 213 | 213 | int ret; |
|---|
| 214 | 214 | |
|---|
| 215 | 215 | if (!lpcdev || !dwidth || dwidth > LPC_MAX_DWIDTH) |
|---|
| .. | .. |
|---|
| 244 | 244 | struct lpc_cycle_para iopara; |
|---|
| 245 | 245 | const unsigned char *buf; |
|---|
| 246 | 246 | unsigned long addr; |
|---|
| 247 | + __le32 _val = cpu_to_le32(val); |
|---|
| 247 | 248 | |
|---|
| 248 | 249 | if (!lpcdev || !dwidth || dwidth > LPC_MAX_DWIDTH) |
|---|
| 249 | 250 | return; |
|---|
| 250 | 251 | |
|---|
| 251 | | - val = cpu_to_le32(val); |
|---|
| 252 | | - |
|---|
| 253 | | - buf = (const unsigned char *)&val; |
|---|
| 252 | + buf = (const unsigned char *)&_val; |
|---|
| 254 | 253 | addr = hisi_lpc_pio_to_addr(lpcdev, pio); |
|---|
| 255 | 254 | |
|---|
| 256 | 255 | iopara.opflags = FG_INCRADDR_LPC; |
|---|
| .. | .. |
|---|
| 504 | 503 | { |
|---|
| 505 | 504 | struct acpi_device *adev = ACPI_COMPANION(hostdev); |
|---|
| 506 | 505 | struct acpi_device *child; |
|---|
| 506 | + struct platform_device *pdev; |
|---|
| 507 | 507 | int ret; |
|---|
| 508 | 508 | |
|---|
| 509 | 509 | /* Only consider the children of the host */ |
|---|
| 510 | 510 | list_for_each_entry(child, &adev->children, node) { |
|---|
| 511 | 511 | const char *hid = acpi_device_hid(child); |
|---|
| 512 | 512 | const struct hisi_lpc_acpi_cell *cell; |
|---|
| 513 | | - struct platform_device *pdev; |
|---|
| 514 | 513 | const struct resource *res; |
|---|
| 515 | 514 | bool found = false; |
|---|
| 516 | 515 | int num_res; |
|---|
| .. | .. |
|---|
| 556 | 555 | |
|---|
| 557 | 556 | if (!found) { |
|---|
| 558 | 557 | dev_warn(hostdev, |
|---|
| 559 | | - "could not find cell for child device (%s)\n", |
|---|
| 558 | + "could not find cell for child device (%s), discarding\n", |
|---|
| 560 | 559 | hid); |
|---|
| 561 | | - ret = -ENODEV; |
|---|
| 562 | | - goto fail; |
|---|
| 560 | + continue; |
|---|
| 563 | 561 | } |
|---|
| 564 | 562 | |
|---|
| 565 | 563 | pdev = platform_device_alloc(cell->name, PLATFORM_DEVID_AUTO); |
|---|
| .. | .. |
|---|
| 573 | 571 | |
|---|
| 574 | 572 | ret = platform_device_add_resources(pdev, res, num_res); |
|---|
| 575 | 573 | if (ret) |
|---|
| 576 | | - goto fail; |
|---|
| 574 | + goto fail_put_device; |
|---|
| 577 | 575 | |
|---|
| 578 | 576 | ret = platform_device_add_data(pdev, cell->pdata, |
|---|
| 579 | 577 | cell->pdata_size); |
|---|
| 580 | 578 | if (ret) |
|---|
| 581 | | - goto fail; |
|---|
| 579 | + goto fail_put_device; |
|---|
| 582 | 580 | |
|---|
| 583 | 581 | ret = platform_device_add(pdev); |
|---|
| 584 | 582 | if (ret) |
|---|
| 585 | | - goto fail; |
|---|
| 583 | + goto fail_put_device; |
|---|
| 586 | 584 | |
|---|
| 587 | 585 | acpi_device_set_enumerated(child); |
|---|
| 588 | 586 | } |
|---|
| 589 | 587 | |
|---|
| 590 | 588 | return 0; |
|---|
| 591 | 589 | |
|---|
| 590 | +fail_put_device: |
|---|
| 591 | + platform_device_put(pdev); |
|---|
| 592 | 592 | fail: |
|---|
| 593 | 593 | hisi_lpc_acpi_remove(hostdev); |
|---|
| 594 | 594 | return ret; |
|---|