1915ad821688628ca2ff93be29f65e004f017965
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / base / firmware_class.c
1 /*
2  * firmware_class.c - Multi purpose firmware loading support
3  *
4  * Copyright (c) 2003 Manuel Estrada Sainz
5  *
6  * Please see Documentation/firmware_class/ for more information.
7  *
8  */
9
10 #include <linux/capability.h>
11 #include <linux/device.h>
12 #include <linux/module.h>
13 #include <linux/init.h>
14 #include <linux/timer.h>
15 #include <linux/vmalloc.h>
16 #include <linux/interrupt.h>
17 #include <linux/bitops.h>
18 #include <linux/mutex.h>
19 #include <linux/workqueue.h>
20 #include <linux/highmem.h>
21 #include <linux/firmware.h>
22 #include <linux/slab.h>
23 #include <linux/sched.h>
24
25 MODULE_AUTHOR("Manuel Estrada Sainz");
26 MODULE_DESCRIPTION("Multi purpose firmware loading support");
27 MODULE_LICENSE("GPL");
28
29 /* Builtin firmware support */
30
31 #ifdef CONFIG_FW_LOADER
32
33 extern struct builtin_fw __start_builtin_fw[];
34 extern struct builtin_fw __end_builtin_fw[];
35
36 static bool fw_get_builtin_firmware(struct firmware *fw, const char *name)
37 {
38         struct builtin_fw *b_fw;
39
40         for (b_fw = __start_builtin_fw; b_fw != __end_builtin_fw; b_fw++) {
41                 if (strcmp(name, b_fw->name) == 0) {
42                         fw->size = b_fw->size;
43                         fw->data = b_fw->data;
44                         return true;
45                 }
46         }
47
48         return false;
49 }
50
51 static bool fw_is_builtin_firmware(const struct firmware *fw)
52 {
53         struct builtin_fw *b_fw;
54
55         for (b_fw = __start_builtin_fw; b_fw != __end_builtin_fw; b_fw++)
56                 if (fw->data == b_fw->data)
57                         return true;
58
59         return false;
60 }
61
62 #else /* Module case - no builtin firmware support */
63
64 static inline bool fw_get_builtin_firmware(struct firmware *fw, const char *name)
65 {
66         return false;
67 }
68
69 static inline bool fw_is_builtin_firmware(const struct firmware *fw)
70 {
71         return false;
72 }
73 #endif
74
75 enum {
76         FW_STATUS_LOADING,
77         FW_STATUS_DONE,
78         FW_STATUS_ABORT,
79 };
80
81 static int loading_timeout = 60;        /* In seconds */
82
83 static inline long firmware_loading_timeout(void)
84 {
85         return loading_timeout > 0 ? loading_timeout * HZ : MAX_SCHEDULE_TIMEOUT;
86 }
87
88 /* fw_lock could be moved to 'struct firmware_priv' but since it is just
89  * guarding for corner cases a global lock should be OK */
90 static DEFINE_MUTEX(fw_lock);
91
92 struct firmware_priv {
93         struct completion completion;
94         struct firmware *fw;
95         unsigned long status;
96         void *data;
97         size_t size;
98         struct page **pages;
99         int nr_pages;
100         int page_array_size;
101         struct timer_list timeout;
102         struct device dev;
103         bool nowait;
104         char fw_id[];
105 };
106
107 static struct firmware_priv *to_firmware_priv(struct device *dev)
108 {
109         return container_of(dev, struct firmware_priv, dev);
110 }
111
112 static void fw_load_abort(struct firmware_priv *fw_priv)
113 {
114         set_bit(FW_STATUS_ABORT, &fw_priv->status);
115         wmb();
116         complete(&fw_priv->completion);
117 }
118
119 static ssize_t firmware_timeout_show(struct class *class,
120                                      struct class_attribute *attr,
121                                      char *buf)
122 {
123         return sprintf(buf, "%d\n", loading_timeout);
124 }
125
126 /**
127  * firmware_timeout_store - set number of seconds to wait for firmware
128  * @class: device class pointer
129  * @attr: device attribute pointer
130  * @buf: buffer to scan for timeout value
131  * @count: number of bytes in @buf
132  *
133  *      Sets the number of seconds to wait for the firmware.  Once
134  *      this expires an error will be returned to the driver and no
135  *      firmware will be provided.
136  *
137  *      Note: zero means 'wait forever'.
138  **/
139 static ssize_t firmware_timeout_store(struct class *class,
140                                       struct class_attribute *attr,
141                                       const char *buf, size_t count)
142 {
143         loading_timeout = simple_strtol(buf, NULL, 10);
144         if (loading_timeout < 0)
145                 loading_timeout = 0;
146
147         return count;
148 }
149
150 static struct class_attribute firmware_class_attrs[] = {
151         __ATTR(timeout, S_IWUSR | S_IRUGO,
152                 firmware_timeout_show, firmware_timeout_store),
153         __ATTR_NULL
154 };
155
156 static void fw_dev_release(struct device *dev)
157 {
158         struct firmware_priv *fw_priv = to_firmware_priv(dev);
159         int i;
160
161         /* free untransfered pages buffer */
162         for (i = 0; i < fw_priv->nr_pages; i++)
163                 __free_page(fw_priv->pages[i]);
164         kfree(fw_priv->pages);
165
166         kfree(fw_priv);
167
168         module_put(THIS_MODULE);
169 }
170
171 static int firmware_uevent(struct device *dev, struct kobj_uevent_env *env)
172 {
173         struct firmware_priv *fw_priv = to_firmware_priv(dev);
174
175         if (add_uevent_var(env, "FIRMWARE=%s", fw_priv->fw_id))
176                 return -ENOMEM;
177         if (add_uevent_var(env, "TIMEOUT=%i", loading_timeout))
178                 return -ENOMEM;
179         if (add_uevent_var(env, "ASYNC=%d", fw_priv->nowait))
180                 return -ENOMEM;
181
182         return 0;
183 }
184
185 static struct class firmware_class = {
186         .name           = "firmware",
187         .class_attrs    = firmware_class_attrs,
188         .dev_uevent     = firmware_uevent,
189         .dev_release    = fw_dev_release,
190 };
191
192 static ssize_t firmware_loading_show(struct device *dev,
193                                      struct device_attribute *attr, char *buf)
194 {
195         struct firmware_priv *fw_priv = to_firmware_priv(dev);
196         int loading = test_bit(FW_STATUS_LOADING, &fw_priv->status);
197
198         return sprintf(buf, "%d\n", loading);
199 }
200
201 /* firmware holds the ownership of pages */
202 static void firmware_free_data(const struct firmware *fw)
203 {
204         int i;
205         vunmap(fw->data);
206         if (fw->pages) {
207                 for (i = 0; i < PFN_UP(fw->size); i++)
208                         __free_page(fw->pages[i]);
209                 kfree(fw->pages);
210         }
211 }
212
213 /* Some architectures don't have PAGE_KERNEL_RO */
214 #ifndef PAGE_KERNEL_RO
215 #define PAGE_KERNEL_RO PAGE_KERNEL
216 #endif
217 /**
218  * firmware_loading_store - set value in the 'loading' control file
219  * @dev: device pointer
220  * @attr: device attribute pointer
221  * @buf: buffer to scan for loading control value
222  * @count: number of bytes in @buf
223  *
224  *      The relevant values are:
225  *
226  *       1: Start a load, discarding any previous partial load.
227  *       0: Conclude the load and hand the data to the driver code.
228  *      -1: Conclude the load with an error and discard any written data.
229  **/
230 static ssize_t firmware_loading_store(struct device *dev,
231                                       struct device_attribute *attr,
232                                       const char *buf, size_t count)
233 {
234         struct firmware_priv *fw_priv = to_firmware_priv(dev);
235         int loading = simple_strtol(buf, NULL, 10);
236         int i;
237
238         mutex_lock(&fw_lock);
239
240         if (!fw_priv->fw)
241                 goto out;
242
243         switch (loading) {
244         case 1:
245                 /* discarding any previous partial load */
246                 if (!test_bit(FW_STATUS_DONE, &fw_priv->status)) {
247                         for (i = 0; i < fw_priv->nr_pages; i++)
248                                 __free_page(fw_priv->pages[i]);
249                         kfree(fw_priv->pages);
250                         fw_priv->pages = NULL;
251                         fw_priv->page_array_size = 0;
252                         fw_priv->nr_pages = 0;
253                         set_bit(FW_STATUS_LOADING, &fw_priv->status);
254                 }
255                 break;
256         case 0:
257                 if (test_bit(FW_STATUS_LOADING, &fw_priv->status)) {
258                         set_bit(FW_STATUS_DONE, &fw_priv->status);
259                         clear_bit(FW_STATUS_LOADING, &fw_priv->status);
260                         complete(&fw_priv->completion);
261                         break;
262                 }
263                 /* fallthrough */
264         default:
265                 dev_err(dev, "%s: unexpected value (%d)\n", __func__, loading);
266                 /* fallthrough */
267         case -1:
268                 fw_load_abort(fw_priv);
269                 break;
270         }
271 out:
272         mutex_unlock(&fw_lock);
273         return count;
274 }
275
276 static DEVICE_ATTR(loading, 0644, firmware_loading_show, firmware_loading_store);
277
278 static ssize_t firmware_data_read(struct file *filp, struct kobject *kobj,
279                                   struct bin_attribute *bin_attr,
280                                   char *buffer, loff_t offset, size_t count)
281 {
282         struct device *dev = kobj_to_dev(kobj);
283         struct firmware_priv *fw_priv = to_firmware_priv(dev);
284         struct firmware *fw;
285         ssize_t ret_count;
286
287         mutex_lock(&fw_lock);
288         fw = fw_priv->fw;
289         if (!fw || test_bit(FW_STATUS_DONE, &fw_priv->status)) {
290                 ret_count = -ENODEV;
291                 goto out;
292         }
293         if (offset > fw_priv->size) {
294                 ret_count = 0;
295                 goto out;
296         }
297         if (count > fw_priv->size - offset)
298                 count = fw_priv->size - offset;
299
300         ret_count = count;
301
302         while (count) {
303                 void *page_data;
304                 int page_nr = offset >> PAGE_SHIFT;
305                 int page_ofs = offset & (PAGE_SIZE-1);
306                 int page_cnt = min_t(size_t, PAGE_SIZE - page_ofs, count);
307
308                 page_data = kmap(fw_priv->pages[page_nr]);
309
310                 memcpy(buffer, page_data + page_ofs, page_cnt);
311
312                 kunmap(fw_priv->pages[page_nr]);
313                 buffer += page_cnt;
314                 offset += page_cnt;
315                 count -= page_cnt;
316         }
317 out:
318         mutex_unlock(&fw_lock);
319         return ret_count;
320 }
321
322 static int fw_realloc_buffer(struct firmware_priv *fw_priv, int min_size)
323 {
324         int pages_needed = ALIGN(min_size, PAGE_SIZE) >> PAGE_SHIFT;
325
326         /* If the array of pages is too small, grow it... */
327         if (fw_priv->page_array_size < pages_needed) {
328                 int new_array_size = max(pages_needed,
329                                          fw_priv->page_array_size * 2);
330                 struct page **new_pages;
331
332                 new_pages = kmalloc(new_array_size * sizeof(void *),
333                                     GFP_KERNEL);
334                 if (!new_pages) {
335                         fw_load_abort(fw_priv);
336                         return -ENOMEM;
337                 }
338                 memcpy(new_pages, fw_priv->pages,
339                        fw_priv->page_array_size * sizeof(void *));
340                 memset(&new_pages[fw_priv->page_array_size], 0, sizeof(void *) *
341                        (new_array_size - fw_priv->page_array_size));
342                 kfree(fw_priv->pages);
343                 fw_priv->pages = new_pages;
344                 fw_priv->page_array_size = new_array_size;
345         }
346
347         while (fw_priv->nr_pages < pages_needed) {
348                 fw_priv->pages[fw_priv->nr_pages] =
349                         alloc_page(GFP_KERNEL | __GFP_HIGHMEM);
350
351                 if (!fw_priv->pages[fw_priv->nr_pages]) {
352                         fw_load_abort(fw_priv);
353                         return -ENOMEM;
354                 }
355                 fw_priv->nr_pages++;
356         }
357         return 0;
358 }
359
360 /**
361  * firmware_data_write - write method for firmware
362  * @filp: open sysfs file
363  * @kobj: kobject for the device
364  * @bin_attr: bin_attr structure
365  * @buffer: buffer being written
366  * @offset: buffer offset for write in total data store area
367  * @count: buffer size
368  *
369  *      Data written to the 'data' attribute will be later handed to
370  *      the driver as a firmware image.
371  **/
372 static ssize_t firmware_data_write(struct file *filp, struct kobject *kobj,
373                                    struct bin_attribute *bin_attr,
374                                    char *buffer, loff_t offset, size_t count)
375 {
376         struct device *dev = kobj_to_dev(kobj);
377         struct firmware_priv *fw_priv = to_firmware_priv(dev);
378         struct firmware *fw;
379         ssize_t retval;
380
381         if (!capable(CAP_SYS_RAWIO))
382                 return -EPERM;
383
384         mutex_lock(&fw_lock);
385         fw = fw_priv->fw;
386         if (!fw || test_bit(FW_STATUS_DONE, &fw_priv->status)) {
387                 retval = -ENODEV;
388                 goto out;
389         }
390
391         retval = fw_realloc_buffer(fw_priv, offset + count);
392         if (retval)
393                 goto out;
394
395         retval = count;
396
397         while (count) {
398                 void *page_data;
399                 int page_nr = offset >> PAGE_SHIFT;
400                 int page_ofs = offset & (PAGE_SIZE - 1);
401                 int page_cnt = min_t(size_t, PAGE_SIZE - page_ofs, count);
402
403                 page_data = kmap(fw_priv->pages[page_nr]);
404
405                 memcpy(page_data + page_ofs, buffer, page_cnt);
406
407                 kunmap(fw_priv->pages[page_nr]);
408                 buffer += page_cnt;
409                 offset += page_cnt;
410                 count -= page_cnt;
411         }
412
413         fw_priv->size = max_t(size_t, offset, fw_priv->size);
414 out:
415         mutex_unlock(&fw_lock);
416         return retval;
417 }
418
419 static struct bin_attribute firmware_attr_data = {
420         .attr = { .name = "data", .mode = 0644 },
421         .size = 0,
422         .read = firmware_data_read,
423         .write = firmware_data_write,
424 };
425
426 static void firmware_class_timeout(u_long data)
427 {
428         struct firmware_priv *fw_priv = (struct firmware_priv *) data;
429
430         fw_load_abort(fw_priv);
431 }
432
433 static struct firmware_priv *
434 fw_create_instance(struct firmware *firmware, const char *fw_name,
435                    struct device *device, bool uevent, bool nowait)
436 {
437         struct firmware_priv *fw_priv;
438         struct device *f_dev;
439
440         fw_priv = kzalloc(sizeof(*fw_priv) + strlen(fw_name) + 1 , GFP_KERNEL);
441         if (!fw_priv) {
442                 dev_err(device, "%s: kmalloc failed\n", __func__);
443                 return ERR_PTR(-ENOMEM);
444         }
445
446         fw_priv->fw = firmware;
447         fw_priv->nowait = nowait;
448         strcpy(fw_priv->fw_id, fw_name);
449         init_completion(&fw_priv->completion);
450         setup_timer(&fw_priv->timeout,
451                     firmware_class_timeout, (u_long) fw_priv);
452
453         f_dev = &fw_priv->dev;
454
455         device_initialize(f_dev);
456         dev_set_name(f_dev, "%s", dev_name(device));
457         f_dev->parent = device;
458         f_dev->class = &firmware_class;
459
460         return fw_priv;
461 }
462
463 static struct firmware_priv *
464 _request_firmware_prepare(const struct firmware **firmware_p, const char *name,
465                           struct device *device, bool uevent, bool nowait)
466 {
467         struct firmware *firmware;
468         struct firmware_priv *fw_priv;
469
470         if (!firmware_p)
471                 return ERR_PTR(-EINVAL);
472
473         *firmware_p = firmware = kzalloc(sizeof(*firmware), GFP_KERNEL);
474         if (!firmware) {
475                 dev_err(device, "%s: kmalloc(struct firmware) failed\n",
476                         __func__);
477                 return ERR_PTR(-ENOMEM);
478         }
479
480         if (fw_get_builtin_firmware(firmware, name)) {
481                 dev_dbg(device, "firmware: using built-in firmware %s\n", name);
482                 return NULL;
483         }
484
485         fw_priv = fw_create_instance(firmware, name, device, uevent, nowait);
486         if (IS_ERR(fw_priv)) {
487                 release_firmware(firmware);
488                 *firmware_p = NULL;
489         }
490         return fw_priv;
491 }
492
493 static void _request_firmware_cleanup(const struct firmware **firmware_p)
494 {
495         release_firmware(*firmware_p);
496         *firmware_p = NULL;
497 }
498
499 /* transfer the ownership of pages to firmware */
500 static int fw_set_page_data(struct firmware_priv *fw_priv)
501 {
502         struct firmware *fw = fw_priv->fw;
503
504         fw_priv->data = vmap(fw_priv->pages, fw_priv->nr_pages,
505                                 0, PAGE_KERNEL_RO);
506         if (!fw_priv->data)
507                 return -ENOMEM;
508
509         fw->data = fw_priv->data;
510         fw->pages = fw_priv->pages;
511         fw->size = fw_priv->size;
512
513         WARN_ON(PFN_UP(fw->size) != fw_priv->nr_pages);
514
515         fw_priv->nr_pages = 0;
516         fw_priv->pages = NULL;
517         fw_priv->data = NULL;
518
519         return 0;
520 }
521
522 static int _request_firmware_load(struct firmware_priv *fw_priv, bool uevent,
523                                   long timeout)
524 {
525         int retval = 0;
526         struct device *f_dev = &fw_priv->dev;
527
528         dev_set_uevent_suppress(f_dev, true);
529
530         /* Need to pin this module until class device is destroyed */
531         __module_get(THIS_MODULE);
532
533         retval = device_add(f_dev);
534         if (retval) {
535                 dev_err(f_dev, "%s: device_register failed\n", __func__);
536                 goto err_put_dev;
537         }
538
539         retval = device_create_bin_file(f_dev, &firmware_attr_data);
540         if (retval) {
541                 dev_err(f_dev, "%s: sysfs_create_bin_file failed\n", __func__);
542                 goto err_del_dev;
543         }
544
545         retval = device_create_file(f_dev, &dev_attr_loading);
546         if (retval) {
547                 dev_err(f_dev, "%s: device_create_file failed\n", __func__);
548                 goto err_del_bin_attr;
549         }
550
551         if (uevent) {
552                 dev_set_uevent_suppress(f_dev, false);
553                 dev_dbg(f_dev, "firmware: requesting %s\n", fw_priv->fw_id);
554                 if (timeout != MAX_SCHEDULE_TIMEOUT)
555                         mod_timer(&fw_priv->timeout,
556                                   round_jiffies_up(jiffies + timeout));
557
558                 kobject_uevent(&fw_priv->dev.kobj, KOBJ_ADD);
559         }
560
561         wait_for_completion(&fw_priv->completion);
562
563         del_timer_sync(&fw_priv->timeout);
564
565         mutex_lock(&fw_lock);
566         if (!fw_priv->size || test_bit(FW_STATUS_ABORT, &fw_priv->status))
567                 retval = -ENOENT;
568
569         /* transfer pages ownership at the last minute */
570         if (!retval)
571                 retval = fw_set_page_data(fw_priv);
572         fw_priv->fw = NULL;
573         mutex_unlock(&fw_lock);
574
575         device_remove_file(f_dev, &dev_attr_loading);
576 err_del_bin_attr:
577         device_remove_bin_file(f_dev, &firmware_attr_data);
578 err_del_dev:
579         device_del(f_dev);
580 err_put_dev:
581         put_device(f_dev);
582         return retval;
583 }
584
585 /**
586  * request_firmware: - send firmware request and wait for it
587  * @firmware_p: pointer to firmware image
588  * @name: name of firmware file
589  * @device: device for which firmware is being loaded
590  *
591  *      @firmware_p will be used to return a firmware image by the name
592  *      of @name for device @device.
593  *
594  *      Should be called from user context where sleeping is allowed.
595  *
596  *      @name will be used as $FIRMWARE in the uevent environment and
597  *      should be distinctive enough not to be confused with any other
598  *      firmware image for this or any other device.
599  **/
600 int
601 request_firmware(const struct firmware **firmware_p, const char *name,
602                  struct device *device)
603 {
604         struct firmware_priv *fw_priv;
605         int ret;
606
607         fw_priv = _request_firmware_prepare(firmware_p, name, device, true,
608                                             false);
609         if (IS_ERR_OR_NULL(fw_priv))
610                 return PTR_RET(fw_priv);
611
612         ret = usermodehelper_read_trylock();
613         if (WARN_ON(ret)) {
614                 dev_err(device, "firmware: %s will not be loaded\n", name);
615         } else {
616                 ret = _request_firmware_load(fw_priv, true,
617                                         firmware_loading_timeout());
618                 usermodehelper_read_unlock();
619         }
620         if (ret)
621                 _request_firmware_cleanup(firmware_p);
622
623         return ret;
624 }
625
626 /**
627  * release_firmware: - release the resource associated with a firmware image
628  * @fw: firmware resource to release
629  **/
630 void release_firmware(const struct firmware *fw)
631 {
632         if (fw) {
633                 if (!fw_is_builtin_firmware(fw))
634                         firmware_free_data(fw);
635                 kfree(fw);
636         }
637 }
638
639 /* Async support */
640 struct firmware_work {
641         struct work_struct work;
642         struct module *module;
643         const char *name;
644         struct device *device;
645         void *context;
646         void (*cont)(const struct firmware *fw, void *context);
647         bool uevent;
648 };
649
650 static void request_firmware_work_func(struct work_struct *work)
651 {
652         struct firmware_work *fw_work;
653         const struct firmware *fw;
654         struct firmware_priv *fw_priv;
655         long timeout;
656         int ret;
657
658         fw_work = container_of(work, struct firmware_work, work);
659         fw_priv = _request_firmware_prepare(&fw, fw_work->name, fw_work->device,
660                         fw_work->uevent, true);
661         if (IS_ERR_OR_NULL(fw_priv)) {
662                 ret = PTR_RET(fw_priv);
663                 goto out;
664         }
665
666         timeout = usermodehelper_read_lock_wait(firmware_loading_timeout());
667         if (timeout) {
668                 ret = _request_firmware_load(fw_priv, fw_work->uevent, timeout);
669                 usermodehelper_read_unlock();
670         } else {
671                 dev_dbg(fw_work->device, "firmware: %s loading timed out\n",
672                         fw_work->name);
673                 ret = -EAGAIN;
674         }
675         if (ret)
676                 _request_firmware_cleanup(&fw);
677
678  out:
679         fw_work->cont(fw, fw_work->context);
680
681         module_put(fw_work->module);
682         kfree(fw_work);
683 }
684
685 /**
686  * request_firmware_nowait - asynchronous version of request_firmware
687  * @module: module requesting the firmware
688  * @uevent: sends uevent to copy the firmware image if this flag
689  *      is non-zero else the firmware copy must be done manually.
690  * @name: name of firmware file
691  * @device: device for which firmware is being loaded
692  * @gfp: allocation flags
693  * @context: will be passed over to @cont, and
694  *      @fw may be %NULL if firmware request fails.
695  * @cont: function will be called asynchronously when the firmware
696  *      request is over.
697  *
698  *      Asynchronous variant of request_firmware() for user contexts where
699  *      it is not possible to sleep for long time. It can't be called
700  *      in atomic contexts.
701  **/
702 int
703 request_firmware_nowait(
704         struct module *module, bool uevent,
705         const char *name, struct device *device, gfp_t gfp, void *context,
706         void (*cont)(const struct firmware *fw, void *context))
707 {
708         struct firmware_work *fw_work;
709
710         fw_work = kzalloc(sizeof (struct firmware_work), gfp);
711         if (!fw_work)
712                 return -ENOMEM;
713
714         fw_work->module = module;
715         fw_work->name = name;
716         fw_work->device = device;
717         fw_work->context = context;
718         fw_work->cont = cont;
719         fw_work->uevent = uevent;
720
721         if (!try_module_get(module)) {
722                 kfree(fw_work);
723                 return -EFAULT;
724         }
725
726         INIT_WORK(&fw_work->work, request_firmware_work_func);
727         schedule_work(&fw_work->work);
728         return 0;
729 }
730
731 static int __init firmware_class_init(void)
732 {
733         return class_register(&firmware_class);
734 }
735
736 static void __exit firmware_class_exit(void)
737 {
738         class_unregister(&firmware_class);
739 }
740
741 fs_initcall(firmware_class_init);
742 module_exit(firmware_class_exit);
743
744 EXPORT_SYMBOL(release_firmware);
745 EXPORT_SYMBOL(request_firmware);
746 EXPORT_SYMBOL(request_firmware_nowait);