summaryrefslogtreecommitdiff
path: root/include/linux/ipaq-sleeve.h
blob: 42352e942c3c272094b1640ed4edf8ec41281d8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef LINUX_IPAQ_SLEEVE_H
#define LINUX_IPAQ_SLEEVE_H

#include <linux/device.h>
#include <linux/mod_devicetable.h>

struct ipaq_option_device {
	struct ipaq_option_id id;
	const char *description;
	struct device dev;
};
#define to_ipaq_option_device(x) container_of(x, struct ipaq_option_device, dev)

struct ipaq_option_driver {
	const struct ipaq_option_id *id_table;
	struct device_driver driver;
};

extern struct bus_type ipaq_option_sleeve_bus;

int ipaq_option_device_add(struct device *parent, struct ipaq_option_id id,
			   const char *description);
void ipaq_option_device_del(void);

static inline int ipaq_option_driver_register(struct ipaq_option_driver *drv)
{
	drv->driver.bus = &ipaq_option_sleeve_bus;
	return driver_register(&drv->driver);
}

static inline void ipaq_option_driver_unregister(struct ipaq_option_driver *drv)
{
	driver_unregister(&drv->driver);
}

#endif