diff options
| author | Andrzej Pietrasiewicz <andrzej.p@samsung.com> | 2013-10-09 04:08:28 -0400 |
|---|---|---|
| committer | Felipe Balbi <balbi@ti.com> | 2013-10-10 11:24:53 -0400 |
| commit | 7a93d040e01ec9053ec6ea4486f21829d48f903a (patch) | |
| tree | f7f52ee29c0fc3567e69ca9cabf3744f8f3f9f6b | |
| parent | 1bcce939478f894b46a592aed28ccc9caaf1a52a (diff) | |
usb: gadget: f_mass_storage: remove compatibility layer
There are no more old interface users left. Remove it.
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
| -rw-r--r-- | drivers/usb/gadget/f_mass_storage.c | 150 | ||||
| -rw-r--r-- | drivers/usb/gadget/f_mass_storage.h | 21 |
2 files changed, 19 insertions, 152 deletions
diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c index 00d3687594bb..6e5a6daf1a12 100644 --- a/drivers/usb/gadget/f_mass_storage.c +++ b/drivers/usb/gadget/f_mass_storage.c | |||
| @@ -228,13 +228,6 @@ | |||
| 228 | #define FSG_DRIVER_DESC "Mass Storage Function" | 228 | #define FSG_DRIVER_DESC "Mass Storage Function" |
| 229 | #define FSG_DRIVER_VERSION "2009/09/11" | 229 | #define FSG_DRIVER_VERSION "2009/09/11" |
| 230 | 230 | ||
| 231 | /* to avoid a lot of #ifndef-#endif in the temporary compatibility layer */ | ||
| 232 | #ifndef USB_FMS_INCLUDED | ||
| 233 | #define EXPORT_SYMBOL_GPL_IF_MODULE(m) EXPORT_SYMBOL_GPL(m); | ||
| 234 | #else | ||
| 235 | #define EXPORT_SYMBOL_GPL_IF_MODULE(m) | ||
| 236 | #endif | ||
| 237 | |||
| 238 | static const char fsg_string_interface[] = "Mass Storage"; | 231 | static const char fsg_string_interface[] = "Mass Storage"; |
| 239 | 232 | ||
| 240 | #include "storage_common.h" | 233 | #include "storage_common.h" |
| @@ -2651,13 +2644,13 @@ void fsg_common_get(struct fsg_common *common) | |||
| 2651 | { | 2644 | { |
| 2652 | kref_get(&common->ref); | 2645 | kref_get(&common->ref); |
| 2653 | } | 2646 | } |
| 2654 | EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_get); | 2647 | EXPORT_SYMBOL_GPL(fsg_common_get); |
| 2655 | 2648 | ||
| 2656 | void fsg_common_put(struct fsg_common *common) | 2649 | void fsg_common_put(struct fsg_common *common) |
| 2657 | { | 2650 | { |
| 2658 | kref_put(&common->ref, fsg_common_release); | 2651 | kref_put(&common->ref, fsg_common_release); |
| 2659 | } | 2652 | } |
| 2660 | EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_put); | 2653 | EXPORT_SYMBOL_GPL(fsg_common_put); |
| 2661 | 2654 | ||
| 2662 | /* check if fsg_num_buffers is within a valid range */ | 2655 | /* check if fsg_num_buffers is within a valid range */ |
| 2663 | static inline int fsg_num_buffers_validate(unsigned int fsg_num_buffers) | 2656 | static inline int fsg_num_buffers_validate(unsigned int fsg_num_buffers) |
| @@ -2669,7 +2662,7 @@ static inline int fsg_num_buffers_validate(unsigned int fsg_num_buffers) | |||
| 2669 | return -EINVAL; | 2662 | return -EINVAL; |
| 2670 | } | 2663 | } |
| 2671 | 2664 | ||
| 2672 | static struct fsg_common *fsg_common_setup(struct fsg_common *common, bool zero) | 2665 | static struct fsg_common *fsg_common_setup(struct fsg_common *common) |
| 2673 | { | 2666 | { |
| 2674 | if (!common) { | 2667 | if (!common) { |
| 2675 | common = kzalloc(sizeof(*common), GFP_KERNEL); | 2668 | common = kzalloc(sizeof(*common), GFP_KERNEL); |
| @@ -2677,8 +2670,6 @@ static struct fsg_common *fsg_common_setup(struct fsg_common *common, bool zero) | |||
| 2677 | return ERR_PTR(-ENOMEM); | 2670 | return ERR_PTR(-ENOMEM); |
| 2678 | common->free_storage_on_release = 1; | 2671 | common->free_storage_on_release = 1; |
| 2679 | } else { | 2672 | } else { |
| 2680 | if (zero) | ||
| 2681 | memset(common, 0, sizeof(*common)); | ||
| 2682 | common->free_storage_on_release = 0; | 2673 | common->free_storage_on_release = 0; |
| 2683 | } | 2674 | } |
| 2684 | init_rwsem(&common->filesem); | 2675 | init_rwsem(&common->filesem); |
| @@ -2695,7 +2686,7 @@ void fsg_common_set_sysfs(struct fsg_common *common, bool sysfs) | |||
| 2695 | { | 2686 | { |
| 2696 | common->sysfs = sysfs; | 2687 | common->sysfs = sysfs; |
| 2697 | } | 2688 | } |
| 2698 | EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_set_sysfs); | 2689 | EXPORT_SYMBOL_GPL(fsg_common_set_sysfs); |
| 2699 | 2690 | ||
| 2700 | static void _fsg_common_free_buffers(struct fsg_buffhd *buffhds, unsigned n) | 2691 | static void _fsg_common_free_buffers(struct fsg_buffhd *buffhds, unsigned n) |
| 2701 | { | 2692 | { |
| @@ -2751,7 +2742,7 @@ error_release: | |||
| 2751 | 2742 | ||
| 2752 | return -ENOMEM; | 2743 | return -ENOMEM; |
| 2753 | } | 2744 | } |
| 2754 | EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_set_num_buffers); | 2745 | EXPORT_SYMBOL_GPL(fsg_common_set_num_buffers); |
| 2755 | 2746 | ||
| 2756 | static inline void fsg_common_remove_sysfs(struct fsg_lun *lun) | 2747 | static inline void fsg_common_remove_sysfs(struct fsg_lun *lun) |
| 2757 | { | 2748 | { |
| @@ -2790,7 +2781,7 @@ void fsg_common_remove_lun(struct fsg_lun *lun, bool sysfs) | |||
| 2790 | fsg_lun_close(lun); | 2781 | fsg_lun_close(lun); |
| 2791 | kfree(lun); | 2782 | kfree(lun); |
| 2792 | } | 2783 | } |
| 2793 | EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_remove_lun); | 2784 | EXPORT_SYMBOL_GPL(fsg_common_remove_lun); |
| 2794 | 2785 | ||
| 2795 | static void _fsg_common_remove_luns(struct fsg_common *common, int n) | 2786 | static void _fsg_common_remove_luns(struct fsg_common *common, int n) |
| 2796 | { | 2787 | { |
| @@ -2802,7 +2793,7 @@ static void _fsg_common_remove_luns(struct fsg_common *common, int n) | |||
| 2802 | common->luns[i] = NULL; | 2793 | common->luns[i] = NULL; |
| 2803 | } | 2794 | } |
| 2804 | } | 2795 | } |
| 2805 | EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_remove_luns); | 2796 | EXPORT_SYMBOL_GPL(fsg_common_remove_luns); |
| 2806 | 2797 | ||
| 2807 | void fsg_common_remove_luns(struct fsg_common *common) | 2798 | void fsg_common_remove_luns(struct fsg_common *common) |
| 2808 | { | 2799 | { |
| @@ -2815,7 +2806,7 @@ void fsg_common_free_luns(struct fsg_common *common) | |||
| 2815 | kfree(common->luns); | 2806 | kfree(common->luns); |
| 2816 | common->luns = NULL; | 2807 | common->luns = NULL; |
| 2817 | } | 2808 | } |
| 2818 | EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_free_luns); | 2809 | EXPORT_SYMBOL_GPL(fsg_common_free_luns); |
| 2819 | 2810 | ||
| 2820 | int fsg_common_set_nluns(struct fsg_common *common, int nluns) | 2811 | int fsg_common_set_nluns(struct fsg_common *common, int nluns) |
| 2821 | { | 2812 | { |
| @@ -2841,21 +2832,21 @@ int fsg_common_set_nluns(struct fsg_common *common, int nluns) | |||
| 2841 | 2832 | ||
| 2842 | return 0; | 2833 | return 0; |
| 2843 | } | 2834 | } |
| 2844 | EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_set_nluns); | 2835 | EXPORT_SYMBOL_GPL(fsg_common_set_nluns); |
| 2845 | 2836 | ||
| 2846 | void fsg_common_set_ops(struct fsg_common *common, | 2837 | void fsg_common_set_ops(struct fsg_common *common, |
| 2847 | const struct fsg_operations *ops) | 2838 | const struct fsg_operations *ops) |
| 2848 | { | 2839 | { |
| 2849 | common->ops = ops; | 2840 | common->ops = ops; |
| 2850 | } | 2841 | } |
| 2851 | EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_set_ops); | 2842 | EXPORT_SYMBOL_GPL(fsg_common_set_ops); |
| 2852 | 2843 | ||
| 2853 | void fsg_common_free_buffers(struct fsg_common *common) | 2844 | void fsg_common_free_buffers(struct fsg_common *common) |
| 2854 | { | 2845 | { |
| 2855 | _fsg_common_free_buffers(common->buffhds, common->fsg_num_buffers); | 2846 | _fsg_common_free_buffers(common->buffhds, common->fsg_num_buffers); |
| 2856 | common->buffhds = NULL; | 2847 | common->buffhds = NULL; |
| 2857 | } | 2848 | } |
| 2858 | EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_free_buffers); | 2849 | EXPORT_SYMBOL_GPL(fsg_common_free_buffers); |
| 2859 | 2850 | ||
| 2860 | int fsg_common_set_cdev(struct fsg_common *common, | 2851 | int fsg_common_set_cdev(struct fsg_common *common, |
| 2861 | struct usb_composite_dev *cdev, bool can_stall) | 2852 | struct usb_composite_dev *cdev, bool can_stall) |
| @@ -2883,7 +2874,7 @@ int fsg_common_set_cdev(struct fsg_common *common, | |||
| 2883 | 2874 | ||
| 2884 | return 0; | 2875 | return 0; |
| 2885 | } | 2876 | } |
| 2886 | EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_set_cdev); | 2877 | EXPORT_SYMBOL_GPL(fsg_common_set_cdev); |
| 2887 | 2878 | ||
| 2888 | static inline int fsg_common_add_sysfs(struct fsg_common *common, | 2879 | static inline int fsg_common_add_sysfs(struct fsg_common *common, |
| 2889 | struct fsg_lun *lun) | 2880 | struct fsg_lun *lun) |
| @@ -3006,7 +2997,7 @@ error_sysfs: | |||
| 3006 | kfree(lun); | 2997 | kfree(lun); |
| 3007 | return rc; | 2998 | return rc; |
| 3008 | } | 2999 | } |
| 3009 | EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_create_lun); | 3000 | EXPORT_SYMBOL_GPL(fsg_common_create_lun); |
| 3010 | 3001 | ||
| 3011 | int fsg_common_create_luns(struct fsg_common *common, struct fsg_config *cfg) | 3002 | int fsg_common_create_luns(struct fsg_common *common, struct fsg_config *cfg) |
| 3012 | { | 3003 | { |
| @@ -3028,7 +3019,7 @@ fail: | |||
| 3028 | _fsg_common_remove_luns(common, i); | 3019 | _fsg_common_remove_luns(common, i); |
| 3029 | return rc; | 3020 | return rc; |
| 3030 | } | 3021 | } |
| 3031 | EXPORT_SYMBOL_GPL_IF_MODULE(fsg_common_create_luns); | 3022 | EXPORT_SYMBOL_GPL(fsg_common_create_luns); |
| 3032 | 3023 | ||
| 3033 | void fsg_common_set_inquiry_string(struct fsg_common *common, const char *vn, | 3024 | void fsg_common_set_inquiry_string(struct fsg_common *common, const char *vn, |
| 3034 | const char *pn) | 3025 | const char *pn) |
| @@ -3045,7 +3036,7 @@ void fsg_common_set_inquiry_string(struct fsg_common *common, const char *vn, | |||
| 3045 | : "File-Stor Gadget"), | 3036 | : "File-Stor Gadget"), |
| 3046 | <|||
