firmware: make fw->data const
[deliverable/linux.git] / include / linux / firmware.h
CommitLineData
1da177e4
LT
1#ifndef _LINUX_FIRMWARE_H
2#define _LINUX_FIRMWARE_H
3#include <linux/module.h>
4#include <linux/types.h>
5#define FIRMWARE_NAME_MAX 30
6e3eaab0
AS
6#define FW_ACTION_NOHOTPLUG 0
7#define FW_ACTION_HOTPLUG 1
8
1da177e4
LT
9struct firmware {
10 size_t size;
b7a39bd0 11 const u8 *data;
1da177e4 12};
fbab976d 13
1da177e4 14struct device;
fbab976d 15
69d44a18 16#if defined(CONFIG_FW_LOADER) || (defined(CONFIG_FW_LOADER_MODULE) && defined(MODULE))
1da177e4
LT
17int request_firmware(const struct firmware **fw, const char *name,
18 struct device *device);
19int request_firmware_nowait(
312c004d 20 struct module *module, int uevent,
1da177e4
LT
21 const char *name, struct device *device, void *context,
22 void (*cont)(const struct firmware *fw, void *context));
23
24void release_firmware(const struct firmware *fw);
fbab976d
JB
25#else
26static inline int request_firmware(const struct firmware **fw,
27 const char *name,
28 struct device *device)
29{
30 return -EINVAL;
31}
32static inline int request_firmware_nowait(
33 struct module *module, int uevent,
34 const char *name, struct device *device, void *context,
35 void (*cont)(const struct firmware *fw, void *context))
36{
37 return -EINVAL;
38}
39
40static inline void release_firmware(const struct firmware *fw)
41{
42}
43#endif
44
1da177e4 45#endif
This page took 0.453087 seconds and 5 git commands to generate.