aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/driver-model/platform.txt6
-rw-r--r--Documentation/ja_JP/stable_kernel_rules.txt79
-rw-r--r--drivers/base/core.c40
-rw-r--r--drivers/base/driver.c9
-rw-r--r--drivers/base/power/main.c1
-rw-r--r--drivers/base/power/power.h1
-rw-r--r--drivers/char/nozomi.c172
-rw-r--r--include/linux/device.h6
-rw-r--r--kernel/Makefile3
-rw-r--r--lib/kobject.c2
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
122using these calls except with such hotplug-deficient drivers. 122using 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
127You can use platform_device_alloc() to dynamically allocate a device, which 127You can use platform_device_alloc() to dynamically allocate a device, which
128you will then initialize with resources and platform_device_register(). 128you will then initialize with resources and platform_device_register().
129A better solution is usually: 129A 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
135You can use platform_device_register_simple() as a one-step call to allocate 135You can use platform_device_register_simple() as a one-step call to allocate
136and register a device. 136and 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 @@
1NOTE:
2This is Japanese translated version of "Documentation/stable_kernel_rules.txt".
3This one is maintained by Tsugikazu Shibata <tshibata@ab.jp.nec.com>
4and JF Project team <www.linux.or.jp/JF>.
5If you find difference with original file or problem in translation,
6please contact maintainer of this file or JF project.
7
8Please also note that purpose of this file is easier to read for non
9English natives and do no intended to fork. So, if you have any
10comment or update of this file, please try to update Original(English)
11file at first.
12
13==================================
14これは、
15linux-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;
423int device_create_file(struct device *dev, struct device_attribute *attr) 423int 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 */
438void device_remove_file(struct device *dev, struct device_attribute *attr) 436void 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}
1145EXPORT_SYMBOL_GPL(device_create); 1141EXPORT_SYMBOL_GPL(device_create);
1146 1142
1147/** 1143static 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 */
1152static 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}
1184EXPORT_SYMBOL_GPL(device_destroy); 1168EXPORT_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}
1210EXPORT_SYMBOL_GPL(destroy_suspended_device); 1196EXPORT_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);
114void driver_remove_file(struct device_driver *drv, 113void 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}
122EXPORT_SYMBOL_GPL(driver_remove_file); 119EXPORT_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}
132EXPORT_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
14extern void device_pm_add(struct device *); 14extern void device_pm_add(struct device *);
15extern void device_pm_remove(struct device *); 15extern void device_pm_remove(struct device *);
16extern void device_pm_schedule_removal(struct device *);
17extern int pm_sleep_lock(void); 16extern int pm_sleep_lock(void);
18extern void pm_sleep_unlock(void); 17extern 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? */
144static int debug = NOZOMI_DEBUG_LEVEL; 90static 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
275struct toggles { 222struct 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 */
321struct ctrl_dl { 268struct 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 */
331struct ctrl_ul { 278struct 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 */
342struct toggles { 289struct 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 */
381struct ctrl_dl { 328struct 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 */
391struct ctrl_ul { 338struct 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 */
451static struct pci_device_id nozomi_pci_tbl[] = { 398static 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 */
527static u32 write_mem32(void __iomem *mem_addr_start, u32 *buf, 474static 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
697static __inline__ void dump_table(const struct nozomi *dc) { } 644static 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 */
777static void enable_transmit_ul(enum port_type port, struct nozomi *dc) 724static 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 */
791static void disable_transmit_ul(enum port_type port, struct nozomi *dc) 737static 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 */
805static void enable_transmit_dl(enum port_type port, struct nozomi *dc) 751static 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 */
819static void disable_transmit_dl(enum port_type port, struct nozomi *dc) 764static 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 */
836static int send_data(enum port_type index, struct nozomi *dc) 781static 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)
1359static ssize_t card_type_show(struct device *dev, struct device_attribute *attr, 1304static 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}
1366static DEVICE_ATTR(card_type, 0444, card_type_show, NULL); 1311static DEVICE_ATTR(card_type, S_IRUGO, card_type_show, NULL);
1367 1312
1368static ssize_t open_ttys_show(struct device *dev, struct device_attribute *attr, 1313static 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}
1375static DEVICE_ATTR(open_ttys, 0444, open_ttys_show, NULL); 1320static DEVICE_ATTR(open_ttys, S_IRUGO, open_ttys_show, NULL);
1376 1321
1377static void make_sysfs_files(struct nozomi *dc) 1322static 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 */
1756static int ntty_tiocmget(struct tty_struct *tty, struct file *file) 1701static 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,
1787static int ntty_cflags_changed(struct port *port, unsigned long flags, 1732static 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
1803static int ntty_ioctl_tiocgicount(struct port *port, void __user *argp) 1748static 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 */
1883static void ntty_put_char(struct tty_struct *tty, unsigned char c) 1828static 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
1913static struct tty_operations tty_ops = { 1861static 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,
534extern void device_destroy(struct class *cls, dev_t devt); 534extern void device_destroy(struct class *cls, dev_t devt);
535#ifdef CONFIG_PM_SLEEP 535#ifdef CONFIG_PM_SLEEP
536extern void destroy_suspended_device(struct class *cls, dev_t devt); 536extern void destroy_suspended_device(struct class *cls, dev_t devt);
537extern void device_pm_schedule_removal(struct device *);
537#else /* !CONFIG_PM_SLEEP */ 538#else /* !CONFIG_PM_SLEEP */
538static inline void destroy_suspended_device(struct class *cls, dev_t devt) 539static 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
544static 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
14obj-$(CONFIG_SYSCTL) += sysctl_check.o 14obj-$(CONFIG_SYSCTL) += sysctl_check.o
15obj-$(CONFIG_STACKTRACE) += stacktrace.o 15obj-$(CONFIG_STACKTRACE) += stacktrace.o
@@ -49,7 +49,6 @@ obj-$(CONFIG_AUDIT) += audit.o auditfilter.o
49obj-$(CONFIG_AUDITSYSCALL) += auditsc.o 49obj-$(CONFIG_AUDITSYSCALL) += auditsc.o
50obj-$(CONFIG_AUDIT_TREE) += audit_tree.o 50obj-$(CONFIG_AUDIT_TREE) += audit_tree.o
51obj-$(CONFIG_KPROBES) += kprobes.o 51obj-$(CONFIG_KPROBES) += kprobes.o
52obj-$(CONFIG_SYSFS) += ksysfs.o
53obj-$(CONFIG_DETECT_SOFTLOCKUP) += softlockup.o 52obj-$(CONFIG_DETECT_SOFTLOCKUP) += softlockup.o
54obj-$(CONFIG_GENERIC_HARDIRQS) += irq/ 53obj-$(CONFIG_GENERIC_HARDIRQS) += irq/
55obj-$(CONFIG_SECCOMP) += seccomp.o 54obj-$(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.