diff options
-rw-r--r-- | Documentation/driver-model/platform.txt | 6 | ||||
-rw-r--r-- | Documentation/ja_JP/stable_kernel_rules.txt | 79 | ||||
-rw-r--r-- | drivers/base/core.c | 40 | ||||
-rw-r--r-- | drivers/base/driver.c | 9 | ||||
-rw-r--r-- | drivers/base/power/main.c | 1 | ||||
-rw-r--r-- | drivers/base/power/power.h | 1 | ||||
-rw-r--r-- | drivers/char/nozomi.c | 172 | ||||
-rw-r--r-- | include/linux/device.h | 6 | ||||
-rw-r--r-- | kernel/Makefile | 3 | ||||
-rw-r--r-- | lib/kobject.c | 2 |
10 files changed, 167 insertions, 152 deletions
diff --git a/Documentation/driver-model/platform.txt b/Documentation/driver-model/platform.txt index 2a97320ee17f..83009fdcbbc8 100644 --- a/Documentation/driver-model/platform.txt +++ b/Documentation/driver-model/platform.txt | |||
@@ -122,15 +122,15 @@ None the less, there are some APIs to support such legacy drivers. Avoid | |||
122 | using these calls except with such hotplug-deficient drivers. | 122 | using these calls except with such hotplug-deficient drivers. |
123 | 123 | ||
124 | struct platform_device *platform_device_alloc( | 124 | struct platform_device *platform_device_alloc( |
125 | char *name, unsigned id); | 125 | const char *name, int id); |
126 | 126 | ||
127 | You can use platform_device_alloc() to dynamically allocate a device, which | 127 | You can use platform_device_alloc() to dynamically allocate a device, which |
128 | you will then initialize with resources and platform_device_register(). | 128 | you will then initialize with resources and platform_device_register(). |
129 | A better solution is usually: | 129 | A better solution is usually: |
130 | 130 | ||
131 | struct platform_device *platform_device_register_simple( | 131 | struct platform_device *platform_device_register_simple( |
132 | char *name, unsigned id, | 132 | const char *name, int id, |
133 | struct resource *res, unsigned nres); | 133 | struct resource *res, unsigned int nres); |
134 | 134 | ||
135 | You can use platform_device_register_simple() as a one-step call to allocate | 135 | You can use platform_device_register_simple() as a one-step call to allocate |
136 | and register a device. | 136 | and register a device. |
diff --git a/Documentation/ja_JP/stable_kernel_rules.txt b/Documentation/ja_JP/stable_kernel_rules.txt new file mode 100644 index 000000000000..17d87519e468 --- /dev/null +++ b/Documentation/ja_JP/stable_kernel_rules.txt | |||
@@ -0,0 +1,79 @@ | |||
1 | NOTE: | ||
2 | This is Japanese translated version of "Documentation/stable_kernel_rules.txt". | ||
3 | This one is maintained by Tsugikazu Shibata <tshibata@ab.jp.nec.com> | ||
4 | and JF Project team <www.linux.or.jp/JF>. | ||
5 | If you find difference with original file or problem in translation, | ||
6 | please contact maintainer of this file or JF project. | ||
7 | |||
8 | Please also note that purpose of this file is easier to read for non | ||
9 | English natives and do no intended to fork. So, if you have any | ||
10 | comment or update of this file, please try to update Original(English) | ||
11 | file at first. | ||
12 | |||
13 | ================================== | ||
14 | ããã¯ã | ||
15 | linux-2.6.24/Documentation/stable_kernel_rules.txt | ||
16 | ã®å訳ã§ãã | ||
17 | |||
18 | 翻訳å£ä½ï¼ JF ããã¸ã§ã¯ã < http://www.linux.or.jp/JF/ > | ||
19 | 翻訳æ¥ï¼ 2007/12/30 | ||
20 | 翻訳è ï¼ Tsugikazu Shibata <tshibata at ab dot jp dot nec dot com> | ||
21 | æ ¡æ£è ï¼ æ¦äºä¼¸å ããã<takei at webmasters dot gr dot jp> | ||
22 | ããããã (Seiji Kaneko) <skaneko at a2 dot mbn dot or dot jp> | ||
23 | å°æ é å ¸ãã (Masanori Kobayasi) <zap03216 at nifty dot ne dot jp> | ||
24 | éå£ãã (Kenji Noguchi) <tokyo246 at gmail dot com> | ||
25 | ç¥å®®ä¿¡å¤ªéãã <jin at libjingu dot jp> | ||
26 | ================================== | ||
27 | |||
28 | ãã£ã¨ç¥ãããã£ã Linux 2.6 -stable ãªãªã¼ã¹ã®å ¨ã¦ | ||
29 | |||
30 | "-stable" ããªã¼ã«ã©ã®ãããªç¨®é¡ã®ããããåãå ¥ããããããã©ã®ãã㪠| ||
31 | ãã®ãåãå ¥ããããªãããã«ã¤ãã¦ã®è¦å- | ||
32 | |||
33 | - æããã«æ£ããããã¹ãããã¦ãããã®ã§ãªããã°ãªããªãã | ||
34 | - æè(å¤æ´è¡ã®åå¾)ãå«ã㦠100 è¡ãã大ããã¦ã¯ãããªãã | ||
35 | - ãã ä¸åã®ãã¨ã ããä¿®æ£ãã¦ããã¹ãã | ||
36 | - çãæ©ã¾ãã¦ããæ¬ç©ã®ãã°ãä¿®æ£ããªããã°ãªããªãã("ããã¯ãã°ã§ | ||
37 | ãããããããªãã..." ã®ãããªãã®ã§ã¯ãªã) | ||
38 | - ãã«ãã¨ã©ã¼(CONFIG_BROKENã«ãªã£ã¦ãããã®ãé¤ã), oops, ãã³ã°ããã¼ | ||
39 | ã¿ç ´å£ãç¾å®ã®ã»ãã¥ãªãã£åé¡ããã®ä» "ãããããã¯ãã¡ã ã"ã¨ãã | ||
40 | ãããªãã®ãä¿®æ£ããªããã°ãªããªããçãè¨ãã°ãé大ãªåé¡ã | ||
41 | - ã©ã®ããã«ç«¶åç¶æ ãçºçãããã®èª¬æãä¸ç·ã«æ¸ããã¦ããªãéãã | ||
42 | "çè«çã«ã¯ç«¶åç¶æ ã«ãªã"ãããªãã®ã¯ä¸å¯ã | ||
43 | - ãããªãäºç´°ãªä¿®æ£ãå«ãããã¨ã¯ã§ããªãã(ã¹ãã«ã®ä¿®æ£ã空ç½ã®ã¯ãªã¼ | ||
44 | ã³ã¢ãããªã©) | ||
45 | - 対å¿ãããµãã·ã¹ãã ã¡ã³ãããåãå ¥ãããã®ã§ãªããã°ãªããªãã | ||
46 | - Documentation/SubmittingPatches ã®è¦åã«å¾ã£ããã®ã§ãªããã°ãªããªãã | ||
47 | |||
48 | -stable ããªã¼ã«ããããéä»ããæç¶ã- | ||
49 | |||
50 | - ä¸è¨ã®è¦åã«å¾ã£ã¦ãããã確èªããå¾ã«ãstable@kernel.org ã«ããã | ||
51 | ãéãã | ||
52 | - éä¿¡è ã¯ãããããã¥ã¼ã«åãä»ããããéã«ã¯ ACK ããå´ä¸ãããå ´å | ||
53 | ã«ã¯ NAK ãåãåãããã®åå¿ã¯éçºè ãã¡ã®ã¹ã±ã¸ã¥ã¼ã«ã«ãã£ã¦ãæ° | ||
54 | æ¥ãããå ´åãããã | ||
55 | - ããåãåããããããããã¯ä»ã®éçºè ãã¡ã®ã¬ãã¥ã¼ã®ããã« | ||
56 | -stable ãã¥ã¼ã«è¿½å ãããã | ||
57 | - ã»ãã¥ãªãã£ãããã¯ãã®ã¨ã¤ãªã¢ã¹ (stable@kernel.org) ã«éãããã¹ | ||
58 | ãã§ã¯ãªãã代ããã« security@kernel.org ã®ã¢ãã¬ã¹ã«éãããã | ||
59 | |||
60 | ã¬ãã¥ã¼ãµã¤ã¯ã«- | ||
61 | |||
62 | - -stable ã¡ã³ãããã¬ãã¥ã¼ãµã¤ã¯ã«ã決ããã¨ãããããã¯ã¬ãã¥ã¼å§ | ||
63 | å¡ä¼ã¨ããããå½±é¿ããé åã®ã¡ã³ãã(æä¾è ããã®é åã®ã¡ã³ããã§ç¡ | ||
64 | ãéã)ã«éãããlinux-kernel ã¡ã¼ãªã³ã°ãªã¹ãã«CCãããã | ||
65 | - ã¬ãã¥ã¼å§å¡ä¼ã¯ 48æéã®éã« ACK ã NAK ãåºãã | ||
66 | - ããããããå§å¡ä¼ã®ã¡ã³ãããå´ä¸ããããã¡ã³ããéãã¡ã³ããæ°ä» | ||
67 | ããªãã£ãåé¡ãæã¡ããããlinux-kernel ã¡ã³ãããããã«ç°è°ãå±ã | ||
68 | ãå ´åã«ã¯ããããã¯ãã¥ã¼ããåé¤ãããã | ||
69 | - ã¬ãã¥ã¼ãµã¤ã¯ã«ã®æå¾ã«ãACK ãåãããããã¯ææ°ã® -stable ãªãªã¼ | ||
70 | ã¹ã«è¿½å ããããã®å¾ã«æ°ãã -stable ãªãªã¼ã¹ãè¡ãããã | ||
71 | - ã»ãã¥ãªãã£ãããã¯ãé常ã®ã¬ãã¥ã¼ãµã¤ã¯ã«ãéãããã»ãã¥ãªã㣠| ||
72 | ã«ã¼ãã«ãã¼ã ããç´æ¥ -stable ããªã¼ã«åãä»ããããã | ||
73 | ãã®æç¶ãã®è©³ç´°ã«ã¤ãã¦ã¯ kernel security ãã¼ã ã«åãåããããã¨ã | ||
74 | |||
75 | ã¬ãã¥ã¼å§å¡ä¼- | ||
76 | |||
77 | - ãã®å§å¡ä¼ã¯ããã®ã¿ã¹ã¯ã«ã¤ãã¦æ´»åããå¤ãã®ãã©ã³ãã£ã¢ã¨ãå°æ°ã® | ||
78 | éãã©ã³ãã£ã¢ã®ã«ã¼ãã«éçºè éã§æ§æããã¦ããã | ||
79 | |||
diff --git a/drivers/base/core.c b/drivers/base/core.c index b1727876182c..9c0070b5bd3e 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -423,10 +423,8 @@ struct kset *devices_kset; | |||
423 | int device_create_file(struct device *dev, struct device_attribute *attr) | 423 | int device_create_file(struct device *dev, struct device_attribute *attr) |
424 | { | 424 | { |
425 | int error = 0; | 425 | int error = 0; |
426 | if (get_device(dev)) { | 426 | if (dev) |
427 | error = sysfs_create_file(&dev->kobj, &attr->attr); | 427 | error = sysfs_create_file(&dev->kobj, &attr->attr); |
428 | put_device(dev); | ||
429 | } | ||
430 | return error; | 428 | return error; |
431 | } | 429 | } |
432 | 430 | ||
@@ -437,10 +435,8 @@ int device_create_file(struct device *dev, struct device_attribute *attr) | |||
437 | */ | 435 | */ |
438 | void device_remove_file(struct device *dev, struct device_attribute *attr) | 436 | void device_remove_file(struct device *dev, struct device_attribute *attr) |
439 | { | 437 | { |
440 | if (get_device(dev)) { | 438 | if (dev) |
441 | sysfs_remove_file(&dev->kobj, &attr->attr); | 439 | sysfs_remove_file(&dev->kobj, &attr->attr); |
442 | put_device(dev); | ||
443 | } | ||
444 | } | 440 | } |
445 | 441 | ||
446 | /** | 442 | /** |
@@ -1144,25 +1140,11 @@ error: | |||
1144 | } | 1140 | } |
1145 | EXPORT_SYMBOL_GPL(device_create); | 1141 | EXPORT_SYMBOL_GPL(device_create); |
1146 | 1142 | ||
1147 | /** | 1143 | static int __match_devt(struct device *dev, void *data) |
1148 | * find_device - finds a device that was created with device_create() | ||
1149 | * @class: pointer to the struct class that this device was registered with | ||
1150 | * @devt: the dev_t of the device that was previously registered | ||
1151 | */ | ||
1152 | static struct device *find_device(struct class *class, dev_t devt) | ||
1153 | { | 1144 | { |
1154 | struct device *dev = NULL; | 1145 | dev_t *devt = data; |
1155 | struct device *dev_tmp; | ||
1156 | 1146 | ||
1157 | down(&class->sem); | 1147 | return dev->devt == *devt; |
1158 | list_for_each_entry(dev_tmp, &class->devices, node) { | ||
1159 | if (dev_tmp->devt == devt) { | ||
1160 | dev = dev_tmp; | ||
1161 | break; | ||
1162 | } | ||
1163 | } | ||
1164 | up(&class->sem); | ||
1165 | return dev; | ||
1166 | } | 1148 | } |
1167 | 1149 | ||
1168 | /** | 1150 | /** |
@@ -1177,9 +1159,11 @@ void device_destroy(struct class *class, dev_t devt) | |||
1177 | { | 1159 | { |
1178 | struct device *dev; | 1160 | struct device *dev; |
1179 | 1161 | ||
1180 | dev = find_device(class, devt); | 1162 | dev = class_find_device(class, &devt, __match_devt); |
1181 | if (dev) | 1163 | if (dev) { |
1164 | put_device(dev); | ||
1182 | device_unregister(dev); | 1165 | device_unregister(dev); |
1166 | } | ||
1183 | } | 1167 | } |
1184 | EXPORT_SYMBOL_GPL(device_destroy); | 1168 | EXPORT_SYMBOL_GPL(device_destroy); |
1185 | 1169 | ||
@@ -1203,9 +1187,11 @@ void destroy_suspended_device(struct class *class, dev_t devt) | |||
1203 | { | 1187 | { |
1204 | struct device *dev; | 1188 | struct device *dev; |
1205 | 1189 | ||
1206 | dev = find_device(class, devt); | 1190 | dev = class_find_device(class, &devt, __match_devt); |
1207 | if (dev) | 1191 | if (dev) { |
1208 | device_pm_schedule_removal(dev); | 1192 | device_pm_schedule_removal(dev); |
1193 | put_device(dev); | ||
1194 | } | ||
1209 | } | 1195 | } |
1210 | EXPORT_SYMBOL_GPL(destroy_suspended_device); | 1196 | EXPORT_SYMBOL_GPL(destroy_suspended_device); |
1211 | #endif /* CONFIG_PM_SLEEP */ | 1197 | #endif /* CONFIG_PM_SLEEP */ |
diff --git a/drivers/base/driver.c b/drivers/base/driver.c index a35f04121a00..ba75184c653c 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c | |||
@@ -97,10 +97,9 @@ int driver_create_file(struct device_driver *drv, | |||
97 | struct driver_attribute *attr) | 97 | struct driver_attribute *attr) |
98 | { | 98 | { |
99 | int error; | 99 | int error; |
100 | if (get_driver(drv)) { | 100 | if (drv) |
101 | error = sysfs_create_file(&drv->p->kobj, &attr->attr); | 101 | error = sysfs_create_file(&drv->p->kobj, &attr->attr); |
102 | put_driver(drv); | 102 | else |
103 | } else | ||
104 | error = -EINVAL; | 103 | error = -EINVAL; |
105 | return error; | 104 | return error; |
106 | } | 105 | } |
@@ -114,10 +113,8 @@ EXPORT_SYMBOL_GPL(driver_create_file); | |||
114 | void driver_remove_file(struct device_driver *drv, | 113 | void driver_remove_file(struct device_driver *drv, |
115 | struct driver_attribute *attr) | 114 | struct driver_attribute *attr) |
116 | { | 115 | { |
117 | if (get_driver(drv)) { | 116 | if (drv) |
118 | sysfs_remove_file(&drv->p->kobj, &attr->attr); | 117 | sysfs_remove_file(&drv->p->kobj, &attr->attr); |
119 | put_driver(drv); | ||
120 | } | ||
121 | } | 118 | } |
122 | EXPORT_SYMBOL_GPL(driver_remove_file); | 119 | EXPORT_SYMBOL_GPL(driver_remove_file); |
123 | 120 | ||
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 200ed5fafd50..bdc03f7e8424 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
@@ -129,6 +129,7 @@ void device_pm_schedule_removal(struct device *dev) | |||
129 | list_move_tail(&dev->power.entry, &dpm_destroy); | 129 | list_move_tail(&dev->power.entry, &dpm_destroy); |
130 | mutex_unlock(&dpm_list_mtx); | 130 | mutex_unlock(&dpm_list_mtx); |
131 | } | 131 | } |
132 | EXPORT_SYMBOL_GPL(device_pm_schedule_removal); | ||
132 | 133 | ||
133 | /** | 134 | /** |
134 | * pm_sleep_lock - mutual exclusion for registration and suspend | 135 | * pm_sleep_lock - mutual exclusion for registration and suspend |
diff --git a/drivers/base/power/power.h b/drivers/base/power/power.h index 6f0dfca8ebdd..e32d3bdb92c1 100644 --- a/drivers/base/power/power.h +++ b/drivers/base/power/power.h | |||
@@ -13,7 +13,6 @@ static inline struct device *to_device(struct list_head *entry) | |||
13 | 13 | ||
14 | extern void device_pm_add(struct device *); | 14 | extern void device_pm_add(struct device *); |
15 | extern void device_pm_remove(struct device *); | 15 | extern void device_pm_remove(struct device *); |
16 | extern void device_pm_schedule_removal(struct device *); | ||
17 | extern int pm_sleep_lock(void); | 16 | extern int pm_sleep_lock(void); |
18 | extern void pm_sleep_unlock(void); | 17 | extern void pm_sleep_unlock(void); |
19 | 18 | ||
diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c index 6076e662886a..dfaab2322de3 100644 --- a/drivers/char/nozomi.c +++ b/drivers/char/nozomi.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * nozomi.c -- HSDPA driver Broadband Wireless Data Card - Globe Trotter | 2 | * nozomi.c -- HSDPA driver Broadband Wireless Data Card - Globe Trotter |
3 | * | 3 | * |
4 | * Written by: Ulf Jakobsson, | 4 | * Written by: Ulf Jakobsson, |
5 | * Jan �erfeldt, | 5 | * Jan Åkerfeldt, |
6 | * Stefan Thomasson, | 6 | * Stefan Thomasson, |
7 | * | 7 | * |
8 | * Maintained by: Paul Hardwick (p.hardwick@option.com) | 8 | * Maintained by: Paul Hardwick (p.hardwick@option.com) |
@@ -38,60 +38,6 @@ | |||
38 | * -------------------------------------------------------------------------- | 38 | * -------------------------------------------------------------------------- |
39 | */ | 39 | */ |
40 | 40 | ||
41 | /* | ||
42 | * CHANGELOG | ||
43 | * Version 2.1d | ||
44 | * 11-November-2007 Jiri Slaby, Frank Seidel | ||
45 | * - Big rework of multicard support by Jiri | ||
46 | * - Major cleanups (semaphore to mutex, endianess, no major reservation) | ||
47 | * - Optimizations | ||
48 | * | ||
49 | * Version 2.1c | ||
50 | * 30-October-2007 Frank Seidel | ||
51 | * - Completed multicard support | ||
52 | * - Minor cleanups | ||
53 | * | ||
54 | * Version 2.1b | ||
55 | * 07-August-2007 Frank Seidel | ||
56 | * - Minor cleanups | ||
57 | * - theoretical multicard support | ||
58 | * | ||
59 | * Version 2.1 | ||
60 | * 03-July-2006 Paul Hardwick | ||
61 | * | ||
62 | * - Stability Improvements. Incorporated spinlock wraps patch. | ||
63 | * - Updated for newer 2.6.14+ kernels (tty_buffer_request_room) | ||
64 | * - using __devexit macro for tty | ||
65 | * | ||
66 | * | ||
67 | * Version 2.0 | ||
68 | * 08-feb-2006 15:34:10:Ulf | ||
69 | * | ||
70 | * -Fixed issue when not waking up line disipine layer, could probably result | ||
71 | * in better uplink performance for 2.4. | ||
72 | * | ||
73 | * -Fixed issue with big endian during initalization, now proper toggle flags | ||
74 | * are handled between preloader and maincode. | ||
75 | * | ||
76 | * -Fixed flow control issue. | ||
77 | * | ||
78 | * -Added support for setting DTR. | ||
79 | * | ||
80 | * -For 2.4 kernels, removing temporary buffer that's not needed. | ||
81 | * | ||
82 | * -Reading CTS only for modem port (only port that supports it). | ||
83 | * | ||
84 | * -Return 0 in write_room instead of netative value, it's not handled in | ||
85 | * upper layer. | ||
86 | * | ||
87 | * -------------------------------------------------------------------------- | ||
88 | * Version 1.0 | ||
89 | * | ||
90 | * First version of driver, only tested with card of type F32_2. | ||
91 | * Works fine with 2.4 and 2.6 kernels. | ||
92 | * Driver also support big endian architecture. | ||
93 | */ | ||
94 | |||
95 | /* Enable this to have a lot of debug printouts */ | 41 | /* Enable this to have a lot of debug printouts */ |
96 | #define DEBUG | 42 | #define DEBUG |
97 | 43 | ||
@@ -143,8 +89,9 @@ do { \ | |||
143 | /* Do we need this settable at runtime? */ | 89 | /* Do we need this settable at runtime? */ |
144 | static int debug = NOZOMI_DEBUG_LEVEL; | 90 | static int debug = NOZOMI_DEBUG_LEVEL; |
145 | 91 | ||
146 | #define D(lvl, args...) do {if (lvl & debug) NFO(KERN_DEBUG, ##args); } \ | 92 | #define D(lvl, args...) do \ |
147 | while (0) | 93 | {if (lvl & debug) NFO(KERN_DEBUG, ##args); } \ |
94 | while (0) | ||
148 | #define D_(lvl, args...) D(lvl, ##args) | 95 | #define D_(lvl, args...) D(lvl, ##args) |
149 | 96 | ||
150 | /* These printouts are always printed */ | 97 | /* These printouts are always printed */ |
@@ -273,13 +220,13 @@ enum port_type { | |||
273 | /* Big endian */ | 220 | /* Big endian */ |
274 | 221 | ||
275 | struct toggles { | 222 | struct toggles { |
276 | unsigned enabled:5; /* | 223 | unsigned int enabled:5; /* |
277 | * Toggle fields are valid if enabled is 0, | 224 | * Toggle fields are valid if enabled is 0, |
278 | * else A-channels must always be used. | 225 | * else A-channels must always be used. |
279 | */ | 226 | */ |
280 | unsigned diag_dl:1; | 227 | unsigned int diag_dl:1; |
281 | unsigned mdm_dl:1; | 228 | unsigned int mdm_dl:1; |
282 | unsigned mdm_ul:1; | 229 | unsigned int mdm_ul:1; |
283 | } __attribute__ ((packed)); | 230 | } __attribute__ ((packed)); |
284 | 231 | ||
285 | /* Configuration table to read at startup of card */ | 232 | /* Configuration table to read at startup of card */ |
@@ -320,19 +267,19 @@ struct config_table { | |||
320 | /* This stores all control downlink flags */ | 267 | /* This stores all control downlink flags */ |
321 | struct ctrl_dl { | 268 | struct ctrl_dl { |
322 | u8 port; | 269 | u8 port; |
323 | unsigned reserved:4; | 270 | unsigned int reserved:4; |
324 | unsigned CTS:1; | 271 | unsigned int CTS:1; |
325 | unsigned RI:1; | 272 | unsigned int RI:1; |
326 | unsigned DCD:1; | 273 | unsigned int DCD:1; |
327 | unsigned DSR:1; | 274 | unsigned int DSR:1; |
328 | } __attribute__ ((packed)); | 275 | } __attribute__ ((packed)); |
329 | 276 | ||
330 | /* This stores all control uplink flags */ | 277 | /* This stores all control uplink flags */ |
331 | struct ctrl_ul { | 278 | struct ctrl_ul { |
332 | u8 port; | 279 | u8 port; |
333 | unsigned reserved:6; | 280 | unsigned int reserved:6; |
334 | unsigned RTS:1; | 281 | unsigned int RTS:1; |
335 | unsigned DTR:1; | 282 | unsigned int DTR:1; |
336 | } __attribute__ ((packed)); | 283 | } __attribute__ ((packed)); |
337 | 284 | ||
338 | #else | 285 | #else |
@@ -340,10 +287,10 @@ struct ctrl_ul { | |||
340 | 287 | ||
341 | /* This represents the toggle information */ | 288 | /* This represents the toggle information */ |
342 | struct toggles { | 289 | struct toggles { |
343 | unsigned mdm_ul:1; | 290 | unsigned int mdm_ul:1; |
344 | unsigned mdm_dl:1; | 291 | unsigned int mdm_dl:1; |
345 | unsigned diag_dl:1; | 292 | unsigned int diag_dl:1; |
346 | unsigned enabled:5; /* | 293 | unsigned int enabled:5; /* |
347 | * Toggle fields are valid if enabled is 0, | 294 | * Toggle fields are valid if enabled is 0, |
348 | * else A-channels must always be used. | 295 | * else A-channels must always be used. |
349 | */ | 296 | */ |
@@ -379,19 +326,19 @@ struct config_table { | |||
379 | 326 | ||
380 | /* This stores all control downlink flags */ | 327 | /* This stores all control downlink flags */ |
381 | struct ctrl_dl { | 328 | struct ctrl_dl { |
382 | unsigned DSR:1; | 329 | unsigned int DSR:1; |
383 | unsigned DCD:1; | 330 | unsigned int DCD:1; |
384 | unsigned RI:1; | 331 | unsigned int RI:1; |
385 | unsigned CTS:1; | 332 | unsigned int CTS:1; |
386 | unsigned reserverd:4; | 333 | unsigned int reserverd:4; |
387 | u8 port; | 334 | u8 port; |
388 | } __attribute__ ((packed)); | 335 | } __attribute__ ((packed)); |
389 | 336 | ||
390 | /* This stores all control uplink flags */ | 337 | /* This stores all control uplink flags */ |
391 | struct ctrl_ul { | 338 | struct ctrl_ul { |
392 | unsigned DTR:1; | 339 | unsigned int DTR:1; |
393 | unsigned RTS:1; | 340 | unsigned int RTS:1; |
394 | unsigned reserved:6; | 341 | unsigned int reserved:6; |
395 | u8 port; | 342 | u8 port; |
396 | } __attribute__ ((packed)); | 343 | } __attribute__ ((packed)); |
397 | #endif | 344 | #endif |
@@ -448,7 +395,7 @@ struct buffer { | |||
448 | } __attribute__ ((packed)); | 395 | } __attribute__ ((packed)); |
449 | 396 | ||
450 | /* Global variables */ | 397 | /* Global variables */ |
451 | static struct pci_device_id nozomi_pci_tbl[] = { | 398 | static const struct pci_device_id nozomi_pci_tbl[] __devinitconst = { |
452 | {PCI_DEVICE(VENDOR1, DEVICE1)}, | 399 | {PCI_DEVICE(VENDOR1, DEVICE1)}, |
453 | {}, | 400 | {}, |
454 | }; | 401 | }; |
@@ -524,12 +471,12 @@ out: | |||
524 | * -Optimize | 471 | * -Optimize |
525 | * -Rewrite cleaner | 472 | * -Rewrite cleaner |
526 | */ | 473 | */ |
527 | static u32 write_mem32(void __iomem *mem_addr_start, u32 *buf, | 474 | static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf, |
528 | u32 size_bytes) | 475 | u32 size_bytes) |
529 | { | 476 | { |
530 | u32 i = 0; | 477 | u32 i = 0; |
531 | u32 *ptr = (__force u32 *) mem_addr_start; | 478 | u32 *ptr = (__force u32 *) mem_addr_start; |
532 | u16 *buf16; | 479 | const u16 *buf16; |
533 | 480 | ||
534 | if (unlikely(!ptr || !buf)) | 481 | if (unlikely(!ptr || !buf)) |
535 | return 0; | 482 | return 0; |
@@ -537,7 +484,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, u32 *buf, | |||
537 | /* shortcut for extremely often used cases */ | 484 | /* shortcut for extremely often used cases */ |
538 | switch (size_bytes) { | 485 | switch (size_bytes) { |
539 | case 2: /* 2 bytes */ | 486 | case 2: /* 2 bytes */ |
540 | buf16 = (u16 *) buf; | 487 | buf16 = (const u16 *)buf; |
541 | writew(__cpu_to_le16(*buf16), (void __iomem *)ptr); | 488 | writew(__cpu_to_le16(*buf16), (void __iomem *)ptr); |
542 | return 2; | 489 | return 2; |
543 | break; | 490 | break; |
@@ -554,7 +501,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, u32 *buf, | |||
554 | while (i < size_bytes) { | 501 | while (i < size_bytes) { |
555 | if (size_bytes - i == 2) { | 502 | if (size_bytes - i == 2) { |
556 | /* 2 bytes */ | 503 | /* 2 bytes */ |
557 | buf16 = (u16 *) buf; | 504 | buf16 = (const u16 *)buf; |
558 | writew(__cpu_to_le16(*buf16), (void __iomem *)ptr); | 505 | writew(__cpu_to_le16(*buf16), (void __iomem *)ptr); |
559 | i += 2; | 506 | i += 2; |
560 | } else { | 507 | } else { |
@@ -694,7 +641,7 @@ static void dump_table(const struct nozomi *dc) | |||
694 | dc->config_table.ul_ctrl_len); | 641 | dc->config_table.ul_ctrl_len); |
695 | } | 642 | } |
696 | #else | 643 | #else |
697 | static __inline__ void dump_table(const struct nozomi *dc) { } | 644 | static inline void dump_table(const struct nozomi *dc) { } |
698 | #endif | 645 | #endif |
699 | 646 | ||
700 | /* | 647 | /* |
@@ -776,8 +723,7 @@ static int nozomi_read_config_table(struct nozomi *dc) | |||
776 | /* Enable uplink interrupts */ | 723 | /* Enable uplink interrupts */ |
777 | static void enable_transmit_ul(enum port_type port, struct nozomi *dc) | 724 | static void enable_transmit_ul(enum port_type port, struct nozomi *dc) |
778 | { | 725 | { |
779 | u16 mask[NOZOMI_MAX_PORTS] = \ | 726 | static const u16 mask[] = {MDM_UL, DIAG_UL, APP1_UL, APP2_UL, CTRL_UL}; |
780 | {MDM_UL, DIAG_UL, APP1_UL, APP2_UL, CTRL_UL}; | ||
781 | 727 | ||
782 | if (port < NOZOMI_MAX_PORTS) { | 728 | if (port < NOZOMI_MAX_PORTS) { |
783 | dc->last_ier |= mask[port]; | 729 | dc->last_ier |= mask[port]; |
@@ -790,8 +736,8 @@ static void enable_transmit_ul(enum port_type port, struct nozomi *dc) | |||
790 | /* Disable uplink interrupts */ | 736 | /* Disable uplink interrupts */ |
791 | static void disable_transmit_ul(enum port_type port, struct nozomi *dc) | 737 | static void disable_transmit_ul(enum port_type port, struct nozomi *dc) |
792 | { | 738 | { |
793 | u16 mask[NOZOMI_MAX_PORTS] = \ | 739 | static const u16 mask[] = |
794 | {~MDM_UL, ~DIAG_UL, ~APP1_UL, ~APP2_UL, ~CTRL_UL}; | 740 | {~MDM_UL, ~DIAG_UL, ~APP1_UL, ~APP2_UL, ~CTRL_UL}; |
795 | 741 | ||
796 | if (port < NOZOMI_MAX_PORTS) { | 742 | if (port < NOZOMI_MAX_PORTS) { |
797 | dc->last_ier &= mask[port]; | 743 | dc->last_ier &= mask[port]; |
@@ -804,8 +750,7 @@ static void disable_transmit_ul(enum port_type port, struct nozomi *dc) | |||
804 | /* Enable downlink interrupts */ | 750 | /* Enable downlink interrupts */ |
805 | static void enable_transmit_dl(enum port_type port, struct nozomi *dc) | 751 | static void enable_transmit_dl(enum port_type port, struct nozomi *dc) |
806 | { | 752 | { |
807 | u16 mask[NOZOMI_MAX_PORTS] = \ | 753 | static const u16 mask[] = {MDM_DL, DIAG_DL, APP1_DL, APP2_DL, CTRL_DL}; |
808 | {MDM_DL, DIAG_DL, APP1_DL, APP2_DL, CTRL_DL}; | ||
809 | 754 | ||
810 | if (port < NOZOMI_MAX_PORTS) { | 755 | if (port < NOZOMI_MAX_PORTS) { |
811 | dc->last_ier |= mask[port]; | 756 | dc->last_ier |= mask[port]; |
@@ -818,8 +763,8 @@ static void enable_transmit_dl(enum port_type port, struct nozomi *dc) | |||
818 | /* Disable downlink interrupts */ | 763 | /* Disable downlink interrupts */ |
819 | static void disable_transmit_dl(enum port_type port, struct nozomi *dc) | 764 | static void disable_transmit_dl(enum port_type port, struct nozomi *dc) |
820 | { | 765 | { |
821 | u16 mask[NOZOMI_MAX_PORTS] = \ | 766 | static const u16 mask[] = |
822 | {~MDM_DL, ~DIAG_DL, ~APP1_DL, ~APP2_DL, ~CTRL_DL}; | 767 | {~MDM_DL, ~DIAG_DL, ~APP1_DL, ~APP2_DL, ~CTRL_DL}; |
823 | 768 | ||
824 | if (port < NOZOMI_MAX_PORTS) { | 769 | if (port < NOZOMI_MAX_PORTS) { |
825 | dc->last_ier &= mask[port]; | 770 | dc->last_ier &= mask[port]; |
@@ -833,13 +778,13 @@ static void disable_transmit_dl(enum port_type port, struct nozomi *dc) | |||
833 | * Return 1 - send buffer to card and ack. | 778 | * Return 1 - send buffer to card and ack. |
834 | * Return 0 - don't ack, don't send buffer to card. | 779 | * Return 0 - don't ack, don't send buffer to card. |
835 | */ | 780 | */ |
836 | static int send_data(enum port_type index, struct nozomi *dc) | 781 | static int send_data(enum port_type index, const struct nozomi *dc) |
837 | { | 782 | { |
838 | u32 size = 0; | 783 | u32 size = 0; |
839 | struct port *port = &dc->port[index]; | 784 | const struct port *port = &dc->port[index]; |
840 | u8 toggle = port->toggle_ul; | 785 | const u8 toggle = port->toggle_ul; |
841 | void __iomem *addr = port->ul_addr[toggle]; | 786 | void __iomem *addr = port->ul_addr[toggle]; |
842 | u32 ul_size = port->ul_size[toggle]; | 787 | const u32 ul_size = port->ul_size[toggle]; |
843 | struct tty_struct *tty = port->tty; | 788 | struct tty_struct *tty = port->tty; |
844 | 789 | ||
845 | /* Get data from tty and place in buf for now */ | 790 | /* Get data from tty and place in buf for now */ |
@@ -1102,7 +1047,7 @@ static int send_flow_control(struct nozomi *dc) | |||
1102 | } | 1047 | } |
1103 | 1048 | ||
1104 | /* | 1049 | /* |
1105 | * Handle donlink data, ports that are handled are modem and diagnostics | 1050 | * Handle downlink data, ports that are handled are modem and diagnostics |
1106 | * Return 1 - ok | 1051 | * Return 1 - ok |
1107 | * Return 0 - toggle fields are out of sync | 1052 | * Return 0 - toggle fields are out of sync |
1108 | */ | 1053 | */ |
@@ -1359,20 +1304,20 @@ static void nozomi_setup_private_data(struct nozomi *dc) | |||
1359 | static ssize_t card_type_show(struct device *dev, struct device_attribute *attr, | 1304 | static ssize_t card_type_show(struct device *dev, struct device_attribute *attr, |
1360 | char *buf) | 1305 | char *buf) |
1361 | { | 1306 | { |
1362 | struct nozomi *dc = pci_get_drvdata(to_pci_dev(dev)); | 1307 | const struct nozomi *dc = pci_get_drvdata(to_pci_dev(dev)); |
1363 | 1308 | ||
1364 | return sprintf(buf, "%d\n", dc->card_type); | 1309 | return sprintf(buf, "%d\n", dc->card_type); |
1365 | } | 1310 | } |
1366 | static DEVICE_ATTR(card_type, 0444, card_type_show, NULL); | 1311 | static DEVICE_ATTR(card_type, S_IRUGO, card_type_show, NULL); |
1367 | 1312 | ||
1368 | static ssize_t open_ttys_show(struct device *dev, struct device_attribute *attr, | 1313 | static ssize_t open_ttys_show(struct device *dev, struct device_attribute *attr, |
1369 | char *buf) | 1314 | char *buf) |
1370 | { | 1315 | { |
1371 | struct nozomi *dc = pci_get_drvdata(to_pci_dev(dev)); | 1316 | const struct nozomi *dc = pci_get_drvdata(to_pci_dev(dev)); |
1372 | 1317 | ||
1373 | return sprintf(buf, "%u\n", dc->open_ttys); | 1318 | return sprintf(buf, "%u\n", dc->open_ttys); |
1374 | } | 1319 | } |
1375 | static DEVICE_ATTR(open_ttys, 0444, open_ttys_show, NULL); | 1320 | static DEVICE_ATTR(open_ttys, S_IRUGO, open_ttys_show, NULL); |
1376 | 1321 | ||
1377 | static void make_sysfs_files(struct nozomi *dc) | 1322 | static void make_sysfs_files(struct nozomi *dc) |
1378 | { | 1323 | { |
@@ -1735,7 +1680,7 @@ static int ntty_write_room(struct tty_struct *tty) | |||
1735 | { | 1680 | { |
1736 | struct port *port = tty->driver_data; | 1681 | struct port *port = tty->driver_data; |
1737 | int room = 0; | 1682 | int room = 0; |
1738 | struct nozomi *dc = get_dc_by_tty(tty); | 1683 | const struct nozomi *dc = get_dc_by_tty(tty); |
1739 | 1684 | ||
1740 | if (!dc || !port) | 1685 | if (!dc || !port) |
1741 | return 0; | 1686 | return 0; |
@@ -1755,9 +1700,9 @@ exit: | |||
1755 | /* Gets io control parameters */ | 1700 | /* Gets io control parameters */ |
1756 | static int ntty_tiocmget(struct tty_struct *tty, struct file *file) | 1701 | static int ntty_tiocmget(struct tty_struct *tty, struct file *file) |
1757 | { | 1702 | { |
1758 | struct port *port = tty->driver_data; | 1703 | const struct port *port = tty->driver_data; |
1759 | struct ctrl_dl *ctrl_dl = &port->ctrl_dl; | 1704 | const struct ctrl_dl *ctrl_dl = &port->ctrl_dl; |
1760 | struct ctrl_ul *ctrl_ul = &port->ctrl_ul; | 1705 | const struct ctrl_ul *ctrl_ul = &port->ctrl_ul; |
1761 | 1706 | ||
1762 | return (ctrl_ul->RTS ? TIOCM_RTS : 0) | | 1707 | return (ctrl_ul->RTS ? TIOCM_RTS : 0) | |
1763 | (ctrl_ul->DTR ? TIOCM_DTR : 0) | | 1708 | (ctrl_ul->DTR ? TIOCM_DTR : 0) | |
@@ -1787,7 +1732,7 @@ static int ntty_tiocmset(struct tty_struct *tty, struct file *file, | |||
1787 | static int ntty_cflags_changed(struct port *port, unsigned long flags, | 1732 | static int ntty_cflags_changed(struct port *port, unsigned long flags, |
1788 | struct async_icount *cprev) | 1733 | struct async_icount *cprev) |
1789 | { | 1734 | { |
1790 | struct async_icount cnow = port->tty_icount; | 1735 | const struct async_icount cnow = port->tty_icount; |
1791 | int ret; | 1736 | int ret; |
1792 | 1737 | ||
1793 | ret = ((flags & TIOCM_RNG) && (cnow.rng != cprev->rng)) || | 1738 | ret = ((flags & TIOCM_RNG) && (cnow.rng != cprev->rng)) || |
@@ -1802,7 +1747,7 @@ static int ntty_cflags_changed(struct port *port, unsigned long flags, | |||
1802 | 1747 | ||
1803 | static int ntty_ioctl_tiocgicount(struct port *port, void __user *argp) | 1748 | static int ntty_ioctl_tiocgicount(struct port *port, void __user *argp) |
1804 | { | 1749 | { |
1805 | struct async_icount cnow = port->tty_icount; | 1750 | const struct async_icount cnow = port->tty_icount; |
1806 | struct serial_icounter_struct icount; | 1751 | struct serial_icounter_struct icount; |
1807 | 1752 | ||
1808 | icount.cts = cnow.cts; | 1753 | icount.cts = cnow.cts; |
@@ -1882,7 +1827,10 @@ static void ntty_throttle(struct tty_struct *tty) | |||
1882 | /* just to discard single character writes */ | 1827 | /* just to discard single character writes */ |
1883 | static void ntty_put_char(struct tty_struct *tty, unsigned char c) | 1828 | static void ntty_put_char(struct tty_struct *tty, unsigned char c) |
1884 | { | 1829 | { |
1885 | /* FIXME !!! */ | 1830 | /* |
1831 | * card does not react correct when we write single chars | ||
1832 | * to the card, so we discard them | ||
1833 | */ | ||
1886 | DBG2("PUT CHAR Function: %c", c); | 1834 | DBG2("PUT CHAR Function: %c", c); |
1887 | } | 1835 | } |
1888 | 1836 | ||
@@ -1910,7 +1858,7 @@ exit_in_buffer: | |||
1910 | return rval; | 1858 | return rval; |
1911 | } | 1859 | } |
1912 | 1860 | ||
1913 | static struct tty_operations tty_ops = { | 1861 | static const struct tty_operations tty_ops = { |
1914 | .ioctl = ntty_ioctl, | 1862 | .ioctl = ntty_ioctl, |
1915 | .open = ntty_open, | 1863 | .open = ntty_open, |
1916 | .close = ntty_close, | 1864 | .close = ntty_close, |
diff --git a/include/linux/device.h b/include/linux/device.h index db375be333c7..479c0b31593c 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -534,11 +534,17 @@ extern struct device *device_create(struct class *cls, struct device *parent, | |||
534 | extern void device_destroy(struct class *cls, dev_t devt); | 534 | extern void device_destroy(struct class *cls, dev_t devt); |
535 | #ifdef CONFIG_PM_SLEEP | 535 | #ifdef CONFIG_PM_SLEEP |
536 | extern void destroy_suspended_device(struct class *cls, dev_t devt); | 536 | extern void destroy_suspended_device(struct class *cls, dev_t devt); |
537 | extern void device_pm_schedule_removal(struct device *); | ||
537 | #else /* !CONFIG_PM_SLEEP */ | 538 | #else /* !CONFIG_PM_SLEEP */ |
538 | static inline void destroy_suspended_device(struct class *cls, dev_t devt) | 539 | static inline void destroy_suspended_device(struct class *cls, dev_t devt) |
539 | { | 540 | { |
540 | device_destroy(cls, devt); | 541 | device_destroy(cls, devt); |
541 | } | 542 | } |
543 | |||
544 | static inline void device_pm_schedule_removal(struct device *dev) | ||
545 | { | ||
546 | device_unregister(dev); | ||
547 | } | ||
542 | #endif /* !CONFIG_PM_SLEEP */ | 548 | #endif /* !CONFIG_PM_SLEEP */ |
543 | 549 | ||
544 | /* | 550 | /* |
diff --git a/kernel/Makefile b/kernel/Makefile index 8885627ea021..db9af707ff5b 100644 --- a/kernel/Makefile +++ b/kernel/Makefile | |||
@@ -9,7 +9,7 @@ obj-y = sched.o fork.o exec_domain.o panic.o printk.o profile.o \ | |||
9 | rcupdate.o extable.o params.o posix-timers.o \ | 9 | rcupdate.o extable.o params.o posix-timers.o \ |
10 | kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \ | 10 | kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \ |
11 | hrtimer.o rwsem.o latency.o nsproxy.o srcu.o \ | 11 | hrtimer.o rwsem.o latency.o nsproxy.o srcu.o \ |
12 | utsname.o notifier.o | 12 | utsname.o notifier.o ksysfs.o |
13 | 13 | ||
14 | obj-$(CONFIG_SYSCTL) += sysctl_check.o | 14 | obj-$(CONFIG_SYSCTL) += sysctl_check.o |
15 | obj-$(CONFIG_STACKTRACE) += stacktrace.o | 15 | obj-$(CONFIG_STACKTRACE) += stacktrace.o |
@@ -49,7 +49,6 @@ obj-$(CONFIG_AUDIT) += audit.o auditfilter.o | |||
49 | obj-$(CONFIG_AUDITSYSCALL) += auditsc.o | 49 | obj-$(CONFIG_AUDITSYSCALL) += auditsc.o |
50 | obj-$(CONFIG_AUDIT_TREE) += audit_tree.o | 50 | obj-$(CONFIG_AUDIT_TREE) += audit_tree.o |
51 | obj-$(CONFIG_KPROBES) += kprobes.o | 51 | obj-$(CONFIG_KPROBES) += kprobes.o |
52 | obj-$(CONFIG_SYSFS) += ksysfs.o | ||
53 | obj-$(CONFIG_DETECT_SOFTLOCKUP) += softlockup.o | 52 | obj-$(CONFIG_DETECT_SOFTLOCKUP) += softlockup.o |
54 | obj-$(CONFIG_GENERIC_HARDIRQS) += irq/ | 53 | obj-$(CONFIG_GENERIC_HARDIRQS) += irq/ |
55 | obj-$(CONFIG_SECCOMP) += seccomp.o | 54 | obj-$(CONFIG_SECCOMP) += seccomp.o |
diff --git a/lib/kobject.c b/lib/kobject.c index 1d63ead1815e..d784daeb8571 100644 --- a/lib/kobject.c +++ b/lib/kobject.c | |||
@@ -637,7 +637,7 @@ struct kobject *kobject_create(void) | |||
637 | * @name: the name for the kset | 637 | * @name: the name for the kset |
638 | * @parent: the parent kobject of this kobject, if any. | 638 | * @parent: the parent kobject of this kobject, if any. |
639 | * | 639 | * |
640 | * This function creates a kset structure dynamically and registers it | 640 | * This function creates a kobject structure dynamically and registers it |
641 | * with sysfs. When you are finished with this structure, call | 641 | * with sysfs. When you are finished with this structure, call |
642 | * kobject_put() and the structure will be dynamically freed when | 642 | * kobject_put() and the structure will be dynamically freed when |
643 | * it is no longer being used. | 643 | * it is no longer being used. |