#include <linux/fs.h>
#include <linux/cdev.h>
+#include <asm/atomic.h>
enum fw_device_state {
FW_DEVICE_INITIALIZING,
FW_DEVICE_RUNNING,
- FW_DEVICE_SHUTDOWN
+ FW_DEVICE_SHUTDOWN,
};
struct fw_device {
- int state;
+ atomic_t state;
struct fw_node *node;
int node_id;
int generation;
static inline struct fw_device *
fw_device(struct device *dev)
{
- return container_of(dev, struct fw_device, device);
+ return container_of(dev, struct fw_device, device);
}
struct fw_device *fw_device_get(struct fw_device *device);
static inline struct fw_unit *
fw_unit(struct device *dev)
{
- return container_of(dev, struct fw_unit, device);
+ return container_of(dev, struct fw_unit, device);
}
#define CSR_OFFSET 0x40
static inline struct fw_driver *
fw_driver(struct device_driver *drv)
{
- return container_of(drv, struct fw_driver, driver);
+ return container_of(drv, struct fw_driver, driver);
}
extern const struct file_operations fw_device_ops;