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

drivers/tty: make ehv_bytechan.c explicitly non-modular

The Kconfig currently controlling compilation of this code is:

drivers/tty/Kconfig:config PPC_EPAPR_HV_BYTECHAN
drivers/tty/Kconfig: bool "ePAPR hypervisor byte channel driver"

...meaning that it currently is not being built as a module by anyone.

Lets remove the modular code that is essentially orphaned, so that
when reading the driver there is no doubt it is builtin-only.

We explicitly disallow a driver unbind, since that doesn't have a
sensible use case anyway, and it allows us to drop the ".remove"
code for non-modular drivers.

Since module_init translates to device_initcall in the non-modular
case, the init ordering remains unchanged with this commit.

We also delete the MODULE_LICENSE tag etc. since all that information
is already contained at the top of the file in the comments.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Paul Gortmaker and committed by
Greg Kroah-Hartman
fc7f47bf e3c5fc4d

+3 -37
+3 -37
drivers/tty/ehv_bytechan.c
··· 23 23 * byte channel used for the console is designated as the default tty. 24 24 */ 25 25 26 - #include <linux/module.h> 27 26 #include <linux/init.h> 28 27 #include <linux/slab.h> 29 28 #include <linux/err.h> ··· 718 719 return ret; 719 720 } 720 721 721 - static int ehv_bc_tty_remove(struct platform_device *pdev) 722 - { 723 - struct ehv_bc_data *bc = dev_get_drvdata(&pdev->dev); 724 - 725 - tty_unregister_device(ehv_bc_driver, bc - bcs); 726 - 727 - tty_port_destroy(&bc->port); 728 - irq_dispose_mapping(bc->tx_irq); 729 - irq_dispose_mapping(bc->rx_irq); 730 - 731 - return 0; 732 - } 733 - 734 722 static const struct of_device_id ehv_bc_tty_of_ids[] = { 735 723 { .compatible = "epapr,hv-byte-channel" }, 736 724 {} ··· 727 741 .driver = { 728 742 .name = "ehv-bc", 729 743 .of_match_table = ehv_bc_tty_of_ids, 744 + .suppress_bind_attrs = true, 730 745 }, 731 746 .probe = ehv_bc_tty_probe, 732 - .remove = ehv_bc_tty_remove, 733 747 }; 734 748 735 749 /** 736 750 * ehv_bc_init - ePAPR hypervisor byte channel driver initialization 737 751 * 738 - * This function is called when this module is loaded. 752 + * This function is called when this driver is loaded. 739 753 */ 740 754 static int __init ehv_bc_init(void) 741 755 { ··· 800 814 801 815 return ret; 802 816 } 803 - 804 - 805 - /** 806 - * ehv_bc_exit - ePAPR hypervisor byte channel driver termination 807 - * 808 - * This function is called when this driver is unloaded. 809 - */ 810 - static void __exit ehv_bc_exit(void) 811 - { 812 - platform_driver_unregister(&ehv_bc_tty_driver); 813 - tty_unregister_driver(ehv_bc_driver); 814 - put_tty_driver(ehv_bc_driver); 815 - kfree(bcs); 816 - } 817 - 818 - module_init(ehv_bc_init); 819 - module_exit(ehv_bc_exit); 820 - 821 - MODULE_AUTHOR("Timur Tabi <timur@freescale.com>"); 822 - MODULE_DESCRIPTION("ePAPR hypervisor byte channel driver"); 823 - MODULE_LICENSE("GPL v2"); 817 + device_initcall(ehv_bc_init);