Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipmi: kcs: aspeed: Remove old bindings support

It's been a few releases since we depreciated the "v1" bindings. Remove
support from the driver as all known device trees have been updated to
use the new bindings.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Message-Id: <20220228062840.449215-1-joel@jms.id.au>
Signed-off-by: Corey Minyard <cminyard@mvista.com>

authored by

Joel Stanley and committed by
Corey Minyard
f4676c8e 00d93611

+7 -61
+7 -61
drivers/char/ipmi/kcs_bmc_aspeed.c
··· 128 128 } obe; 129 129 }; 130 130 131 - struct aspeed_kcs_of_ops { 132 - int (*get_channel)(struct platform_device *pdev); 133 - int (*get_io_address)(struct platform_device *pdev, u32 addrs[2]); 134 - }; 135 - 136 131 static inline struct aspeed_kcs_bmc *to_aspeed_kcs_bmc(struct kcs_bmc_device *kcs_bmc) 137 132 { 138 133 return container_of(kcs_bmc, struct aspeed_kcs_bmc, kcs_bmc); ··· 470 475 { .idr = LPC_IDR4, .odr = LPC_ODR4, .str = LPC_STR4 }, 471 476 }; 472 477 473 - static int aspeed_kcs_of_v1_get_channel(struct platform_device *pdev) 474 - { 475 - struct device_node *np; 476 - u32 channel; 477 - int rc; 478 - 479 - np = pdev->dev.of_node; 480 - 481 - rc = of_property_read_u32(np, "kcs_chan", &channel); 482 - if ((rc != 0) || (channel == 0 || channel > KCS_CHANNEL_MAX)) { 483 - dev_err(&pdev->dev, "no valid 'kcs_chan' configured\n"); 484 - return -EINVAL; 485 - } 486 - 487 - return channel; 488 - } 489 - 490 - static int 491 - aspeed_kcs_of_v1_get_io_address(struct platform_device *pdev, u32 addrs[2]) 492 - { 493 - int rc; 494 - 495 - rc = of_property_read_u32(pdev->dev.of_node, "kcs_addr", addrs); 496 - if (rc || addrs[0] > 0xffff) { 497 - dev_err(&pdev->dev, "no valid 'kcs_addr' configured\n"); 498 - return -EINVAL; 499 - } 500 - 501 - return 1; 502 - } 503 - 504 - static int aspeed_kcs_of_v2_get_channel(struct platform_device *pdev) 478 + static int aspeed_kcs_of_get_channel(struct platform_device *pdev) 505 479 { 506 480 struct device_node *np; 507 481 struct kcs_ioreg ioreg; ··· 499 535 if (!memcmp(&ast_kcs_bmc_ioregs[i], &ioreg, sizeof(ioreg))) 500 536 return i + 1; 501 537 } 502 - 503 538 return -EINVAL; 504 539 } 505 540 506 541 static int 507 - aspeed_kcs_of_v2_get_io_address(struct platform_device *pdev, u32 addrs[2]) 542 + aspeed_kcs_of_get_io_address(struct platform_device *pdev, u32 addrs[2]) 508 543 { 509 544 int rc; 510 545 ··· 530 567 531 568 static int aspeed_kcs_probe(struct platform_device *pdev) 532 569 { 533 - const struct aspeed_kcs_of_ops *ops; 534 570 struct kcs_bmc_device *kcs_bmc; 535 571 struct aspeed_kcs_bmc *priv; 536 572 struct device_node *np; ··· 547 585 return -ENODEV; 548 586 } 549 587 550 - ops = of_device_get_match_data(&pdev->dev); 551 - if (!ops) 552 - return -EINVAL; 553 - 554 - channel = ops->get_channel(pdev); 588 + channel = aspeed_kcs_of_get_channel(pdev); 555 589 if (channel < 0) 556 590 return channel; 557 591 558 - nr_addrs = ops->get_io_address(pdev, addrs); 592 + nr_addrs = aspeed_kcs_of_get_io_address(pdev, addrs); 559 593 if (nr_addrs < 0) 560 594 return nr_addrs; 561 595 ··· 636 678 return 0; 637 679 } 638 680 639 - static const struct aspeed_kcs_of_ops of_v1_ops = { 640 - .get_channel = aspeed_kcs_of_v1_get_channel, 641 - .get_io_address = aspeed_kcs_of_v1_get_io_address, 642 - }; 643 - 644 - static const struct aspeed_kcs_of_ops of_v2_ops = { 645 - .get_channel = aspeed_kcs_of_v2_get_channel, 646 - .get_io_address = aspeed_kcs_of_v2_get_io_address, 647 - }; 648 - 649 681 static const struct of_device_id ast_kcs_bmc_match[] = { 650 - { .compatible = "aspeed,ast2400-kcs-bmc", .data = &of_v1_ops }, 651 - { .compatible = "aspeed,ast2500-kcs-bmc", .data = &of_v1_ops }, 652 - { .compatible = "aspeed,ast2400-kcs-bmc-v2", .data = &of_v2_ops }, 653 - { .compatible = "aspeed,ast2500-kcs-bmc-v2", .data = &of_v2_ops }, 654 - { .compatible = "aspeed,ast2600-kcs-bmc", .data = &of_v2_ops }, 682 + { .compatible = "aspeed,ast2400-kcs-bmc-v2" }, 683 + { .compatible = "aspeed,ast2500-kcs-bmc-v2" }, 684 + { .compatible = "aspeed,ast2600-kcs-bmc" }, 655 685 { } 656 686 }; 657 687 MODULE_DEVICE_TABLE(of, ast_kcs_bmc_match);