LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [GIT PATCH] driver core fixes against 2.6.24-git
@ 2008-02-02 23:43 Greg KH
  2008-02-02 23:55 ` [PATCH 01/10] kobject: Always build in kernel/ksysfs.o Greg Kroah-Hartman
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Greg KH @ 2008-02-02 23:43 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: linux-kernel, Paul Mundt, Frank Seidel, Dave Young,
	Tsugikazu Shibata, Jan Engelhardt, Rafael J. Wysocki,
	Stephen Rothwell, Cornelia Huck

Here's 10 patches against your current git tree that fix some more build
issues (with CONFIG_SYSFS=n), update some documentation, and refresh the
nozomi driver with some fixes.

Please pull from:
	master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6.git/

Patches will be sent as a follow-on to this message to lkml for people
to see.

thanks,

greg k-h

------------

 Documentation/driver-model/platform.txt     |    6 +-
 Documentation/ja_JP/stable_kernel_rules.txt |   79 ++++++++++++
 drivers/base/core.c                         |   40 ++----
 drivers/base/driver.c                       |    9 +-
 drivers/base/power/main.c                   |    1 +
 drivers/base/power/power.h                  |    1 -
 drivers/char/nozomi.c                       |  172 +++++++++-----------------
 include/linux/device.h                      |    6 +
 kernel/Makefile                             |    3 +-
 lib/kobject.c                               |    2 +-
 10 files changed, 167 insertions(+), 152 deletions(-)
 create mode 100644 Documentation/ja_JP/stable_kernel_rules.txt

---------------

Cornelia Huck (1):
      Driver core: Remove unneeded get_{device,driver}() calls.

Dave Young (2):
      kobject: kerneldoc comment fix
      driver core: convert to use class_find_device api

Frank Seidel (2):
      nozomi driver update
      nozomi: finish constification

Jan Engelhardt (1):
      nozomi: constify driver

Paul Mundt (1):
      kobject: Always build in kernel/ksysfs.o.

Rafael J. Wysocki (1):
      PM: Export device_pm_schedule_removal

Stephen Rothwell (1):
      Driver core: Update some prototypes in platform.txt

Tsugikazu Shibata (1):
      Add ja_JP translation of stable_kernel_rules.txt


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 01/10] kobject: Always build in kernel/ksysfs.o.
  2008-02-02 23:43 [GIT PATCH] driver core fixes against 2.6.24-git Greg KH
@ 2008-02-02 23:55 ` Greg Kroah-Hartman
  2008-02-02 23:55 ` [PATCH 02/10] kobject: kerneldoc comment fix Greg Kroah-Hartman
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2008-02-02 23:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Paul Mundt, Greg Kroah-Hartman

From: Paul Mundt <lethal@linux-sh.org>

kernel/ksysfs.c seems to be a random dumping group for misc globals
that the rest of the tree depend on. This has caused problems with
exports in the past when sysfs is disabled, which can already be
observed in commit-id 51107301b629640f9ab76fe23bf385e187b9ac29.

The latest one is the kernel_kobj usage, which presently results in:

fs/built-in.o: In function `debugfs_init':
inode.c:(.init.text+0xc34): undefined reference to `kernel_kobj'
make: *** [.tmp_vmlinux1] Error 1

kernel/ksysfs.c itself at this point only contains globals and some
basic sysfs initialization, the sysfs initialization code is optimized
out when we build with sysfs disabled. Given that, it's easier to just
build in unconditionally, rather than trying to find some other random
place to dump and initialize the globals.

Additionally, the current trend seems to be decoupling of kobjects from
sysfs, in which case it still makes sense to perform the kernel_kobj
initialization that happens here even if sysfs is disabled, as
lib/kobject.o is built-in unconditionally.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 kernel/Makefile |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/kernel/Makefile b/kernel/Makefile
index 8885627..db9af70 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 \
 	    rcupdate.o extable.o params.o posix-timers.o \
 	    kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
 	    hrtimer.o rwsem.o latency.o nsproxy.o srcu.o \
-	    utsname.o notifier.o
+	    utsname.o notifier.o ksysfs.o
 
 obj-$(CONFIG_SYSCTL) += sysctl_check.o
 obj-$(CONFIG_STACKTRACE) += stacktrace.o
@@ -49,7 +49,6 @@ obj-$(CONFIG_AUDIT) += audit.o auditfilter.o
 obj-$(CONFIG_AUDITSYSCALL) += auditsc.o
 obj-$(CONFIG_AUDIT_TREE) += audit_tree.o
 obj-$(CONFIG_KPROBES) += kprobes.o
-obj-$(CONFIG_SYSFS) += ksysfs.o
 obj-$(CONFIG_DETECT_SOFTLOCKUP) += softlockup.o
 obj-$(CONFIG_GENERIC_HARDIRQS) += irq/
 obj-$(CONFIG_SECCOMP) += seccomp.o
-- 
1.5.3.8


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 02/10] kobject: kerneldoc comment fix
  2008-02-02 23:43 [GIT PATCH] driver core fixes against 2.6.24-git Greg KH
  2008-02-02 23:55 ` [PATCH 01/10] kobject: Always build in kernel/ksysfs.o Greg Kroah-Hartman
@ 2008-02-02 23:55 ` Greg Kroah-Hartman
  2008-02-02 23:55 ` [PATCH 03/10] Add ja_JP translation of stable_kernel_rules.txt Greg Kroah-Hartman
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2008-02-02 23:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Dave Young, Greg Kroah-Hartman

From: Dave Young <hidave.darkstar@gmail.com>

Fix kerneldoc comment of kobject_create.

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 lib/kobject.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/kobject.c b/lib/kobject.c
index 1d63ead..d784dae 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -637,7 +637,7 @@ struct kobject *kobject_create(void)
  * @name: the name for the kset
  * @parent: the parent kobject of this kobject, if any.
  *
- * This function creates a kset structure dynamically and registers it
+ * This function creates a kobject structure dynamically and registers it
  * with sysfs.  When you are finished with this structure, call
  * kobject_put() and the structure will be dynamically freed when
  * it is no longer being used.
-- 
1.5.3.8


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 03/10] Add ja_JP translation of stable_kernel_rules.txt
  2008-02-02 23:43 [GIT PATCH] driver core fixes against 2.6.24-git Greg KH
  2008-02-02 23:55 ` [PATCH 01/10] kobject: Always build in kernel/ksysfs.o Greg Kroah-Hartman
  2008-02-02 23:55 ` [PATCH 02/10] kobject: kerneldoc comment fix Greg Kroah-Hartman
@ 2008-02-02 23:55 ` Greg Kroah-Hartman
  2008-02-02 23:55 ` [PATCH 04/10] nozomi driver update Greg Kroah-Hartman
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2008-02-02 23:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Tsugikazu Shibata, Greg Kroah-Hartman

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 8656 bytes --]

From: Tsugikazu Shibata <tshibata@ab.jp.nec.com>

Contents are reviewed by Japanese translation community called "JF".
Thanks a lot!

Singed-off-by: Tsugikazu Shibata <tshibata@ab.jp.nec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 Documentation/ja_JP/stable_kernel_rules.txt |   79 +++++++++++++++++++++++++++
 1 files changed, 79 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/ja_JP/stable_kernel_rules.txt

diff --git a/Documentation/ja_JP/stable_kernel_rules.txt b/Documentation/ja_JP/stable_kernel_rules.txt
new file mode 100644
index 0000000..17d8751
--- /dev/null
+++ b/Documentation/ja_JP/stable_kernel_rules.txt
@@ -0,0 +1,79 @@
+NOTE:
+This is Japanese translated version of "Documentation/stable_kernel_rules.txt".
+This one is maintained by Tsugikazu Shibata <tshibata@ab.jp.nec.com>
+and JF Project team <www.linux.or.jp/JF>.
+If you find difference with original file or problem in translation,
+please contact maintainer of this file or JF project.
+
+Please also note that purpose of this file is easier to read for non
+English natives and do no intended to fork. So, if you have any
+comment or update of this file, please try to update Original(English)
+file at first.
+
+==================================
+これは、
+linux-2.6.24/Documentation/stable_kernel_rules.txt
+の和訳です。
+
+翻訳団体: JF プロジェクト < http://www.linux.or.jp/JF/ >
+翻訳日: 2007/12/30
+翻訳者: Tsugikazu Shibata <tshibata at ab dot jp dot nec dot com>
+校正者: 武井伸光さん、<takei at webmasters dot gr dot jp>
+         かねこさん (Seiji Kaneko) <skaneko at a2 dot mbn dot or dot jp>
+         小林 雅典さん (Masanori Kobayasi) <zap03216 at nifty dot ne dot jp>
+         野口さん (Kenji Noguchi) <tokyo246 at gmail dot com>
+         神宮信太郎さん <jin at libjingu dot jp>
+==================================
+
+ずっと知りたかった Linux 2.6 -stable リリースの全て
+
+"-stable" ツリーにどのような種類のパッチが受け入れられるか、どのような
+ものが受け入れられないか、についての規則-
+
+ - 明らかに正しく、テストされているものでなければならない。
+ - 文脈(変更行の前後)を含めて 100 行より大きくてはいけない。
+ - ただ一個のことだけを修正しているべき。
+ - 皆を悩ませている本物のバグを修正しなければならない。("これはバグで
+   あるかもしれないが..." のようなものではない)
+ - ビルドエラー(CONFIG_BROKENになっているものを除く), oops, ハング、デー
+   タ破壊、現実のセキュリティ問題、その他 "ああ、これはダメだね"という
+   ようなものを修正しなければならない。短く言えば、重大な問題。
+ - どのように競合状態が発生するかの説明も一緒に書かれていない限り、
+   "理論的には競合状態になる"ようなものは不可。
+ - いかなる些細な修正も含めることはできない。(スペルの修正、空白のクリー
+   ンアップなど)
+ - 対応するサブシステムメンテナが受け入れたものでなければならない。
+ - Documentation/SubmittingPatches の規則に従ったものでなければならない。
+
+-stable ツリーにパッチを送付する手続き-
+
+ - 上記の規則に従っているかを確認した後に、stable@kernel.org にパッチ
+   を送る。
+ - 送信者はパッチがキューに受け付けられた際には ACK を、却下された場合
+   には NAK を受け取る。この反応は開発者たちのスケジュールによって、数
+   日かかる場合がある。
+ - もし受け取られたら、パッチは他の開発者たちのレビューのために
+   -stable キューに追加される。
+ - セキュリティパッチはこのエイリアス (stable@kernel.org) に送られるべ
+   きではなく、代わりに security@kernel.org のアドレスに送られる。
+
+レビューサイクル-
+
+ - -stable メンテナがレビューサイクルを決めるとき、パッチはレビュー委
+   員会とパッチが影響する領域のメンテナ(提供者がその領域のメンテナで無
+   い限り)に送られ、linux-kernel メーリングリストにCCされる。
+ - レビュー委員会は 48時間の間に ACK か NAK を出す。
+ - もしパッチが委員会のメンバから却下れるか、メンテナ達やメンバが気付
+   かなかった問題が持ちあがり、linux-kernel メンバがパッチに異議を唱え
+   た場合には、パッチはキューから削除される。
+ - レビューサイクルの最後に、ACK を受けたパッチは最新の -stable リリー
+   スに追加され、その後に新しい -stable リリースが行われる。
+ - セキュリティパッチは、通常のレビューサイクルを通らず、セキュリティ
+   カーネルチームから直接 -stable ツリーに受け付けられる。
+   この手続きの詳細については kernel security チームに問い合わせること。
+
+レビュー委員会-
+
+ - この委員会は、このタスクについて活動する多くのボランティアと、少数の
+   非ボランティアのカーネル開発者達で構成されている。
+
-- 
1.5.3.8


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 04/10] nozomi driver update
  2008-02-02 23:43 [GIT PATCH] driver core fixes against 2.6.24-git Greg KH
                   ` (2 preceding siblings ...)
  2008-02-02 23:55 ` [PATCH 03/10] Add ja_JP translation of stable_kernel_rules.txt Greg Kroah-Hartman
@ 2008-02-02 23:55 ` Greg Kroah-Hartman
  2008-02-02 23:55 ` [PATCH 05/10] nozomi: constify driver Greg Kroah-Hartman
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2008-02-02 23:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Frank Seidel, Greg Kroah-Hartman

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 6767 bytes --]

From: Frank Seidel <fseidel@suse.de>

Minor cleanups and removal of in-file changelog:

- Correction of misspellings and wrong encoded Name
- changed 'unsigned' to 'unsigned int' for better readability
- use of generic devicefile access macro
- fixed/added explanatory comment to ntty_put_char

Signed-off-by: Frank Seidel <fseidel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/char/nozomi.c |  122 ++++++++++++++----------------------------------
 1 files changed, 36 insertions(+), 86 deletions(-)

diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c
index 6076e66..86ded7e 100644
--- a/drivers/char/nozomi.c
+++ b/drivers/char/nozomi.c
@@ -2,7 +2,7 @@
  * nozomi.c  -- HSDPA driver Broadband Wireless Data Card - Globe Trotter
  *
  * Written by: Ulf Jakobsson,
- *             Jan �erfeldt,
+ *             Jan Åkerfeldt,
  *             Stefan Thomasson,
  *
  * Maintained by: Paul Hardwick (p.hardwick@option.com)
@@ -38,60 +38,6 @@
  * --------------------------------------------------------------------------
  */
 
-/*
- * CHANGELOG
- * Version 2.1d
- * 11-November-2007 Jiri Slaby, Frank Seidel
- * - Big rework of multicard support by Jiri
- * - Major cleanups (semaphore to mutex, endianess, no major reservation)
- * - Optimizations
- *
- * Version 2.1c
- * 30-October-2007 Frank Seidel
- * - Completed multicard support
- * - Minor cleanups
- *
- * Version 2.1b
- * 07-August-2007 Frank Seidel
- * - Minor cleanups
- * - theoretical multicard support
- *
- * Version 2.1
- * 03-July-2006 Paul Hardwick
- *
- * - Stability Improvements. Incorporated spinlock wraps patch.
- * - Updated for newer 2.6.14+ kernels (tty_buffer_request_room)
- * - using __devexit macro for tty
- *
- *
- * Version 2.0
- * 08-feb-2006 15:34:10:Ulf
- *
- * -Fixed issue when not waking up line disipine layer, could probably result
- *  in better uplink performance for 2.4.
- *
- * -Fixed issue with big endian during initalization, now proper toggle flags
- *  are handled between preloader and maincode.
- *
- * -Fixed flow control issue.
- *
- * -Added support for setting DTR.
- *
- * -For 2.4 kernels, removing temporary buffer that's not needed.
- *
- * -Reading CTS only for modem port (only port that supports it).
- *
- * -Return 0 in write_room instead of netative value, it's not handled in
- *  upper layer.
- *
- * --------------------------------------------------------------------------
- * Version 1.0
- *
- * First version of driver, only tested with card of type F32_2.
- * Works fine with 2.4 and 2.6 kernels.
- * Driver also support big endian architecture.
- */
-
 /* Enable this to have a lot of debug printouts */
 #define DEBUG
 
@@ -143,8 +89,9 @@ do {								\
 /* Do we need this settable at runtime? */
 static int debug = NOZOMI_DEBUG_LEVEL;
 
-#define D(lvl, args...)  do {if (lvl & debug) NFO(KERN_DEBUG, ##args); } \
-				while (0)
+#define D(lvl, args...)  do \
+			{if (lvl & debug) NFO(KERN_DEBUG, ##args); } \
+			while (0)
 #define D_(lvl, args...) D(lvl, ##args)
 
 /* These printouts are always printed */
@@ -273,13 +220,13 @@ enum port_type {
 /* Big endian */
 
 struct toggles {
-	unsigned enabled:5;	/*
+	unsigned int enabled:5;	/*
 				 * Toggle fields are valid if enabled is 0,
 				 * else A-channels must always be used.
 				 */
-	unsigned diag_dl:1;
-	unsigned mdm_dl:1;
-	unsigned mdm_ul:1;
+	unsigned int diag_dl:1;
+	unsigned int mdm_dl:1;
+	unsigned int mdm_ul:1;
 } __attribute__ ((packed));
 
 /* Configuration table to read at startup of card */
@@ -320,19 +267,19 @@ struct config_table {
 /* This stores all control downlink flags */
 struct ctrl_dl {
 	u8 port;
-	unsigned reserved:4;
-	unsigned CTS:1;
-	unsigned RI:1;
-	unsigned DCD:1;
-	unsigned DSR:1;
+	unsigned int reserved:4;
+	unsigned int CTS:1;
+	unsigned int RI:1;
+	unsigned int DCD:1;
+	unsigned int DSR:1;
 } __attribute__ ((packed));
 
 /* This stores all control uplink flags */
 struct ctrl_ul {
 	u8 port;
-	unsigned reserved:6;
-	unsigned RTS:1;
-	unsigned DTR:1;
+	unsigned int reserved:6;
+	unsigned int RTS:1;
+	unsigned int DTR:1;
 } __attribute__ ((packed));
 
 #else
@@ -340,10 +287,10 @@ struct ctrl_ul {
 
 /* This represents the toggle information */
 struct toggles {
-	unsigned mdm_ul:1;
-	unsigned mdm_dl:1;
-	unsigned diag_dl:1;
-	unsigned enabled:5;	/*
+	unsigned int mdm_ul:1;
+	unsigned int mdm_dl:1;
+	unsigned int diag_dl:1;
+	unsigned int enabled:5;	/*
 				 * Toggle fields are valid if enabled is 0,
 				 * else A-channels must always be used.
 				 */
@@ -379,19 +326,19 @@ struct config_table {
 
 /* This stores all control downlink flags */
 struct ctrl_dl {
-	unsigned DSR:1;
-	unsigned DCD:1;
-	unsigned RI:1;
-	unsigned CTS:1;
-	unsigned reserverd:4;
+	unsigned int DSR:1;
+	unsigned int DCD:1;
+	unsigned int RI:1;
+	unsigned int CTS:1;
+	unsigned int reserverd:4;
 	u8 port;
 } __attribute__ ((packed));
 
 /* This stores all control uplink flags */
 struct ctrl_ul {
-	unsigned DTR:1;
-	unsigned RTS:1;
-	unsigned reserved:6;
+	unsigned int DTR:1;
+	unsigned int RTS:1;
+	unsigned int reserved:6;
 	u8 port;
 } __attribute__ ((packed));
 #endif
@@ -694,7 +641,7 @@ static void dump_table(const struct nozomi *dc)
 	   dc->config_table.ul_ctrl_len);
 }
 #else
-static __inline__ void dump_table(const struct nozomi *dc) { }
+static inline void dump_table(const struct nozomi *dc) { }
 #endif
 
 /*
@@ -1102,7 +1049,7 @@ static int send_flow_control(struct nozomi *dc)
 }
 
 /*
- * Handle donlink data, ports that are handled are modem and diagnostics
+ * Handle downlink data, ports that are handled are modem and diagnostics
  * Return 1 - ok
  * Return 0 - toggle fields are out of sync
  */
@@ -1363,7 +1310,7 @@ static ssize_t card_type_show(struct device *dev, struct device_attribute *attr,
 
 	return sprintf(buf, "%d\n", dc->card_type);
 }
-static DEVICE_ATTR(card_type, 0444, card_type_show, NULL);
+static DEVICE_ATTR(card_type, S_IRUGO, card_type_show, NULL);
 
 static ssize_t open_ttys_show(struct device *dev, struct device_attribute *attr,
 			  char *buf)
@@ -1372,7 +1319,7 @@ static ssize_t open_ttys_show(struct device *dev, struct device_attribute *attr,
 
 	return sprintf(buf, "%u\n", dc->open_ttys);
 }
-static DEVICE_ATTR(open_ttys, 0444, open_ttys_show, NULL);
+static DEVICE_ATTR(open_ttys, S_IRUGO, open_ttys_show, NULL);
 
 static void make_sysfs_files(struct nozomi *dc)
 {
@@ -1882,7 +1829,10 @@ static void ntty_throttle(struct tty_struct *tty)
 /* just to discard single character writes */
 static void ntty_put_char(struct tty_struct *tty, unsigned char c)
 {
-	/* FIXME !!! */
+	/*
+	 * card does not react correct when we write single chars
+	 * to the card, so we discard them
+	 */
 	DBG2("PUT CHAR Function: %c", c);
 }
 
-- 
1.5.3.8


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 05/10] nozomi: constify driver
  2008-02-02 23:43 [GIT PATCH] driver core fixes against 2.6.24-git Greg KH
                   ` (3 preceding siblings ...)
  2008-02-02 23:55 ` [PATCH 04/10] nozomi driver update Greg Kroah-Hartman
@ 2008-02-02 23:55 ` Greg Kroah-Hartman
  2008-02-02 23:56 ` [PATCH 06/10] nozomi: finish constification Greg Kroah-Hartman
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2008-02-02 23:55 UTC (permalink / raw)
  To: linux-kernel; +Cc: Jan Engelhardt, Frank Seidel, Greg Kroah-Hartman

From: Jan Engelhardt <jengelh@computergmbh.de>

nozomi: constify structures and annotate vars

Signed-off-by: Jan Engelhardt <jengelh@computergmbh.de>
Signed-off-by: Frank Seidel <fseidel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/char/nozomi.c |   38 ++++++++++++++++++--------------------
 1 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c
index 86ded7e..7979eb1 100644
--- a/drivers/char/nozomi.c
+++ b/drivers/char/nozomi.c
@@ -395,7 +395,7 @@ struct buffer {
 } __attribute__ ((packed));
 
 /*    Global variables */
-static struct pci_device_id nozomi_pci_tbl[] = {
+static struct pci_device_id nozomi_pci_tbl[] __devinitdata = {
 	{PCI_DEVICE(VENDOR1, DEVICE1)},
 	{},
 };
@@ -471,12 +471,12 @@ out:
  * -Optimize
  * -Rewrite cleaner
  */
-static u32 write_mem32(void __iomem *mem_addr_start, u32 *buf,
+static u32 write_mem32(void __iomem *mem_addr_start, const u32 *buf,
 			u32 size_bytes)
 {
 	u32 i = 0;
 	u32 *ptr = (__force u32 *) mem_addr_start;
-	u16 *buf16;
+	const u16 *buf16;
 
 	if (unlikely(!ptr || !buf))
 		return 0;
@@ -484,7 +484,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, u32 *buf,
 	/* shortcut for extremely often used cases */
 	switch (size_bytes) {
 	case 2:	/* 2 bytes */
-		buf16 = (u16 *) buf;
+		buf16 = (const u16 *)buf;
 		writew(__cpu_to_le16(*buf16), (void __iomem *)ptr);
 		return 2;
 		break;
@@ -501,7 +501,7 @@ static u32 write_mem32(void __iomem *mem_addr_start, u32 *buf,
 	while (i < size_bytes) {
 		if (size_bytes - i == 2) {
 			/* 2 bytes */
-			buf16 = (u16 *) buf;
+			buf16 = (const u16 *)buf;
 			writew(__cpu_to_le16(*buf16), (void __iomem *)ptr);
 			i += 2;
 		} else {
@@ -723,8 +723,7 @@ static int nozomi_read_config_table(struct nozomi *dc)
 /* Enable uplink interrupts  */
 static void enable_transmit_ul(enum port_type port, struct nozomi *dc)
 {
-	u16 mask[NOZOMI_MAX_PORTS] = \
-			{MDM_UL, DIAG_UL, APP1_UL, APP2_UL, CTRL_UL};
+	static const u16 mask[] = {MDM_UL, DIAG_UL, APP1_UL, APP2_UL, CTRL_UL};
 
 	if (port < NOZOMI_MAX_PORTS) {
 		dc->last_ier |= mask[port];
@@ -737,8 +736,8 @@ static void enable_transmit_ul(enum port_type port, struct nozomi *dc)
 /* Disable uplink interrupts  */
 static void disable_transmit_ul(enum port_type port, struct nozomi *dc)
 {
-	u16 mask[NOZOMI_MAX_PORTS] = \
-			{~MDM_UL, ~DIAG_UL, ~APP1_UL, ~APP2_UL, ~CTRL_UL};
+	static const u16 mask[] =
+		{~MDM_UL, ~DIAG_UL, ~APP1_UL, ~APP2_UL, ~CTRL_UL};
 
 	if (port < NOZOMI_MAX_PORTS) {
 		dc->last_ier &= mask[port];
@@ -751,8 +750,7 @@ static void disable_transmit_ul(enum port_type port, struct nozomi *dc)
 /* Enable downlink interrupts */
 static void enable_transmit_dl(enum port_type port, struct nozomi *dc)
 {
-	u16 mask[NOZOMI_MAX_PORTS] = \
-			{MDM_DL, DIAG_DL, APP1_DL, APP2_DL, CTRL_DL};
+	static const u16 mask[] = {MDM_DL, DIAG_DL, APP1_DL, APP2_DL, CTRL_DL};
 
 	if (port < NOZOMI_MAX_PORTS) {
 		dc->last_ier |= mask[port];
@@ -765,8 +763,8 @@ static void enable_transmit_dl(enum port_type port, struct nozomi *dc)
 /* Disable downlink interrupts */
 static void disable_transmit_dl(enum port_type port, struct nozomi *dc)
 {
-	u16 mask[NOZOMI_MAX_PORTS] = \
-			{~MDM_DL, ~DIAG_DL, ~APP1_DL, ~APP2_DL, ~CTRL_DL};
+	static const u16 mask[] =
+		{~MDM_DL, ~DIAG_DL, ~APP1_DL, ~APP2_DL, ~CTRL_DL};
 
 	if (port < NOZOMI_MAX_PORTS) {
 		dc->last_ier &= mask[port];
@@ -783,7 +781,7 @@ static void disable_transmit_dl(enum port_type port, struct nozomi *dc)
 static int send_data(enum port_type index, struct nozomi *dc)
 {
 	u32 size = 0;
-	struct port *port = &dc->port[index];
+	const struct port *port = &dc->port[index];
 	u8 toggle = port->toggle_ul;
 	void __iomem *addr = port->ul_addr[toggle];
 	u32 ul_size = port->ul_size[toggle];
@@ -1306,7 +1304,7 @@ static void nozomi_setup_private_data(struct nozomi *dc)
 static ssize_t card_type_show(struct device *dev, struct device_attribute *attr,
 			  char *buf)
 {
-	struct nozomi *dc = pci_get_drvdata(to_pci_dev(dev));
+	const struct nozomi *dc = pci_get_drvdata(to_pci_dev(dev));
 
 	return sprintf(buf, "%d\n", dc->card_type);
 }
@@ -1315,7 +1313,7 @@ static DEVICE_ATTR(card_type, S_IRUGO, card_type_show, NULL);
 static ssize_t open_ttys_show(struct device *dev, struct device_attribute *attr,
 			  char *buf)
 {
-	struct nozomi *dc = pci_get_drvdata(to_pci_dev(dev));
+	const struct nozomi *dc = pci_get_drvdata(to_pci_dev(dev));
 
 	return sprintf(buf, "%u\n", dc->open_ttys);
 }
@@ -1682,7 +1680,7 @@ static int ntty_write_room(struct tty_struct *tty)
 {
 	struct port *port = tty->driver_data;
 	int room = 0;
-	struct nozomi *dc = get_dc_by_tty(tty);
+	const struct nozomi *dc = get_dc_by_tty(tty);
 
 	if (!dc || !port)
 		return 0;
@@ -1702,9 +1700,9 @@ exit:
 /* Gets io control parameters */
 static int ntty_tiocmget(struct tty_struct *tty, struct file *file)
 {
-	struct port *port = tty->driver_data;
-	struct ctrl_dl *ctrl_dl = &port->ctrl_dl;
-	struct ctrl_ul *ctrl_ul = &port->ctrl_ul;
+	const struct port *port = tty->driver_data;
+	const struct ctrl_dl *ctrl_dl = &port->ctrl_dl;
+	const struct ctrl_ul *ctrl_ul = &port->ctrl_ul;
 
 	return	(ctrl_ul->RTS ? TIOCM_RTS : 0) |
 		(ctrl_ul->DTR ? TIOCM_DTR : 0) |
-- 
1.5.3.8


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 06/10] nozomi: finish constification
  2008-02-02 23:43 [GIT PATCH] driver core fixes against 2.6.24-git Greg KH
                   ` (4 preceding siblings ...)
  2008-02-02 23:55 ` [PATCH 05/10] nozomi: constify driver Greg Kroah-Hartman
@ 2008-02-02 23:56 ` Greg Kroah-Hartman
  2008-02-02 23:56 ` [PATCH 07/10] PM: Export device_pm_schedule_removal Greg Kroah-Hartman
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2008-02-02 23:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: Frank Seidel, Greg Kroah-Hartman

From: Frank Seidel <fseidel@suse.de>

Even some more constifications

Signed-off-by: Frank Seidel <fseidel@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/char/nozomi.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c
index 7979eb1..dfaab23 100644
--- a/drivers/char/nozomi.c
+++ b/drivers/char/nozomi.c
@@ -395,7 +395,7 @@ struct buffer {
 } __attribute__ ((packed));
 
 /*    Global variables */
-static struct pci_device_id nozomi_pci_tbl[] __devinitdata = {
+static const struct pci_device_id nozomi_pci_tbl[] __devinitconst = {
 	{PCI_DEVICE(VENDOR1, DEVICE1)},
 	{},
 };
@@ -778,13 +778,13 @@ static void disable_transmit_dl(enum port_type port, struct nozomi *dc)
  * Return 1 - send buffer to card and ack.
  * Return 0 - don't ack, don't send buffer to card.
  */
-static int send_data(enum port_type index, struct nozomi *dc)
+static int send_data(enum port_type index, const struct nozomi *dc)
 {
 	u32 size = 0;
 	const struct port *port = &dc->port[index];
-	u8 toggle = port->toggle_ul;
+	const u8 toggle = port->toggle_ul;
 	void __iomem *addr = port->ul_addr[toggle];
-	u32 ul_size = port->ul_size[toggle];
+	const u32 ul_size = port->ul_size[toggle];
 	struct tty_struct *tty = port->tty;
 
 	/* Get data from tty and place in buf for now */
@@ -1732,7 +1732,7 @@ static int ntty_tiocmset(struct tty_struct *tty, struct file *file,
 static int ntty_cflags_changed(struct port *port, unsigned long flags,
 		struct async_icount *cprev)
 {
-	struct async_icount cnow = port->tty_icount;
+	const struct async_icount cnow = port->tty_icount;
 	int ret;
 
 	ret =	((flags & TIOCM_RNG) && (cnow.rng != cprev->rng)) ||
@@ -1747,7 +1747,7 @@ static int ntty_cflags_changed(struct port *port, unsigned long flags,
 
 static int ntty_ioctl_tiocgicount(struct port *port, void __user *argp)
 {
-	struct async_icount cnow = port->tty_icount;
+	const struct async_icount cnow = port->tty_icount;
 	struct serial_icounter_struct icount;
 
 	icount.cts = cnow.cts;
@@ -1858,7 +1858,7 @@ exit_in_buffer:
 	return rval;
 }
 
-static struct tty_operations tty_ops = {
+static const struct tty_operations tty_ops = {
 	.ioctl = ntty_ioctl,
 	.open = ntty_open,
 	.close = ntty_close,
-- 
1.5.3.8


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 07/10] PM: Export device_pm_schedule_removal
  2008-02-02 23:43 [GIT PATCH] driver core fixes against 2.6.24-git Greg KH
                   ` (5 preceding siblings ...)
  2008-02-02 23:56 ` [PATCH 06/10] nozomi: finish constification Greg Kroah-Hartman
@ 2008-02-02 23:56 ` Greg Kroah-Hartman
  2008-02-02 23:56 ` [PATCH 08/10] driver core: convert to use class_find_device api Greg Kroah-Hartman
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2008-02-02 23:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: Rafael J. Wysocki, Greg Kroah-Hartman

From: Rafael J. Wysocki <rjw@sisk.pl>

Move the declaration of device_pm_schedule_removal() to device.h
and make it exported, as it will be used directly by some drivers
for unregistering device objects during suspend/resume cycles in a
safe way.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/power/main.c  |    1 +
 drivers/base/power/power.h |    1 -
 include/linux/device.h     |    6 ++++++
 3 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c
index 200ed5f..bdc03f7 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)
 	list_move_tail(&dev->power.entry, &dpm_destroy);
 	mutex_unlock(&dpm_list_mtx);
 }
+EXPORT_SYMBOL_GPL(device_pm_schedule_removal);
 
 /**
  *	pm_sleep_lock - mutual exclusion for registration and suspend
diff --git a/drivers/base/power/power.h b/drivers/base/power/power.h
index 6f0dfca..e32d3bd 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)
 
 extern void device_pm_add(struct device *);
 extern void device_pm_remove(struct device *);
-extern void device_pm_schedule_removal(struct device *);
 extern int pm_sleep_lock(void);
 extern void pm_sleep_unlock(void);
 
diff --git a/include/linux/device.h b/include/linux/device.h
index db375be..479c0b3 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,
 extern void device_destroy(struct class *cls, dev_t devt);
 #ifdef CONFIG_PM_SLEEP
 extern void destroy_suspended_device(struct class *cls, dev_t devt);
+extern void device_pm_schedule_removal(struct device *);
 #else /* !CONFIG_PM_SLEEP */
 static inline void destroy_suspended_device(struct class *cls, dev_t devt)
 {
 	device_destroy(cls, devt);
 }
+
+static inline void device_pm_schedule_removal(struct device *dev)
+{
+	device_unregister(dev);
+}
 #endif /* !CONFIG_PM_SLEEP */
 
 /*
-- 
1.5.3.8


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 08/10] driver core: convert to use class_find_device api
  2008-02-02 23:43 [GIT PATCH] driver core fixes against 2.6.24-git Greg KH
                   ` (6 preceding siblings ...)
  2008-02-02 23:56 ` [PATCH 07/10] PM: Export device_pm_schedule_removal Greg Kroah-Hartman
@ 2008-02-02 23:56 ` Greg Kroah-Hartman
  2008-02-02 23:56 ` [PATCH 09/10] Driver core: Update some prototypes in platform.txt Greg Kroah-Hartman
  2008-02-02 23:56 ` [PATCH 10/10] Driver core: Remove unneeded get_{device,driver}() calls Greg Kroah-Hartman
  9 siblings, 0 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2008-02-02 23:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: Dave Young, Greg Kroah-Hartman

From: Dave Young <hidave.darkstar@gmail.com>

Convert to use class_find_device api in drivers/base/core.c

Signed-off-by: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/core.c |   32 +++++++++++---------------------
 1 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index b172787..a0cfda5 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1144,25 +1144,11 @@ error:
 }
 EXPORT_SYMBOL_GPL(device_create);
 
-/**
- * find_device - finds a device that was created with device_create()
- * @class: pointer to the struct class that this device was registered with
- * @devt: the dev_t of the device that was previously registered
- */
-static struct device *find_device(struct class *class, dev_t devt)
+static int __match_devt(struct device *dev, void *data)
 {
-	struct device *dev = NULL;
-	struct device *dev_tmp;
+	dev_t *devt = data;
 
-	down(&class->sem);
-	list_for_each_entry(dev_tmp, &class->devices, node) {
-		if (dev_tmp->devt == devt) {
-			dev = dev_tmp;
-			break;
-		}
-	}
-	up(&class->sem);
-	return dev;
+	return dev->devt == *devt;
 }
 
 /**
@@ -1177,9 +1163,11 @@ void device_destroy(struct class *class, dev_t devt)
 {
 	struct device *dev;
 
-	dev = find_device(class, devt);
-	if (dev)
+	dev = class_find_device(class, &devt, __match_devt);
+	if (dev) {
+		put_device(dev);
 		device_unregister(dev);
+	}
 }
 EXPORT_SYMBOL_GPL(device_destroy);
 
@@ -1203,9 +1191,11 @@ void destroy_suspended_device(struct class *class, dev_t devt)
 {
 	struct device *dev;
 
-	dev = find_device(class, devt);
-	if (dev)
+	dev = class_find_device(class, &devt, __match_devt);
+	if (dev) {
 		device_pm_schedule_removal(dev);
+		put_device(dev);
+	}
 }
 EXPORT_SYMBOL_GPL(destroy_suspended_device);
 #endif /* CONFIG_PM_SLEEP */
-- 
1.5.3.8


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 09/10] Driver core: Update some prototypes in platform.txt
  2008-02-02 23:43 [GIT PATCH] driver core fixes against 2.6.24-git Greg KH
                   ` (7 preceding siblings ...)
  2008-02-02 23:56 ` [PATCH 08/10] driver core: convert to use class_find_device api Greg Kroah-Hartman
@ 2008-02-02 23:56 ` Greg Kroah-Hartman
  2008-02-02 23:56 ` [PATCH 10/10] Driver core: Remove unneeded get_{device,driver}() calls Greg Kroah-Hartman
  9 siblings, 0 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2008-02-02 23:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: Stephen Rothwell, Greg Kroah-Hartman

From: Stephen Rothwell <sfr@canb.auug.org.au>

Just make these match the actual code.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 Documentation/driver-model/platform.txt |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Documentation/driver-model/platform.txt b/Documentation/driver-model/platform.txt
index 2a97320..83009fd 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
 using these calls except with such hotplug-deficient drivers.
 
 	struct platform_device *platform_device_alloc(
-			char *name, unsigned id);
+			const char *name, int id);
 
 You can use platform_device_alloc() to dynamically allocate a device, which
 you will then initialize with resources and platform_device_register().
 A better solution is usually:
 
 	struct platform_device *platform_device_register_simple(
-			char *name, unsigned id,
-			struct resource *res, unsigned nres);
+			const char *name, int id,
+			struct resource *res, unsigned int nres);
 
 You can use platform_device_register_simple() as a one-step call to allocate
 and register a device.
-- 
1.5.3.8


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 10/10] Driver core: Remove unneeded get_{device,driver}() calls.
  2008-02-02 23:43 [GIT PATCH] driver core fixes against 2.6.24-git Greg KH
                   ` (8 preceding siblings ...)
  2008-02-02 23:56 ` [PATCH 09/10] Driver core: Update some prototypes in platform.txt Greg Kroah-Hartman
@ 2008-02-02 23:56 ` Greg Kroah-Hartman
  9 siblings, 0 replies; 11+ messages in thread
From: Greg Kroah-Hartman @ 2008-02-02 23:56 UTC (permalink / raw)
  To: linux-kernel; +Cc: Cornelia Huck, Dave Young, Greg Kroah-Hartman

From: Cornelia Huck <cornelia.huck@de.ibm.com>

Driver core: Remove unneeded get_{device,driver}() calls.

Code trying to add/remove attributes must hold a reference to
the device resp. driver anyway, so let's remove those reference
count games.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/core.c   |    8 ++------
 drivers/base/driver.c |    9 +++------
 2 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index a0cfda5..9c0070b 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -423,10 +423,8 @@ struct kset *devices_kset;
 int device_create_file(struct device *dev, struct device_attribute *attr)
 {
 	int error = 0;
-	if (get_device(dev)) {
+	if (dev)
 		error = sysfs_create_file(&dev->kobj, &attr->attr);
-		put_device(dev);
-	}
 	return error;
 }
 
@@ -437,10 +435,8 @@ int device_create_file(struct device *dev, struct device_attribute *attr)
  */
 void device_remove_file(struct device *dev, struct device_attribute *attr)
 {
-	if (get_device(dev)) {
+	if (dev)
 		sysfs_remove_file(&dev->kobj, &attr->attr);
-		put_device(dev);
-	}
 }
 
 /**
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index a35f041..ba75184 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -97,10 +97,9 @@ int driver_create_file(struct device_driver *drv,
 		       struct driver_attribute *attr)
 {
 	int error;
-	if (get_driver(drv)) {
+	if (drv)
 		error = sysfs_create_file(&drv->p->kobj, &attr->attr);
-		put_driver(drv);
-	} else
+	else
 		error = -EINVAL;
 	return error;
 }
@@ -114,10 +113,8 @@ EXPORT_SYMBOL_GPL(driver_create_file);
 void driver_remove_file(struct device_driver *drv,
 			struct driver_attribute *attr)
 {
-	if (get_driver(drv)) {
+	if (drv)
 		sysfs_remove_file(&drv->p->kobj, &attr->attr);
-		put_driver(drv);
-	}
 }
 EXPORT_SYMBOL_GPL(driver_remove_file);
 
-- 
1.5.3.8


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-02-03  0:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-02 23:43 [GIT PATCH] driver core fixes against 2.6.24-git Greg KH
2008-02-02 23:55 ` [PATCH 01/10] kobject: Always build in kernel/ksysfs.o Greg Kroah-Hartman
2008-02-02 23:55 ` [PATCH 02/10] kobject: kerneldoc comment fix Greg Kroah-Hartman
2008-02-02 23:55 ` [PATCH 03/10] Add ja_JP translation of stable_kernel_rules.txt Greg Kroah-Hartman
2008-02-02 23:55 ` [PATCH 04/10] nozomi driver update Greg Kroah-Hartman
2008-02-02 23:55 ` [PATCH 05/10] nozomi: constify driver Greg Kroah-Hartman
2008-02-02 23:56 ` [PATCH 06/10] nozomi: finish constification Greg Kroah-Hartman
2008-02-02 23:56 ` [PATCH 07/10] PM: Export device_pm_schedule_removal Greg Kroah-Hartman
2008-02-02 23:56 ` [PATCH 08/10] driver core: convert to use class_find_device api Greg Kroah-Hartman
2008-02-02 23:56 ` [PATCH 09/10] Driver core: Update some prototypes in platform.txt Greg Kroah-Hartman
2008-02-02 23:56 ` [PATCH 10/10] Driver core: Remove unneeded get_{device,driver}() calls Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).