aboutsummaryrefslogtreecommitdiff
path: root/driver/platform.h
blob: ecac68194296e88a7b5d0b230f180d7908083fe3 (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
37
38
39
40
41
42
43
#pragma once

#include <linux/types.h>
#include <linux/platform_device.h>
#include <linux/slab.h>

int lork_probe(struct platform_device*);
int lork_remove(struct platform_device*);


ssize_t drv_attr_int_show(struct device_driver*, char*);
ssize_t drv_attr_int_store(struct device_driver*, const char*, size_t);
static const struct driver_attribute drv_attr_int = {
	.attr = {
		.name = "int",
		.mode = 0644,
	},
	.show = drv_attr_int_show,
	.store = drv_attr_int_store,
};

ssize_t dev_attr_int_show(struct device*, struct device_attribute*, char*);
ssize_t dev_attr_int_store(struct device*, struct device_attribute*, const char*, size_t);
static const struct device_attribute dev_attr_int = {
	.attr = {
		.name = "int",
		.mode = 0644,
	},
	.show = dev_attr_int_show,
	.store = dev_attr_int_store,
};

ssize_t dev_attr_str_show(struct device*, struct device_attribute*, char*);
ssize_t dev_attr_str_store(struct device*, struct device_attribute*, const char*, size_t);
static const struct device_attribute dev_attr_str = {
	.attr = {
		.name = "str",
		.mode = 0644,
	},
	.show = dev_attr_str_show,
	.store = dev_attr_str_store,
};