aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ehea/ehea_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ehea/ehea_main.c')
-rw-r--r--drivers/net/ehea/ehea_main.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index bdb52419dbf5..383144db4d18 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -2923,6 +2923,15 @@ static int check_module_parm(void)
2923 return ret; 2923 return ret;
2924} 2924}
2925 2925
2926static ssize_t ehea_show_capabilities(struct device_driver *drv,
2927 char *buf)
2928{
2929 return sprintf(buf, "%d", EHEA_CAPABILITIES);
2930}
2931
2932static DRIVER_ATTR(capabilities, S_IRUSR | S_IRGRP | S_IROTH,
2933 ehea_show_capabilities, NULL);
2934
2926int __init ehea_module_init(void) 2935int __init ehea_module_init(void)
2927{ 2936{
2928 int ret; 2937 int ret;
@@ -2934,8 +2943,19 @@ int __init ehea_module_init(void)
2934 if (ret) 2943 if (ret)
2935 goto out; 2944 goto out;
2936 ret = ibmebus_register_driver(&ehea_driver); 2945 ret = ibmebus_register_driver(&ehea_driver);
2937 if (ret) 2946 if (ret) {
2938 ehea_error("failed registering eHEA device driver on ebus"); 2947 ehea_error("failed registering eHEA device driver on ebus");
2948 goto out;
2949 }
2950
2951 ret = driver_create_file(&ehea_driver.driver,
2952 &driver_attr_capabilities);
2953 if (ret) {
2954 ehea_error("failed to register capabilities attribute, ret=%d",
2955 ret);
2956 ibmebus_unregister_driver(&ehea_driver);
2957 goto out;
2958 }
2939 2959
2940out: 2960out:
2941 return ret; 2961 return ret;
@@ -2943,6 +2963,7 @@ out:
2943 2963
2944static void __exit ehea_module_exit(void) 2964static void __exit ehea_module_exit(void)
2945{ 2965{
2966 driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities);
2946 ibmebus_unregister_driver(&ehea_driver); 2967 ibmebus_unregister_driver(&ehea_driver);
2947} 2968}
2948 2969