]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - drivers/usb/gadget/function/f_printer.c
Merge remote-tracking branch 'target-updates/for-next'
[karo-tx-linux.git] / drivers / usb / gadget / function / f_printer.c
index 7fb3209ed52c31c662b24b1799e78ff9a4d38700..0fbfb2b2aa08b3ade8e4b487d012188687b29e05 100644 (file)
@@ -1146,9 +1146,6 @@ static inline struct f_printer_opts
                            func_inst.group);
 }
 
-CONFIGFS_ATTR_STRUCT(f_printer_opts);
-CONFIGFS_ATTR_OPS(f_printer_opts);
-
 static void printer_attr_release(struct config_item *item)
 {
        struct f_printer_opts *opts = to_f_printer_opts(item);
@@ -1158,13 +1155,12 @@ static void printer_attr_release(struct config_item *item)
 
 static struct configfs_item_operations printer_item_ops = {
        .release        = printer_attr_release,
-       .show_attribute = f_printer_opts_attr_show,
-       .store_attribute = f_printer_opts_attr_store,
 };
 
-static ssize_t f_printer_opts_pnp_string_show(struct f_printer_opts *opts,
+static ssize_t f_printer_opts_pnp_string_show(struct config_item *item,
                                              char *page)
 {
+       struct f_printer_opts *opts = to_f_printer_opts(item);
        int result;
 
        mutex_lock(&opts->lock);
@@ -1174,9 +1170,10 @@ static ssize_t f_printer_opts_pnp_string_show(struct f_printer_opts *opts,
        return result;
 }
 
-static ssize_t f_printer_opts_pnp_string_store(struct f_printer_opts *opts,
+static ssize_t f_printer_opts_pnp_string_store(struct config_item *item,
                                               const char *page, size_t len)
 {
+       struct f_printer_opts *opts = to_f_printer_opts(item);
        int result, l;
 
        mutex_lock(&opts->lock);
@@ -1189,14 +1186,12 @@ static ssize_t f_printer_opts_pnp_string_store(struct f_printer_opts *opts,
        return result;
 }
 
-static struct f_printer_opts_attribute f_printer_opts_pnp_string =
-       __CONFIGFS_ATTR(pnp_string, S_IRUGO | S_IWUSR,
-                       f_printer_opts_pnp_string_show,
-                       f_printer_opts_pnp_string_store);
+CONFIGFS_ATTR(f_printer_opts_, pnp_string);
 
-static ssize_t f_printer_opts_q_len_show(struct f_printer_opts *opts,
+static ssize_t f_printer_opts_q_len_show(struct config_item *item,
                                         char *page)
 {
+       struct f_printer_opts *opts = to_f_printer_opts(item);
        int result;
 
        mutex_lock(&opts->lock);
@@ -1206,9 +1201,10 @@ static ssize_t f_printer_opts_q_len_show(struct f_printer_opts *opts,
        return result;
 }
 
-static ssize_t f_printer_opts_q_len_store(struct f_printer_opts *opts,
+static ssize_t f_printer_opts_q_len_store(struct config_item *item,
                                          const char *page, size_t len)
 {
+       struct f_printer_opts *opts = to_f_printer_opts(item);
        int ret;
        u16 num;
 
@@ -1229,13 +1225,11 @@ end:
        return ret;
 }
 
-static struct f_printer_opts_attribute f_printer_opts_q_len =
-       __CONFIGFS_ATTR(q_len, S_IRUGO | S_IWUSR, f_printer_opts_q_len_show,
-                       f_printer_opts_q_len_store);
+CONFIGFS_ATTR(f_printer_opts_, q_len);
 
 static struct configfs_attribute *printer_attrs[] = {
-       &f_printer_opts_pnp_string.attr,
-       &f_printer_opts_q_len.attr,
+       &f_printer_opts_attr_pnp_string,
+       &f_printer_opts_attr_q_len,
        NULL,
 };