mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] sound: don't use the deprecated function check_region
@ 2011-08-08 11:10 stufever
  2011-08-08 12:33 ` Takashi Iwai
  0 siblings, 1 reply; 8+ messages in thread
From: stufever @ 2011-08-08 11:10 UTC (permalink / raw)
  To: linux-kernel; +Cc: tiwai, perex, Wang Shaoyan

From: Wang Shaoyan <wangshaoyan.pt@taobao.com>

  sound/oss/pss.c: In function 'configure_nonsound_components':
  sound/oss/pss.c:676: warning: 'check_region' is deprecated (declared at include/linux/ioport.h:201)

Signed-off-by: Wang Shaoyan <wangshaoyan.pt@taobao.com>
---
 sound/oss/pss.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/oss/pss.c b/sound/oss/pss.c
index 9b800ce..2fc0624 100644
--- a/sound/oss/pss.c
+++ b/sound/oss/pss.c
@@ -673,7 +673,8 @@ static void configure_nonsound_components(void)
 
 	if (pss_cdrom_port == -1) {	/* If cdrom port enablation wasn't requested */
 		printk(KERN_INFO "PSS: CDROM port not enabled.\n");
-	} else if (check_region(pss_cdrom_port, 2)) {
+	} else if (!request_region(pss_cdrom_port, 2, "PSS CDROM")) {
+		pss_cdrom_port = -1;
 		printk(KERN_ERR "PSS: CDROM I/O port conflict.\n");
 	} else {
 		set_io_base(devc, CONF_CDROM, pss_cdrom_port);
@@ -1232,7 +1233,8 @@ static void __exit cleanup_pss(void)
 		if(pssmpu)
 			unload_pss_mpu(&cfg_mpu);
 		unload_pss(&cfg);
-	}
+	} else if (pss_cdrom_port != -1)
+		release_region(pss_cdrom_port, 2);
 
 	if(!pss_keep_settings)	/* Keep hardware settings if asked */
 	{
-- 
1.7.4.1


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH] sound: don't use the deprecated function check_region
@ 2011-08-08 10:43 stufever
  2011-08-08 10:47 ` Takashi Iwai
  0 siblings, 1 reply; 8+ messages in thread
From: stufever @ 2011-08-08 10:43 UTC (permalink / raw)
  To: linux-kernel; +Cc: tiwai, perex, Wang Shaoyan

From: Wang Shaoyan <wangshaoyan.pt@taobao.com>

  sound/oss/pss.c: In function 'configure_nonsound_components':
  sound/oss/pss.c:676: warning: 'check_region' is deprecated (declared at include/linux/ioport.h:201)

Signed-off-by: Wang Shaoyan <wangshaoyan.pt@taobao.com>
---
 sound/oss/pss.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/sound/oss/pss.c b/sound/oss/pss.c
index 9b800ce..55bfea6 100644
--- a/sound/oss/pss.c
+++ b/sound/oss/pss.c
@@ -673,7 +673,7 @@ static void configure_nonsound_components(void)
 
 	if (pss_cdrom_port == -1) {	/* If cdrom port enablation wasn't requested */
 		printk(KERN_INFO "PSS: CDROM port not enabled.\n");
-	} else if (check_region(pss_cdrom_port, 2)) {
+	} else if (!request_region(pss_cdrom_port, 2, "PSS CDROM")) {
 		printk(KERN_ERR "PSS: CDROM I/O port conflict.\n");
 	} else {
 		set_io_base(devc, CONF_CDROM, pss_cdrom_port);
@@ -1223,8 +1223,7 @@ static int __init init_pss(void)
 
 static void __exit cleanup_pss(void)
 {
-	if(!pss_no_sound)
-	{
+	if (!pss_no_sound) {
 		if(fw_load && pss_synth)
 			vfree(pss_synth);
 		if(pssmss)
@@ -1232,10 +1231,10 @@ static void __exit cleanup_pss(void)
 		if(pssmpu)
 			unload_pss_mpu(&cfg_mpu);
 		unload_pss(&cfg);
-	}
+	} else
+		release_region(pss_cdrom_port, 2);
 
-	if(!pss_keep_settings)	/* Keep hardware settings if asked */
-	{
+	if (!pss_keep_settings)	{ /* Keep hardware settings if asked */
 		disable_all_emulations();
 		printk(KERN_INFO "Resetting PSS sound card configurations.\n");
 	}
-- 
1.7.4.1


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH] sound: don't use the deprecated function check_region
@ 2011-08-08  8:07 stufever
  2011-08-08  8:22 ` Takashi Iwai
  0 siblings, 1 reply; 8+ messages in thread
From: stufever @ 2011-08-08  8:07 UTC (permalink / raw)
  To: linux-kernel; +Cc: tiwai, perex, Wang Shaoyan

From: Wang Shaoyan <wangshaoyan.pt@taobao.com>

  sound/oss/pss.c: In function 'configure_nonsound_components':
  sound/oss/pss.c:676: warning: 'check_region' is deprecated (declared at include/linux/ioport.h:201)

Signed-off-by: Wang Shaoyan <wangshaoyan.pt@taobao.com>
---
 sound/oss/pss.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/sound/oss/pss.c b/sound/oss/pss.c
index 9b800ce..0fa26bd 100644
--- a/sound/oss/pss.c
+++ b/sound/oss/pss.c
@@ -673,9 +673,10 @@ static void configure_nonsound_components(void)
 
 	if (pss_cdrom_port == -1) {	/* If cdrom port enablation wasn't requested */
 		printk(KERN_INFO "PSS: CDROM port not enabled.\n");
-	} else if (check_region(pss_cdrom_port, 2)) {
+	} else if (!request_region(pss_cdrom_port, 2, "PSS CDROM")) {
 		printk(KERN_ERR "PSS: CDROM I/O port conflict.\n");
 	} else {
+		release_region(pss_cdrom_port, 2);
 		set_io_base(devc, CONF_CDROM, pss_cdrom_port);
 		printk(KERN_INFO "PSS: CDROM I/O port set to 0x%x.\n", pss_cdrom_port);
 	}
-- 
1.7.4.1


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

end of thread, other threads:[~2011-08-08 12:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-08 11:10 [PATCH] sound: don't use the deprecated function check_region stufever
2011-08-08 12:33 ` Takashi Iwai
  -- strict thread matches above, loose matches on Subject: below --
2011-08-08 10:43 stufever
2011-08-08 10:47 ` Takashi Iwai
2011-08-08  8:07 stufever
2011-08-08  8:22 ` Takashi Iwai
2011-08-08  9:33   ` Wang Shaoyan
2011-08-08  9:43     ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®