Commit 34aec07c170b972a29c954b37047184bd0f9f294
Committed by
Martin Schwidefsky
1 parent
b730f3a933
Exists in
master
and in
7 other branches
[S390] chsc: initialization fixes
This patch fixes: * kfree vs. free_page usage * structure definition for determine_css_characteristics * naming convention for the chsc init function * deregistration of crw handlers in the cleanup path Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Showing 3 changed files with 17 additions and 17 deletions Side-by-side Diff
drivers/s390/cio/chsc.c
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | * drivers/s390/cio/chsc.c |
3 | 3 | * S/390 common I/O routines -- channel subsystem call |
4 | 4 | * |
5 | - * Copyright IBM Corp. 1999,2008 | |
5 | + * Copyright IBM Corp. 1999,2010 | |
6 | 6 | * Author(s): Ingo Adlung (adlung@de.ibm.com) |
7 | 7 | * Cornelia Huck (cornelia.huck@de.ibm.com) |
8 | 8 | * Arnd Bergmann (arndb@de.ibm.com) |
... | ... | @@ -813,7 +813,7 @@ |
813 | 813 | return ret; |
814 | 814 | } |
815 | 815 | |
816 | -int __init chsc_alloc_sei_area(void) | |
816 | +int __init chsc_init(void) | |
817 | 817 | { |
818 | 818 | int ret; |
819 | 819 | |
820 | 820 | |
821 | 821 | |
... | ... | @@ -825,14 +825,14 @@ |
825 | 825 | } |
826 | 826 | ret = crw_register_handler(CRW_RSC_CSS, chsc_process_crw); |
827 | 827 | if (ret) |
828 | - kfree(sei_page); | |
828 | + free_page((unsigned long)sei_page); | |
829 | 829 | return ret; |
830 | 830 | } |
831 | 831 | |
832 | -void __init chsc_free_sei_area(void) | |
832 | +void __init chsc_init_cleanup(void) | |
833 | 833 | { |
834 | 834 | crw_unregister_handler(CRW_RSC_CSS); |
835 | - kfree(sei_page); | |
835 | + free_page((unsigned long)sei_page); | |
836 | 836 | } |
837 | 837 | |
838 | 838 | int chsc_enable_facility(int operation_code) |
... | ... | @@ -895,7 +895,7 @@ |
895 | 895 | struct chsc_header response; |
896 | 896 | u32 reserved4; |
897 | 897 | u32 general_char[510]; |
898 | - u32 chsc_char[518]; | |
898 | + u32 chsc_char[508]; | |
899 | 899 | } __attribute__ ((packed)) *scsc_area; |
900 | 900 | |
901 | 901 | scsc_area = (void *)get_zeroed_page(GFP_KERNEL | GFP_DMA); |
drivers/s390/cio/chsc.h
... | ... | @@ -60,8 +60,8 @@ |
60 | 60 | extern int chsc_get_ssd_info(struct subchannel_id schid, |
61 | 61 | struct chsc_ssd_info *ssd); |
62 | 62 | extern int chsc_determine_css_characteristics(void); |
63 | -extern int chsc_alloc_sei_area(void); | |
64 | -extern void chsc_free_sei_area(void); | |
63 | +extern int chsc_init(void); | |
64 | +extern void chsc_init_cleanup(void); | |
65 | 65 | |
66 | 66 | extern int chsc_enable_facility(int); |
67 | 67 | struct channel_subsystem; |
drivers/s390/cio/css.c
1 | 1 | /* |
2 | 2 | * driver for channel subsystem |
3 | 3 | * |
4 | - * Copyright IBM Corp. 2002, 2009 | |
4 | + * Copyright IBM Corp. 2002, 2010 | |
5 | 5 | * |
6 | 6 | * Author(s): Arnd Bergmann (arndb@de.ibm.com) |
7 | 7 | * Cornelia Huck (cornelia.huck@de.ibm.com) |
8 | 8 | |
... | ... | @@ -863,14 +863,14 @@ |
863 | 863 | { |
864 | 864 | int ret, i; |
865 | 865 | |
866 | + ret = chsc_init(); | |
867 | + if (ret) | |
868 | + return ret; | |
869 | + | |
866 | 870 | ret = chsc_determine_css_characteristics(); |
867 | 871 | if (ret == -ENOMEM) |
868 | 872 | goto out; |
869 | 873 | |
870 | - ret = chsc_alloc_sei_area(); | |
871 | - if (ret) | |
872 | - goto out; | |
873 | - | |
874 | 874 | /* Try to enable MSS. */ |
875 | 875 | ret = chsc_enable_facility(CHSC_SDA_OC_MSS); |
876 | 876 | if (ret) |
877 | 877 | |
... | ... | @@ -956,9 +956,9 @@ |
956 | 956 | } |
957 | 957 | bus_unregister(&css_bus_type); |
958 | 958 | out: |
959 | - crw_unregister_handler(CRW_RSC_CSS); | |
960 | - chsc_free_sei_area(); | |
959 | + crw_unregister_handler(CRW_RSC_SCH); | |
961 | 960 | idset_free(slow_subchannel_set); |
961 | + chsc_init_cleanup(); | |
962 | 962 | pr_alert("The CSS device driver initialization failed with " |
963 | 963 | "errno=%d\n", ret); |
964 | 964 | return ret; |
965 | 965 | |
... | ... | @@ -978,9 +978,9 @@ |
978 | 978 | device_unregister(&css->device); |
979 | 979 | } |
980 | 980 | bus_unregister(&css_bus_type); |
981 | - crw_unregister_handler(CRW_RSC_CSS); | |
982 | - chsc_free_sei_area(); | |
981 | + crw_unregister_handler(CRW_RSC_SCH); | |
983 | 982 | idset_free(slow_subchannel_set); |
983 | + chsc_init_cleanup(); | |
984 | 984 | isc_unregister(IO_SCH_ISC); |
985 | 985 | } |
986 | 986 |