diff options
Diffstat (limited to 'drivers/usb/gadget/function/f_printer.c')
-rw-r--r-- | drivers/usb/gadget/function/f_printer.c | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/drivers/usb/gadget/function/f_printer.c b/drivers/usb/gadget/function/f_printer.c index 7fb3209ed52c..0fbfb2b2aa08 100644 --- a/drivers/usb/gadget/function/f_printer.c +++ b/drivers/usb/gadget/function/f_printer.c | |||
@@ -1146,9 +1146,6 @@ static inline struct f_printer_opts | |||
1146 | func_inst.group); | 1146 | func_inst.group); |
1147 | } | 1147 | } |
1148 | 1148 | ||
1149 | CONFIGFS_ATTR_STRUCT(f_printer_opts); | ||
1150 | CONFIGFS_ATTR_OPS(f_printer_opts); | ||
1151 | |||
1152 | static void printer_attr_release(struct config_item *item) | 1149 | static void printer_attr_release(struct config_item *item) |
1153 | { | 1150 | { |
1154 | struct f_printer_opts *opts = to_f_printer_opts(item); | 1151 | struct f_printer_opts *opts = to_f_printer_opts(item); |
@@ -1158,13 +1155,12 @@ static void printer_attr_release(struct config_item *item) | |||
1158 | 1155 | ||
1159 | static struct configfs_item_operations printer_item_ops = { | 1156 | static struct configfs_item_operations printer_item_ops = { |
1160 | .release = printer_attr_release, | 1157 | .release = printer_attr_release, |
1161 | .show_attribute = f_printer_opts_attr_show, | ||
1162 | .store_attribute = f_printer_opts_attr_store, | ||
1163 | }; | 1158 | }; |
1164 | 1159 | ||
1165 | static ssize_t f_printer_opts_pnp_string_show(struct f_printer_opts *opts, | 1160 | static ssize_t f_printer_opts_pnp_string_show(struct config_item *item, |
1166 | char *page) | 1161 | char *page) |
1167 | { | 1162 | { |
1163 | struct f_printer_opts *opts = to_f_printer_opts(item); | ||
1168 | int result; | 1164 | int result; |
1169 | 1165 | ||
1170 | mutex_lock(&opts->lock); | 1166 | mutex_lock(&opts->lock); |
@@ -1174,9 +1170,10 @@ static ssize_t f_printer_opts_pnp_string_show(struct f_printer_opts *opts, | |||
1174 | return result; | 1170 | return result; |
1175 | } | 1171 | } |
1176 | 1172 | ||
1177 | static ssize_t f_printer_opts_pnp_string_store(struct f_printer_opts *opts, | 1173 | static ssize_t f_printer_opts_pnp_string_store(struct config_item *item, |
1178 | const char *page, size_t len) | 1174 | const char *page, size_t len) |
1179 | { | 1175 | { |
1176 | struct f_printer_opts *opts = to_f_printer_opts(item); | ||
1180 | int result, l; | 1177 | int result, l; |
1181 | 1178 | ||
1182 | mutex_lock(&opts->lock); | 1179 | mutex_lock(&opts->lock); |
@@ -1189,14 +1186,12 @@ static ssize_t f_printer_opts_pnp_string_store(struct f_printer_opts *opts, | |||
1189 | return result; | 1186 | return result; |
1190 | } | 1187 | } |
1191 | 1188 | ||
1192 | static struct f_printer_opts_attribute f_printer_opts_pnp_string = | 1189 | CONFIGFS_ATTR(f_printer_opts_, pnp_string); |
1193 | __CONFIGFS_ATTR(pnp_string, S_IRUGO | S_IWUSR, | ||
1194 | f_printer_opts_pnp_string_show, | ||
1195 | f_printer_opts_pnp_string_store); | ||
1196 | 1190 | ||
1197 | static ssize_t f_printer_opts_q_len_show(struct f_printer_opts *opts, | 1191 | static ssize_t f_printer_opts_q_len_show(struct config_item *item, |
1198 | char *page) | 1192 | char *page) |
1199 | { | 1193 | { |
1194 | struct f_printer_opts *opts = to_f_printer_opts(item); | ||
1200 | int result; | 1195 | int result; |
1201 | 1196 | ||
1202 | mutex_lock(&opts->lock); | 1197 | mutex_lock(&opts->lock); |
@@ -1206,9 +1201,10 @@ static ssize_t f_printer_opts_q_len_show(struct f_printer_opts *opts, | |||
1206 | return result; | 1201 | return result; |
1207 | } | 1202 | } |
1208 | 1203 | ||
1209 | static ssize_t f_printer_opts_q_len_store(struct f_printer_opts *opts, | 1204 | static ssize_t f_printer_opts_q_len_store(struct config_item *item, |
1210 | const char *page, size_t len) | 1205 | const char *page, size_t len) |
1211 | { | 1206 | { |
1207 | struct f_printer_opts *opts = to_f_printer_opts(item); | ||
1212 | int ret; | 1208 | int ret; |
1213 | u16 num; | 1209 | u16 num; |
1214 | 1210 | ||
@@ -1229,13 +1225,11 @@ end: | |||
1229 | return ret; | 1225 | return ret; |
1230 | } | 1226 | } |
1231 | 1227 | ||
1232 | static struct f_printer_opts_attribute f_printer_opts_q_len = | 1228 | CONFIGFS_ATTR(f_printer_opts_, q_len); |
1233 | __CONFIGFS_ATTR(q_len, S_IRUGO | S_IWUSR, f_printer_opts_q_len_show, | ||
1234 | f_printer_opts_q_len_store); | ||
1235 | 1229 | ||
1236 | static struct configfs_attribute *printer_attrs[] = { | 1230 | static struct configfs_attribute *printer_attrs[] = { |
1237 | &f_printer_opts_pnp_string.attr, | 1231 | &f_printer_opts_attr_pnp_string, |
1238 | &f_printer_opts_q_len.attr, | 1232 | &f_printer_opts_attr_q_len, |
1239 | NULL, | 1233 | NULL, |
1240 | }; | 1234 | }; |
1241 | 1235 | ||